use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestLocalSearchMIMEType method createTestCase5.
private DefaultTestCase createTestCase5() throws NoSuchFieldException, SecurityException, NoSuchMethodException, ClassNotFoundException {
final Class<?> mimeTypeClass = TestGenerationContext.getInstance().getClassLoaderForSUT().loadClass(MIMEType.class.getName());
final Field memField = mimeTypeClass.getDeclaredField("MEM");
final Method toString = mimeTypeClass.getMethod("toString");
final TestCaseBuilder builder = new TestCaseBuilder();
VariableReference mIMEType0 = builder.appendStaticFieldStmt(memField);
VariableReference string0 = builder.appendMethod(mIMEType0, toString);
System.out.println("Test Case #5=" + builder.toCode());
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneShowInternalOptionDialogTest 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 showOptionDialogMethod = clazz.getMethod("showInternalOptionDialog");
builder.appendMethod(showMessageDialogExample0, showOptionDialogMethod);
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneShowInternalMessageDialogTest method buildTestCase1.
private static TestCase buildTestCase1(InstrumentingClassLoader cl) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
TestCaseBuilder builder = new TestCaseBuilder();
Class<?> clazz = cl.loadClass(ShowInternalMessageDialogExample.class.getCanonicalName());
Constructor<?> constructor = clazz.getConstructor();
VariableReference showMessageDialogExample0 = builder.appendConstructor(constructor);
VariableReference int0 = builder.appendIntPrimitive(0);
Method showMessageDialogMethod = clazz.getMethod("showInternalMessageDialog", int.class);
builder.appendMethod(showMessageDialogExample0, showMessageDialogMethod, int0);
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneShowInternalMessageDialogTest method buildTestCase0.
private static TestCase buildTestCase0(InstrumentingClassLoader cl) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
TestCaseBuilder builder = new TestCaseBuilder();
Class<?> clazz = cl.loadClass(ShowInternalMessageDialogExample.class.getCanonicalName());
Constructor<?> constructor = clazz.getConstructor();
VariableReference showMessageDialogExample0 = builder.appendConstructor(constructor);
VariableReference int0 = builder.appendIntPrimitive(1);
Method showMessageDialogMethod = clazz.getMethod("showInternalMessageDialog", int.class);
builder.appendMethod(showMessageDialogExample0, showMessageDialogMethod, int0);
return builder.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class MockJOptionPaneShowMessageDialogTest method buildTestCase0TrueBranch.
private static TestCase buildTestCase0TrueBranch(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("showMessageDialog0", int.class);
builder.appendMethod(showMessageDialogExample0, showMessageDialogMethod, int0);
return builder.getDefaultTestCase();
}
Aggregations