assertEquals(Arrays.asList(expected, null, null, null, expected), task1.getList());
}
public void testBadProxyInterfaces() throws Exception {
ContextService service = getContextService();
MyTask task1 = new MyTask();
try {
service.createContextObject(task1, null);
fail("Did not throw exception");
} catch (IllegalArgumentException e) {
// ok
}
try {
service.createContextObject(task1, new Class[] {} );
fail("Did not throw exception");
} catch (IllegalArgumentException e) {
// ok
}
try {
service.createContextObject(task1, new Class[] {null} );
fail("Did not throw exception");
} catch (IllegalArgumentException e) {
// ok
}
try {
service.createContextObject(task1, new Class[] {Serializable.class, null} );
fail("Did not throw exception");
} catch (IllegalArgumentException e) {
// ok
}
try {
service.createContextObject(task1, new Class[] {Runnable.class, null} );
fail("Did not throw exception");
} catch (IllegalArgumentException e) {
// ok
}
}