use of com.examples.with.different.packagename.concolic.TestCaseWithURL in project evosuite by EvoSuite.
the class ConcolicExecutionEnvironmentTest method buildTestCaseWithURL.
private static DefaultTestCase buildTestCaseWithURL() throws SecurityException, NoSuchMethodException {
TestCaseBuilder tc = new TestCaseBuilder();
// int int0 = 10;
VariableReference int0 = tc.appendIntPrimitive(10);
// String urlString = "http://evosuite.org/hello.txt";
VariableReference urlStringVarRef = tc.appendStringPrimitive("http://evosuite.org/hello.txt");
// MockURL mockURL0 = MockURL.URL(urlString);
Method urlMethod = MockURL.class.getMethod("URL", String.class);
VariableReference mockURLVarRef = tc.appendMethod(null, urlMethod, urlStringVarRef);
// EvoSuiteURL evosuiteURL = new EvoSuiteURL();
Constructor<EvoSuiteURL> evoSuiteURLCtor = EvoSuiteURL.class.getConstructor(String.class);
VariableReference evosuiteURL = tc.appendConstructor(evoSuiteURLCtor, urlStringVarRef);
// String string0 = "<<FILE CONTENT>>"
VariableReference string0VarRef = tc.appendStringPrimitive("<<FILE CONTENT>>");
// NetworkHandling.createRemoteTextFile(url, string0)
Method appendStringToFileMethod = NetworkHandling.class.getMethod("createRemoteTextFile", EvoSuiteURL.class, String.class);
tc.appendMethod(null, appendStringToFileMethod, evosuiteURL, string0VarRef);
// TestCaseWithURL testCaseWithURL0 = new TestCaseWithURL();
Constructor<TestCaseWithURL> ctor = TestCaseWithURL.class.getConstructor();
VariableReference testCaseWithURLVarRef = tc.appendConstructor(ctor);
// String ret_val = dseWithFile0.test((URL) mockURL0);
Method testMethod = TestCaseWithURL.class.getMethod("test", URL.class);
tc.appendMethod(testCaseWithURLVarRef, testMethod, mockURLVarRef);
// DseWithFile.isiZero(int0)
Method isZeroMethod = TestCaseWithFile.class.getMethod("isZero", int.class);
tc.appendMethod(null, isZeroMethod, int0);
return tc.getDefaultTestCase();
}
Aggregations