Search in sources :

Example 6 with TestSuiteWriter

use of org.evosuite.junit.writer.TestSuiteWriter in project evosuite by EvoSuite.

the class RegressionSuiteSerializer method storeRegressionArchive.

/**
 * Keep the coverage-based archive of the generated tests for disposable testing
 */
public static void storeRegressionArchive() {
    TestSuiteChromosome testArchive = getAppendedRegressionSuiteArchive();
    // Save the actual unit test suite archive
    TestSuiteWriter suiteWriter = new TestSuiteWriter();
    suiteWriter.insertTests(testArchive.getTests());
    String name = TARGET_CLASS.substring(TARGET_CLASS.lastIndexOf(".") + 1);
    String testDir = Properties.TEST_DIR;
    LoggingUtils.getEvoLogger().info("* Writing Archive JUnit test case '" + (name + JUNIT_ARCHIVE_SUFFIX) + "' to " + testDir);
    suiteWriter.writeTestSuite(name + JUNIT_ARCHIVE_SUFFIX, testDir, testArchive.getLastExecutionResults());
    // Serialise the test suite archive
    TestSuiteSerialization.saveTests(testArchive, new File(REGRESSION_ARCHIVE_FILE));
}
Also used : TestSuiteWriter(org.evosuite.junit.writer.TestSuiteWriter) File(java.io.File)

Aggregations

TestSuiteWriter (org.evosuite.junit.writer.TestSuiteWriter)6 File (java.io.File)2 DefaultTestCase (org.evosuite.testcase.DefaultTestCase)2 TestCase (org.evosuite.testcase.TestCase)2 IOException (java.io.IOException)1 Charset (java.nio.charset.Charset)1 DiagnosticCollector (javax.tools.DiagnosticCollector)1 JavaCompiler (javax.tools.JavaCompiler)1 CompilationTask (javax.tools.JavaCompiler.CompilationTask)1 JavaFileObject (javax.tools.JavaFileObject)1 StandardJavaFileManager (javax.tools.StandardJavaFileManager)1 ClientState (org.evosuite.rmi.service.ClientState)1 ClientStateInformation (org.evosuite.rmi.service.ClientStateInformation)1 org.evosuite.testcase (org.evosuite.testcase)1