@Test public void testSetupStackTrace() throws FileNotFoundException { CrashProperties properties = CrashProperties.getInstance(); BufferedReader givenStackTrace = new BufferedReader(new StringReader("java.lang.IllegalArgumentException:\n" + "\tat eu.stamp.ClassA.method2(ClassA.java:10)\n" + "\tat eu.stamp.ClassB.method1(ClassB.java:20)")); StackTrace target = Mockito.spy(new StackTrace()); Mockito.doReturn(givenStackTrace).when(target).readFromFile(anyString()); target.setup("", 2); CrashProperties.getInstance().setupStackTrace(target); properties.resetStackTrace(0); StackTrace crash = properties.getStackTrace(0); assertNull(crash.getExceptionType()); assertNull(crash.getFrames()); assertNull(crash.getTargetClass()); }
public void setupStackTrace(String stacktraceFile, int targetFrame) { crashes.add(new StackTrace()); crashes.get(crashes.size() - 1).setup(stacktraceFile, targetFrame); }
CrashProperties { public void setupStackTrace(String stacktraceFile, int targetFrame) { crashes.add(new StackTrace()); crashes.get(crashes.size() - 1).setup(stacktraceFile, targetFrame); } }
CrashProperties { public void setupStackTrace(String stacktraceFile, int targetFrame) { crashes.add(new StackTrace()); crashes.get(crashes.size() - 1).setup(stacktraceFile, targetFrame); } private  CrashProperties(); }
CrashProperties { public void setupStackTrace(String stacktraceFile, int targetFrame) { crashes.add(new StackTrace()); crashes.get(crashes.size() - 1).setup(stacktraceFile, targetFrame); } private  CrashProperties(); static CrashProperties getInstance(); String getStringValue(String property); int getIntValue(String property); long getLongValue(String property); Boolean getBooleanValue(String property); void setupStackTrace(String stacktraceFile, int targetFrame); void setupStackTrace(StackTrace crash); void setClasspath(String projectClassPath); void setClasspath(String[] projectClassPath); String[] getProjectClassPaths(); StackTrace getStackTrace(int index); Properties.StoppingCondition getStoppingCondition(); Throwable getTargetException(int crashIndex); void resetStackTrace(int index); void clearStackTraceList(); List<String> getTargetClasses(int index); int getCrashesSize(); }
CrashProperties { public void setupStackTrace(String stacktraceFile, int targetFrame) { crashes.add(new StackTrace()); crashes.get(crashes.size() - 1).setup(stacktraceFile, targetFrame); } private  CrashProperties(); static CrashProperties getInstance(); String getStringValue(String property); int getIntValue(String property); long getLongValue(String property); Boolean getBooleanValue(String property); void setupStackTrace(String stacktraceFile, int targetFrame); void setupStackTrace(StackTrace crash); void setClasspath(String projectClassPath); void setClasspath(String[] projectClassPath); String[] getProjectClassPaths(); StackTrace getStackTrace(int index); Properties.StoppingCondition getStoppingCondition(); Throwable getTargetException(int crashIndex); void resetStackTrace(int index); void clearStackTraceList(); List<String> getTargetClasses(int index); int getCrashesSize(); static final String CONFIG_PROPERTIES_FILE_NAME; @Properties.Parameter(key = "SearchAlgorithm", group = "Crash reproduction", description = "Which search algorithm to use for crash reproduction")
    static CrashProperties.SearchAlgorithm searchAlgorithm; @Properties.Parameter(key = "FitnessFunctions", group = "Crash reproduction", description = "Which fitness function should be used for the GGA")
    static CrashProperties.FitnessFunction[] fitnessFunctions; @Parameter(key = "max_target_injection_tries", group = "Runtime", description = "The maximum number of times the search tries to generate an individuals with the target method.")
    static int max_target_injection_tries; @Parameter(key = "integration_testing", group = "Crash reproduction", description = "Use integration testing for reproduce the crash.")
    static boolean integrationTesting; @Parameter(key = "line_estimation", group = "Crash reproduction", description = "Detect Missing lines in the stack trace")
    static boolean lineEstimation; @Parameter(key = "io_diversity", group = "Crash reproduction", description = "Enables I/O diversity as extra goals to MOSA")
    static boolean IODiversity; }