-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathArrayQueueToArrayTest.java
More file actions
33 lines (27 loc) · 1.25 KB
/
Copy pathArrayQueueToArrayTest.java
File metadata and controls
33 lines (27 loc) · 1.25 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
import java.net.MalformedURLException;
import java.util.Arrays;
import java.util.Deque;
/**
* @author Georgiy Korneev (kgeorgiy@kgeorgiy.info)
*/
public class ArrayQueueToArrayTest extends ArrayQueueTest<ArrayQueueToArrayTest.ToArrayQueue> {
public static void main(final String[] args) throws MalformedURLException, ClassNotFoundException, NoSuchMethodException {
new ArrayQueueToArrayTest().test();
}
@Override
protected ToArrayQueue create(final String className, final Mode mode) throws NoSuchMethodException, ClassNotFoundException, MalformedURLException {
return new ToArrayQueue(className, mode);
}
@Override
protected void linearTest(final Deque<Object> expected, final ToArrayQueue actual) {
assertEquals("toArray()", Arrays.asList(expected.toArray()), Arrays.asList(actual.toArray()));
}
static class ToArrayQueue extends ArrayQueueTest.Queue {
private final ZMethod<Object[]> toArray;
public ToArrayQueue(final String className, final Mode mode) throws MalformedURLException, NoSuchMethodException, ClassNotFoundException {
super(className, mode);
toArray = findMethod("toArray");
}
public Object[] toArray() { return toArray.invoke(); }
}
}