use of org.evosuite.testcase.statements.ImmutableStringPrimitiveStatement in project evosuite by EvoSuite.
the class EvoTestCaseCodeGenerator method createUnobservedInitStmt.
@SuppressWarnings({ "rawtypes" })
@Override
public void createUnobservedInitStmt(CaptureLog log, int logRecNo) {
// NOTE: PLAIN INIT: has always one non-null param
// TODO: use primitives
final int oid = log.objectIds.get(logRecNo);
try {
final Object value = log.params.get(logRecNo)[0];
final PrimitiveStatement stringRep = new ImmutableStringPrimitiveStatement(testCase, (String) value);
final VariableReference stringRepRef = testCase.addStatement(stringRep);
final MethodStatement m = new MethodStatement(testCase, new GenericMethod(EvoSuiteXStream.class.getMethod("fromString", new Class<?>[] { String.class }), EvoSuiteXStream.class), null, Arrays.asList(stringRepRef));
this.oidToVarRefMap.put(oid, testCase.addStatement(m));
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
Aggregations