use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneShowMessageDialogTest method buildTestCase1TrueBranch.
private static TestCase buildTestCase1TrueBranch(InstrumentingClassLoader cl) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
TestCaseBuilder builder = new TestCaseBuilder();
Class<?> clazz = cl.loadClass(ShowMessageDialogExample.class.getCanonicalName());
Constructor<?> constructor = clazz.getConstructor();
VariableReference showMessageDialogExample0 = builder.appendConstructor(constructor);
VariableReference int0 = builder.appendIntPrimitive(0);
Method showMessageDialogMethod = clazz.getMethod("showMessageDialog1", int.class);
builder.appendMethod(showMessageDialogExample0, showMessageDialogMethod, int0);
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneShowOptionDialogTest method buildTestCase0.
private static TestCase buildTestCase0(InstrumentingClassLoader cl) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
TestCaseBuilder builder = new TestCaseBuilder();
Class<?> clazz = cl.loadClass(ShowOptionDialogExample.class.getCanonicalName());
Constructor<?> constructor = clazz.getConstructor();
VariableReference showMessageDialogExample0 = builder.appendConstructor(constructor);
Method showOptionDialogMethod = clazz.getMethod("showOptionDialog");
builder.appendMethod(showMessageDialogExample0, showOptionDialogMethod);
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneTest method buildTestCase0.
private static TestCase buildTestCase0(InstrumentingClassLoader cl) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
TestCaseBuilder builder = new TestCaseBuilder();
Class<?> clazz = cl.loadClass(TARGET_CLASS);
Constructor<?> constructor = clazz.getConstructor();
VariableReference showMessageDialogExample0 = builder.appendConstructor(constructor);
Method showConfirmDialogsMethod = clazz.getMethod("ask");
builder.appendMethod(showMessageDialogExample0, showConfirmDialogsMethod);
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestDefaultValue method testShort.
@Test
public void testShort() throws SecurityException, NoSuchMethodException {
TestCaseBuilder builder = new TestCaseBuilder();
ArrayReference integerArray0 = builder.appendArrayStmt(Short[].class, 10);
VariableReference integer0 = builder.appendNull(Short.class);
builder.appendAssignment(integerArray0, 0, integer0);
builder.appendAssignment(integer0, integerArray0, 0);
builder.appendMethod(integer0, Short.class.getMethod("toString"));
DefaultTestCase tc = builder.getDefaultTestCase();
ExecutionResult ret_val = TestCaseExecutor.runTest(tc);
assertNotNull(ret_val);
assertFalse(ret_val.explicitExceptions.isEmpty());
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestDefaultValue method testInteger.
@Test
public void testInteger() throws SecurityException, NoSuchMethodException {
TestCaseBuilder builder = new TestCaseBuilder();
ArrayReference integerArray0 = builder.appendArrayStmt(Integer[].class, 10);
VariableReference integer0 = builder.appendNull(Integer.class);
builder.appendAssignment(integerArray0, 0, integer0);
builder.appendAssignment(integer0, integerArray0, 0);
builder.appendMethod(integer0, Integer.class.getMethod("toString"));
DefaultTestCase tc = builder.getDefaultTestCase();
ExecutionResult ret_val = TestCaseExecutor.runTest(tc);
assertNotNull(ret_val);
assertFalse(ret_val.explicitExceptions.isEmpty());
}
Aggregations