@Override public void changeClassLoader(ClassLoader loader) { super.changeClassLoader(loader); inspector.changeClassLoader(loader); } }
/** * Returns if the method is cheap-pure. * * @param className The declaring class name * @param methodName The method name * @param descriptor The method descriptor * @return true if the method is cheap-pure, false otherwise */ public boolean isPure(String className, String methodName, String descriptor) { MethodEntry entry = new MethodEntry(className, methodName, descriptor); return isPure(entry); }
private boolean isPure(MethodEntry entry, Stack<MethodEntry> callStack) { if (isCached(entry)) { return getCacheValue(entry); } else { boolean isPure = isPure0(entry, callStack); addCacheValue(entry, isPure); return isPure; } }
/** * Generate assertions to kill all the mutants defined in the pool * * @param test * a {@link org.evosuite.testcase.TestCase} object. * @param killed * a {@link java.util.Set} object. */ private void addAssertions(TestCase test, Set<Integer> killed) { addAssertions(test, killed, mutants); filterRedundantNonnullAssertions(test); }
public void addStaticCall(String sourceClassName, String sourceMethodName, String sourceDescriptor, String targetClassName, String targetMethodName, String targetDescriptor) { addCall(staticCalls, sourceClassName, sourceMethodName, sourceDescriptor, targetClassName, targetMethodName, targetDescriptor); }
/** {@inheritDoc} */ @Override public synchronized void afterStatement(Statement statement, Scope scope, Throwable exception) { // By default, no assertions are created for statements that threw exceptions if(exception != null) return; // No assertions are created for mock statements if(statement instanceof FunctionalMockStatement) return; visitReturnValue(statement, scope); }
/** {@inheritDoc} */ @Override public OutputTraceEntry cloneEntry() { return new NullTraceEntry(var, isNull); }
private InspectorManager() { // TODO: Need to replace this with proper analysis // readInspectors(); initializeBlackList(); }
/** * <p> * Getter for the field <code>trace</code>. * </p> * * @return a {@link org.evosuite.assertion.OutputTrace} object. */ public synchronized OutputTrace<T> getTrace() { return trace.clone(); }
/** {@inheritDoc} */ @Override public boolean isValid() { return super.isValid() && dest != null; }
/** {@inheritDoc} */ @Override public void setAssertions(Set<Assertion> assertions) { for (Assertion assertion : assertions) assertion.setStatement(this); this.assertions = assertions; }
/** {@inheritDoc} */ @Override public synchronized void clear() { //if(!checkThread()) // return; trace.clear(); }
/** {@inheritDoc} */ @Override public String getAssertionCode() { String ret_val = ""; for (Assertion a : assertions) { if (a != null) ret_val += a.getCode() + "\n"; } return ret_val; }
/** * Return a copy of the assertion, which is valid in newTestCase * * @param newTestCase * a {@link org.evosuite.testcase.TestCase} object. * @return a {@link org.evosuite.assertion.Assertion} object. */ public Assertion clone(TestCase newTestCase) { return copy(newTestCase, 0); }
/** * {@inheritDoc} */ @Override public OutputTraceEntry cloneEntry() { return new PrimitiveTraceEntry(var, value); }
/** * {@inheritDoc} * * Execute a test case on the original unit */ @Override protected ExecutionResult runTest(TestCase test) { return runTest(test, null); }
/** {@inheritDoc} */ @Override public synchronized void afterStatement(Statement statement, Scope scope, Throwable exception) { // By default, no assertions are created for statements that threw exceptions if(exception != null) return; // No assertions are created for mock statements if(statement instanceof FunctionalMockStatement) return; visitReturnValue(statement, scope); }
public void addSpecialCall(String sourceClassName, String sourceMethodName, String sourceDescriptor, String targetClassName, String targetMethodName, String targetDescriptor) { addCall(specialCalls, sourceClassName, sourceMethodName, sourceDescriptor, targetClassName, targetMethodName, targetDescriptor); }
public void addInterfaceCall(String sourceClassName, String sourceMethodName, String sourceDescriptor, String targetClassName, String targetMethodName, String targetDescriptor) { addCall(interfaceCalls, sourceClassName, sourceMethodName, sourceDescriptor, targetClassName, targetMethodName, targetDescriptor); }