use of org.evosuite.runtime.mock.EvoSuiteMock in project evosuite by EvoSuite.
the class InstrumentingAgent_exceptionsIntTest method testExceptions.
@Test
public void testExceptions() {
Object obj = null;
try {
InstrumentingAgent.activate();
obj = new ExceptionHolder();
} finally {
InstrumentingAgent.deactivate();
}
try {
MockFramework.enable();
ExceptionHolder eh = (ExceptionHolder) obj;
Assert.assertFalse(eh.getNonMockedNPE() instanceof EvoSuiteMock);
Assert.assertTrue(eh.getMockedThrowable() instanceof EvoSuiteMock);
StackTraceElement[] traces = new MockThrowable().getStackTrace();
StackTraceElement[] a = eh.getTracesWhenCast();
Assert.assertEquals(traces[1], a[1]);
} finally {
MockFramework.disable();
}
}
Aggregations