diff --git a/src/test/java/br/unicamp/cst/core/entities/CodeletTest.java b/src/test/java/br/unicamp/cst/core/entities/CodeletTest.java index 297a356..720c999 100644 --- a/src/test/java/br/unicamp/cst/core/entities/CodeletTest.java +++ b/src/test/java/br/unicamp/cst/core/entities/CodeletTest.java @@ -198,30 +198,29 @@ public void getOutputNullReturnTest(){ public void getOutputEnableFalseTest(){ boolean exceptionThrown = false; Codelet testCodelet = null; - try { testCodelet = generateCodelet(); testCodelet.setName("thisCodeletWillFail"); List dummyOutputs = Arrays.asList(new MemoryObject(), new MemoryObject()); testCodelet.setOutputs(dummyOutputs); - - - testCodelet.getOutput("testType", 3); // This line will raise an exception - - Mind mind = new Mind(); - mind.insertCodelet(testCodelet); - mind.start(); - // - Thread.sleep(1000); -// } catch (Exception e) { -// e.printStackTrace(); -// } - mind.shutDown(); - } catch (Exception e) { - // why this exception is not being thrown ? - System.out.println("Passei aqui"); - exceptionThrown = true; + + + Memory output = testCodelet.getOutput("testType", 3); + assertNull(output); + + Mind mind = new Mind(); + mind.insertCodelet(testCodelet); + mind.start(); + try{ + Thread.sleep(1000); + } + catch (InterruptedException e) + { + } - //assertTrue(exceptionThrown); If I uncomment this line, the test fails ... for some reason the exception is not being caught + + + mind.shutDown(); + assertFalse(testCodelet.getEnabled()); testCodelet.setEnabled(true); assertTrue(testCodelet.getEnabled());