currentTestCaseSourceCode = fileReader.readAsString(testFile);
} catch (Exception e) {
}
CurrentLineBreak currentLineBreak = CurrentLineBreakDetector.detect(currentTestCaseSourceCode);
LineBreakProvider lineBreakProvider = new LineBreakProvider(config, currentLineBreak);
TestCaseGenerator testCaseGenerator = TestCaseGeneratorFactory.create(config, lineBreakProvider);
String targetSourceCodeString = fileReader.readAsString(javaFile);
testCaseGenerator.initialize(targetSourceCodeString);
String testCodeString = null;
if (currentTestCaseSourceCode != null) {
testCodeString = testCaseGenerator
.getTestCaseSourceCodeWithLackingTestMethod(currentTestCaseSourceCode);
if (!testCodeString.equals(currentTestCaseSourceCode)) {
testCodeString = standardizeLineBreak(config, testCodeString);
FileWriterFactory.create(testFile).writeText(testCodeString);
Stdout.p(" Modified: " + testFile.getAbsolutePath());
}
} else {
testCodeString = testCaseGenerator.getNewTestCaseSourceCode();
FileWriterFactory.create(testFile).writeText(testCodeString);
Stdout.p(" Created: " + testFile.getAbsolutePath());
}
}