-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeapDriverTest.java
More file actions
221 lines (200 loc) · 5 KB
/
HeapDriverTest.java
File metadata and controls
221 lines (200 loc) · 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintStream;
/**
* HeapDriverTest.
* @author Courtney Dixon
* @version 11/9/2019
*/
public class HeapDriverTest {
/**
* Tests that the HeapDriver class exists.
*/
@Test
public void testHeapDriverExists() {
Class d;
try {
d = Class.forName("HeapDriver");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the FibonacciHeapDriver class exists.
*/
@Test
public void testFibonacciHeapDriverExists() {
Class d;
try {
d = Class.forName("FibonacciHeapDriver");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the HollowHeapDriver class exists.
*/
@Test
public void testHollowHeapDriverExists() {
Class d;
try {
d = Class.forName("HollowHeapDriver");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the FibonacciHeap class exists.
*/
@Test
public void testFibonacciHeapExists() {
Class f;
try {
f = Class.forName("FibonacciHeap");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the HollowHeap class exists.
*/
@Test
public void testHollowHeapExists() {
Class h;
try {
h = Class.forName("HollowHeap");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the Node class exists.
*/
@Test
public void testNodeExists() {
Class n;
try {
n = Class.forName("Node");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the FibonacciNode class exists.
*/
@Test
public void testFibonacciNodeExists() {
Class n;
try {
n = Class.forName("FibonacciNode");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests that the HollowNode class exists.
*/
@Test
public void testHollowNodeExists() {
Class hn;
try {
hn = Class.forName("HollowNode");
}
catch (Exception e) {
fail("Did you name the class correctly? " + e);
}
}
/**
* Tests FibonacciHeap constructor.
*/
@Test
public void testFibonacciHeapConstructor() {
try {
FibonacciHeap fHeap = new FibonacciHeap();
}
catch (Exception ex) {
fail("Constructor did not work. " + ex);
}
}
/**
* Tests HollowHeap constructor.
*/
@Test
public void testHollowHeapConstructor() {
try {
HollowHeap hHeap = new HollowHeap();
}
catch (Exception ex) {
fail("Constructor did not work. " + ex);
}
}
/**
* Tests a method that builds something.
*/
//@Test
//public void test()
//{
// try
// {
// }
// catch (Exception ex)
// {
// fail("FAIL.COM" + ex);
// }
//}
/**
* Tests a method that returns/gets something.
*/
//@Test
//public void test()
//{
//make a new object
//assign to a local variable a call the accessor method
//if(local variable != what it should equal)
//{
// fail("The thing should be this not " + local variable);
//}
//}
/**
* Test a method that sets/mutates something like a field.
*/
//@Test
//public void test()
//{
//make a new object
//set the things with call to mutator method
//make local variable to hold call to accessor method(s)
//for each thing set if(local variable != what it should)
//{
//fail("The thing should be this, not " + local variable);
//}
//}
/**
* Tests a method that prints to output.
*/
//@Test
//public void test()
//{
//make a new object
//ByteArrayOutputStream baos = new ByteArrayOutputStream();
//System.setOut(new PrintStream(baos));
//call method that prints/displays stuff
//System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
//String s = baos.toString();
//if (! "the stuff it's supposed to print".equals(s))
//{
// fail("Unexpected output:\n" + s + "\n");
//}
//}
}