/** * <p> * Getter for the field <code>instance</code>. * </p> * * @return a {@link org.evosuite.assertion.InspectorManager} object. */ public static InspectorManager getInstance() { if (instance == null) { instance = new InspectorManager(); } return instance; }
/** * <p> * Getter for the field <code>inspectors</code>. * </p> * * @param clazz * a {@link java.lang.Class} object. * @return a {@link java.util.List} object. */ public List<Inspector> getInspectors(Class<?> clazz) { if (!inspectors.containsKey(clazz)) { determineInspectors(clazz); } return inspectors.get(clazz); }
private InspectorManager() { // TODO: Need to replace this with proper analysis // readInspectors(); initializeBlackList(); }
break; for(Inspector inspector : InspectorManager.getInstance().getInspectors(returnValue.getClass())) { String insp = inspector.getMethodCall() + Type.getMethodDescriptor(inspector.getMethod()); try {
return false; if (isBlackListed(method)) return false; if (isImpureJDKMethod(method)) return false; if(isAWTToString(method)) return false;
List<Inspector> inspectors = InspectorManager.getInstance().getInspectors(var.getVariableClass()); logger.debug("Timeout during inspector call - deactivating inspector " + i.getMethodCall()); InspectorManager.getInstance().removeInspector(var.getVariableClass(), i);
private void determineInspectors(Class<?> clazz) { if (!TestUsageChecker.canUse(clazz)) { inspectors.put(clazz, Collections.emptyList()); } if (!TestUsageChecker.canUse(clazz)) return; List<Inspector> inspectorList = new ArrayList<Inspector>(); for (Method method : clazz.getMethods()) { if (isInspectorMethod(method)) { // FIXXME logger.debug("Inspector for class " + clazz.getSimpleName() + ": " + method.getName() + " defined in " + method.getDeclaringClass().getCanonicalName()); inspectorList.add(new Inspector(clazz, method)); } else { logger.debug("Not an inspector: "+method.getName()); } } inspectors.put(clazz, inspectorList); }
Collection<Inspector> inspectors = InspectorManager.getInstance().getInspectors(argValue.getClass()); for (Inspector inspector : inspectors) { String insp = inspector.getMethodCall() + Type.getMethodDescriptor(inspector.getMethod());
for(Inspector inspector : InspectorManager.getInstance().getInspectors(returnClazz)) { String insp = inspector.getMethodCall() + Type.getMethodDescriptor(inspector.getMethod()); Type t = Type.getReturnType(inspector.getMethod());
boolean observerGoalsAdded = false; Class<?> paramClazz = argumentClasses[i]; for(Inspector inspector : InspectorManager.getInstance().getInspectors(paramClazz)) { String insp = inspector.getMethodCall() + Type.getMethodDescriptor(inspector.getMethod()); Type t = Type.getReturnType(inspector.getMethod());