Search in sources :

Example 21 with TestCaseBuilder

use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.

the class TestSolverBitwise method buildTestCaseBitNot.

private static DefaultTestCase buildTestCaseBitNot() throws SecurityException, NoSuchMethodException {
    TestCaseBuilder tc = new TestCaseBuilder();
    VariableReference int0 = tc.appendIntPrimitive(~10);
    VariableReference int1 = tc.appendIntPrimitive(10);
    Method method = TestCaseBitNot.class.getMethod("test", int.class, int.class);
    tc.appendMethod(null, method, int0, int1);
    return tc.getDefaultTestCase();
}
Also used : TestCaseBuilder(org.evosuite.symbolic.TestCaseBuilder) VariableReference(org.evosuite.testcase.variable.VariableReference) Method(java.lang.reflect.Method)

Example 22 with TestCaseBuilder

use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.

the class TestSolverSimpleMath method buildTestCaseDiv.

private static DefaultTestCase buildTestCaseDiv() throws SecurityException, NoSuchMethodException {
    TestCaseBuilder tc = new TestCaseBuilder();
    VariableReference int0 = tc.appendIntPrimitive(4);
    VariableReference int1 = tc.appendIntPrimitive(20);
    Method method = TestCaseBinaryOp.class.getMethod("testDiv", int.class, int.class);
    tc.appendMethod(null, method, int0, int1);
    return tc.getDefaultTestCase();
}
Also used : TestCaseBuilder(org.evosuite.symbolic.TestCaseBuilder) VariableReference(org.evosuite.testcase.variable.VariableReference) Method(java.lang.reflect.Method)

Example 23 with TestCaseBuilder

use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.

the class TestSolverSimpleMath method buildTestCaseNeq.

private static DefaultTestCase buildTestCaseNeq() throws SecurityException, NoSuchMethodException {
    TestCaseBuilder tc = new TestCaseBuilder();
    VariableReference int0 = tc.appendIntPrimitive(1000);
    VariableReference int1 = tc.appendIntPrimitive(11);
    Method method = TestCaseNeq.class.getMethod("test", int.class, int.class);
    tc.appendMethod(null, method, int0, int1);
    return tc.getDefaultTestCase();
}
Also used : TestCaseBuilder(org.evosuite.symbolic.TestCaseBuilder) VariableReference(org.evosuite.testcase.variable.VariableReference) Method(java.lang.reflect.Method)

Example 24 with TestCaseBuilder

use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.

the class TestSolverSimpleMath method buildTestCaseLt.

private static DefaultTestCase buildTestCaseLt() throws SecurityException, NoSuchMethodException {
    TestCaseBuilder tc = new TestCaseBuilder();
    VariableReference int0 = tc.appendIntPrimitive(2);
    VariableReference int1 = tc.appendIntPrimitive(22);
    Method method = TestCaseLt.class.getMethod("test", int.class, int.class);
    tc.appendMethod(null, method, int0, int1);
    return tc.getDefaultTestCase();
}
Also used : TestCaseBuilder(org.evosuite.symbolic.TestCaseBuilder) VariableReference(org.evosuite.testcase.variable.VariableReference) Method(java.lang.reflect.Method)

Example 25 with TestCaseBuilder

use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.

the class TestSolverSimpleMath method buildTestCaseGte.

private static DefaultTestCase buildTestCaseGte() throws SecurityException, NoSuchMethodException {
    TestCaseBuilder tc = new TestCaseBuilder();
    VariableReference int0 = tc.appendIntPrimitive(20);
    VariableReference int1 = tc.appendIntPrimitive(2);
    Method method = TestCaseGte.class.getMethod("test", int.class, int.class);
    tc.appendMethod(null, method, int0, int1);
    return tc.getDefaultTestCase();
}
Also used : TestCaseBuilder(org.evosuite.symbolic.TestCaseBuilder) VariableReference(org.evosuite.testcase.variable.VariableReference) Method(java.lang.reflect.Method)

Aggregations

TestCaseBuilder (org.evosuite.symbolic.TestCaseBuilder)146 VariableReference (org.evosuite.testcase.variable.VariableReference)143 Method (java.lang.reflect.Method)129 Test (org.junit.Test)16 DowncastExample (com.examples.with.different.packagename.test.DowncastExample)8 DefaultTestCase (org.evosuite.testcase.DefaultTestCase)8 ExecutionResult (org.evosuite.testcase.execution.ExecutionResult)7 ArrayReference (org.evosuite.testcase.variable.ArrayReference)7 MIMEType (com.examples.with.different.packagename.concolic.MIMEType)6 ShowMessageDialogExample (com.examples.with.different.packagename.mock.javax.swing.ShowMessageDialogExample)6 Field (java.lang.reflect.Field)6 ConcreteSubclass (com.examples.with.different.packagename.test.ConcreteSubclass)4 ShowInternalMessageDialogExample (com.examples.with.different.packagename.mock.javax.swing.ShowInternalMessageDialogExample)2 AbstractSuperclass (com.examples.with.different.packagename.test.AbstractSuperclass)2 AssignmentStatement (org.evosuite.testcase.statements.AssignmentStatement)2 FieldReference (org.evosuite.testcase.variable.FieldReference)2 GenericField (org.evosuite.utils.generic.GenericField)2 CBranchExample (com.examples.with.different.packagename.cbranch.CBranchExample)1 ShowConfirmDialogExample (com.examples.with.different.packagename.mock.javax.swing.ShowConfirmDialogExample)1 ShowInputDialogExample (com.examples.with.different.packagename.mock.javax.swing.ShowInputDialogExample)1