Example #1
0
 @Test
 public void testDiscoverRunnableMission() throws NoSuchMethodException {
   List<Method> actualMethods = runnableMole.discover(TestDefinitions.RunnableMission.class);
   List<Method> expectedMethods = new ArrayList<>();
   expectedMethods.add(TestDefinitions.RunnableMission.class.getMethod("run"));
   assertEquals(expectedMethods, actualMethods);
 }
Example #2
0
 @Test
 public void testRunWithNonExistentMissionContentClassType() {
   expectedException.expect(MissionExecutionException.class);
   expectedException.expectCause(isA(ClassNotFoundException.class));
   runnableMole.run("NonExistent");
 }
Example #3
0
 @Test
 public void testRunWithNullMissionContentClassType() {
   expectedException.expect(MissionExecutionException.class);
   expectedException.expectCause(isA(IllegalArgumentException.class));
   runnableMole.run(null);
 }
Example #4
0
 @Test
 public void testRunWithNonRunnableMission() {
   expectedException.expect(MissionExecutionException.class);
   expectedException.expectCause(isA(IllegalArgumentException.class));
   runnableMole.run(TestDefinitions.EmptyMission.class.getName());
 }
Example #5
0
 @Test
 public void testRunRunnableMission() {
   runnableMole.run(TestDefinitions.RunnableMission.class.getName());
 }
Example #6
0
 @Test
 public void testDiscoverRunnableMissionWithNullClassType() {
   expectedException.expect(IllegalArgumentException.class);
   runnableMole.discover(null);
 }
Example #7
0
 @Test
 public void testDiscoverNonRunnableMission() {
   List<Method> actualMethods = runnableMole.discover(TestDefinitions.EmptyMission.class);
   assertTrue(actualMethods.isEmpty());
 }