Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-01-19 15:45:49 -0500
committerSergey Prigogin2012-01-19 15:45:49 -0500
commit6408fe544c740054c72fd04811a3807c70a9d704 (patch)
treee4ca61ab3157a353623c487a48010f6abad24329
parentecb3820c77d8a444a59eb5ea5df2b9a67070d9d2 (diff)
downloadorg.eclipse.cdt-6408fe544c740054c72fd04811a3807c70a9d704.tar.gz
org.eclipse.cdt-6408fe544c740054c72fd04811a3807c70a9d704.tar.xz
org.eclipse.cdt-6408fe544c740054c72fd04811a3807c70a9d704.zip
Don't create empty test files.
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
index 0b6f28743a..5f7f26e850 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
@@ -66,12 +66,12 @@ public abstract class RefactoringTestBase extends BaseTestCase {
protected RefactoringTestBase(String name) {
super(name);
}
-
+
@Override
public void setUp() throws Exception {
super.setUp();
cproject = cpp ?
- CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER) :
+ CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER) :
CProjectHelper.createCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
Bundle bundle = CTestPlugin.getDefault().getBundle();
CharSequence[] testData = TestSourceReader.getContentsForTest(bundle, "ui", getClass(), getName(), 0);
@@ -94,9 +94,11 @@ public abstract class RefactoringTestBase extends BaseTestCase {
}
}
reader.close();
-
- TestSourceReader.createFile(cproject.getProject(), new Path(testFile.getName()),
- testFile.getSource());
+
+ if (!testFile.getSource().isEmpty()) {
+ TestSourceReader.createFile(cproject.getProject(), new Path(testFile.getName()),
+ testFile.getSource());
+ }
testFiles.add(testFile);
if (testFile.getName().endsWith(".xml")) {
historyScript = testFile;
@@ -292,7 +294,7 @@ public abstract class RefactoringTestBase extends BaseTestCase {
String actualSource = getFileContents(file);
assertEquals(testFile.getExpectedSource(), actualSource);
}
-
+
protected void compareFiles() throws Exception {
for (TestSourceFile testFile : testFiles) {
String expectedSource = testFile.getExpectedSource();

Back to the top