aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Guzman2013-12-17 14:48:39 (EST)
committerAlexander Kurtakov2013-12-18 04:25:51 (EST)
commitf37efc3778e600ea29d4fe95bff1c0698c721037 (patch)
treeb24b4c6b556e8c548d726082502c91ff0eba2ec9
parentaba9bdfb8819e1ecc253a044e213454d3d07d804 (diff)
downloadorg.eclipse.linuxtools-f37efc3778e600ea29d4fe95bff1c0698c721037.zip
org.eclipse.linuxtools-f37efc3778e600ea29d4fe95bff1c0698c721037.tar.gz
org.eclipse.linuxtools-f37efc3778e600ea29d4fe95bff1c0698c721037.tar.bz2
RPM: createrepo various test fixesrefs/changes/59/19659/8
Also changed using "Package Explorer" to "Navigator". A test using maven did not have "Package Explorer", which caused the proceeding tests to fail. Change-Id: I7ee702d550c48a3009013464a4373c040a9ff3e7 Signed-off-by: Neil Guzman <nguzman@redhat.com> Reviewed-on: https://git.eclipse.org/r/19659 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> IP-Clean: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoImportRPMsPageTest.java32
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoMetadataPageTest.java29
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoRepoFormEditorTest.java21
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tests/CreaterepoTest.java7
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java8
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/wizard/tests/CreaterepoWizardTest.java11
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectCreatorTest.java20
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectTest.java51
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoUtilsTest.java6
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/ICreaterepoTestConstants.java14
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/TestCreaterepoProject.java16
11 files changed, 131 insertions, 84 deletions
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoImportRPMsPageTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoImportRPMsPageTest.java
index 8018c8b..beba6b5 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoImportRPMsPageTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoImportRPMsPageTest.java
@@ -11,6 +11,8 @@
package org.eclipse.linuxtools.internal.rpm.createrepo.form.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -58,9 +60,8 @@ import org.osgi.framework.FrameworkUtil;
@RunWith(SWTBotJunit4ClassRunner.class)
public class CreaterepoImportRPMsPageTest {
- private static final String TEST_RPM1 = "eclipse-egit-github-3.0.0-2.fc19.noarch.rpm"; //$NON-NLS-1$
private static final String TEST_RPM_LOC1 = ICreaterepoTestConstants.RPM_RESOURCE_LOC
- .concat(TEST_RPM1);
+ .concat(ICreaterepoTestConstants.RPM1);
private static TestCreaterepoProject testProject;
private CreaterepoProject project;
@@ -75,6 +76,7 @@ public class CreaterepoImportRPMsPageTest {
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
testProject = new TestCreaterepoProject();
+ assertTrue(testProject.getProject().exists());
bot = new SWTWorkbenchBot();
try {
bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
@@ -91,6 +93,7 @@ public class CreaterepoImportRPMsPageTest {
@AfterClass
public static void tearDownAfterClass() throws CoreException {
testProject.dispose();
+ assertFalse(testProject.getProject().exists());
}
/**
@@ -103,9 +106,11 @@ public class CreaterepoImportRPMsPageTest {
@Before
public void setUp() throws CoreException, IOException {
project = testProject.getCreaterepoProject();
+ assertNotNull(project);
URL rpmURL = FileLocator.find(FrameworkUtil
.getBundle(CreaterepoProjectTest.class), new Path(TEST_RPM_LOC1), null);
File rpmFile = new File(FileLocator.toFileURL(rpmURL).getPath());
+ assertTrue(rpmFile.exists());
project.importRPM(rpmFile);
// there should be 1 rpm every setup
assertEquals(1, project.getRPMs().size());
@@ -124,11 +129,13 @@ public class CreaterepoImportRPMsPageTest {
@Override
public void run() {
Tree tree = importPageBot.widget(WidgetMatcherFactory.widgetOfType(Tree.class));
+ assertNotNull(tree);
// current item count should be 1 (from the imported RPM)
assertEquals(1, tree.getItemCount());
importPageBot.button(Messages.ImportRPMsPage_buttonRemoveRPMs).click();
// not selecting a treeitem should do nothing to the tree contents
assertEquals(1, tree.getItemCount());
+ // select the first item
tree.select(tree.getItem(0));
importPageBot.button(Messages.ImportRPMsPage_buttonRemoveRPMs).click();
// item count should be 0 after selecting a tree item and pressing remove
@@ -155,7 +162,7 @@ public class CreaterepoImportRPMsPageTest {
Assume.assumeTrue(validVersion.isOK());
importPageBot.button(Messages.ImportRPMsPage_buttonCreateRepo).click();
// make the bot wait until the download job shell closes before proceeding the tests
- bot.waitUntil(Conditions.shellCloses(bot.shell(Messages.Createrepo_jobName)));
+ importPageBot.waitUntil(Conditions.shellCloses(bot.shell(Messages.Createrepo_jobName)));
// assert that the content folder has more than just the RPM inside it
assertTrue(project.getContentFolder().members().length > 1);
// assert that the repodata folder exists within the content folder
@@ -170,25 +177,28 @@ public class CreaterepoImportRPMsPageTest {
*/
private void initializeImportPage() {
// open the package explorer view
- bot.menu(ICreaterepoTestConstants.WINDOW).menu(ICreaterepoTestConstants.SHOW_VIEW).menu(ICreaterepoTestConstants.OTHER).click();
+ bot.menu(ICreaterepoTestConstants.WINDOW).menu(ICreaterepoTestConstants.SHOW_VIEW)
+ .menu(ICreaterepoTestConstants.OTHER).click();
SWTBotShell shell = bot.shell(ICreaterepoTestConstants.SHOW_VIEW);
shell.activate();
- bot.tree().expandNode(ICreaterepoTestConstants.JAVA_NODE).select(ICreaterepoTestConstants.PACKAGE_EXPLORER);
+ bot.tree().expandNode(ICreaterepoTestConstants.GENERAL_NODE).select(ICreaterepoTestConstants.NAVIGATOR);
bot.button(ICreaterepoTestConstants.OK_BUTTON).click();
- SWTBotView view = bot.viewByTitle(ICreaterepoTestConstants.PACKAGE_EXPLORER);
+ SWTBotView view = bot.viewByTitle(ICreaterepoTestConstants.NAVIGATOR);
view.show();
- // select the repo file from the package explorer and open it
+ // select the .repo file from the package explorer and open it
Composite packageExplorer = (Composite)view.getWidget();
+ assertNotNull(packageExplorer);
Tree swtTree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), packageExplorer);
+ assertNotNull(swtTree);
SWTBotTree botTree = new SWTBotTree(swtTree);
- botTree.expandNode(TestCreaterepoProject.PROJECT_NAME).select(TestCreaterepoProject.REPO_NAME);
- bot.menu(ICreaterepoTestConstants.OPEN).click();
+ botTree.expandNode(ICreaterepoTestConstants.PROJECT_NAME).getNode(ICreaterepoTestConstants.REPO_NAME)
+ .contextMenu(ICreaterepoTestConstants.OPEN).click();
// get a handle on the multipage editor that was opened
- SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(TestCreaterepoProject.REPO_NAME);
+ SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(ICreaterepoTestConstants.REPO_NAME);
editor.show();
// 3 = repository form page, metadata form page, repo file
assertEquals(3, editor.getPageCount());
- // activate the pages to make sure they exist and work
+ // activate repository page
editor.activatePage(Messages.ImportRPMsPage_title);
// make sure correct page is active
assertEquals(Messages.ImportRPMsPage_title, editor.getActivePageTitle());
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoMetadataPageTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoMetadataPageTest.java
index 070e4a2..673b892 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoMetadataPageTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoMetadataPageTest.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.internal.rpm.createrepo.form.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -67,6 +68,7 @@ public class CreaterepoMetadataPageTest {
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
testProject = new TestCreaterepoProject();
+ assertTrue(testProject.getProject().exists());
bot = new SWTWorkbenchBot();
try {
bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
@@ -83,6 +85,7 @@ public class CreaterepoMetadataPageTest {
@AfterClass
public static void tearDownAfterClass() throws CoreException {
testProject.dispose();
+ assertFalse(testProject.getProject().exists());
}
/**
@@ -95,6 +98,7 @@ public class CreaterepoMetadataPageTest {
@Before
public void setUp() throws CoreException, IOException {
project = testProject.getCreaterepoProject();
+ assertNotNull(project);
initializeMetadataPage();
}
@@ -108,6 +112,7 @@ public class CreaterepoMetadataPageTest {
IEclipsePreferences pref = project.getEclipsePreferences();
pref.clear();
pref.flush();
+ assertEquals(0, pref.keys().length);
}
/**
@@ -124,8 +129,10 @@ public class CreaterepoMetadataPageTest {
String prefValueToBe = ""; //$NON-NLS-1$
metadataPageBot.textWithLabel(Messages.MetadataPage_labelTags).setText(tagName);
Tree tree = metadataPageBot.widget(WidgetMatcherFactory.widgetOfType(Tree.class));
+ assertNotNull(tree);
// 0 = distro, 1 = content, 2 = repo
int category = 0;
+ // select the category and the test adding tags
tree.select(tree.getItem(category));
metadataPageBot.button(Messages.MetadataPage_buttonAddTag).click();
CreaterepoTreeCategory test = (CreaterepoTreeCategory) tree.getItem(category).getData();
@@ -167,9 +174,10 @@ public class CreaterepoMetadataPageTest {
String newTagName = "renameTag"; //$NON-NLS-1$
String prefValueToBe = ""; //$NON-NLS-1$
Tree tree = metadataPageBot.widget(WidgetMatcherFactory.widgetOfType(Tree.class));
+ assertNotNull(tree);
// 0 = distro, 1 = content, 2 = repo
int category = 1;
- // select the category and the test tags to it
+ // select the category and test editing tags
tree.select(tree.getItem(category));
metadataPageBot.textWithLabel(Messages.MetadataPage_labelTags).setText(tagName);
metadataPageBot.button(Messages.MetadataPage_buttonAddTag).click();
@@ -189,7 +197,7 @@ public class CreaterepoMetadataPageTest {
// it should be content = {renameTag, testTag2} now
prefValueToBe = newTagName + ICreaterepoConstants.DELIMITER + tagName2;
assertTrue(isPreferencesCorrect(CreaterepoPreferenceConstants.PREF_CONTENT_TAG, prefValueToBe));
- // select the second test tag and try to rename it as the same name as the first tag, this should not happen
+ // select the second test tag and try to rename it as the same name as the first tag, this should not work
tree.select(tree.getItem(category).getItem(1));
metadataPageBot.textWithLabel(Messages.MetadataPage_labelTags).setText(newTagName);
metadataPageBot.button(Messages.MetadataPage_buttonEditTag).click();
@@ -214,9 +222,10 @@ public class CreaterepoMetadataPageTest {
String tagName = "testTag"; //$NON-NLS-1$
String prefValueToBe = ""; //$NON-NLS-1$
Tree tree = metadataPageBot.widget(WidgetMatcherFactory.widgetOfType(Tree.class));
+ assertNotNull(tree);
// 0 = distro, 1 = content, 2 = repo
int category = 2;
- // select the category and the test tags to it
+ // select the category and test removing tags
tree.select(tree.getItem(category));
metadataPageBot.textWithLabel(Messages.MetadataPage_labelTags).setText(tagName);
metadataPageBot.button(Messages.MetadataPage_buttonAddTag).click();
@@ -264,22 +273,24 @@ public class CreaterepoMetadataPageTest {
bot.menu(ICreaterepoTestConstants.WINDOW).menu(ICreaterepoTestConstants.SHOW_VIEW).menu(ICreaterepoTestConstants.OTHER).click();
SWTBotShell shell = bot.shell(ICreaterepoTestConstants.SHOW_VIEW);
shell.activate();
- bot.tree().expandNode(ICreaterepoTestConstants.JAVA_NODE).select(ICreaterepoTestConstants.PACKAGE_EXPLORER);
+ bot.tree().expandNode(ICreaterepoTestConstants.GENERAL_NODE).select(ICreaterepoTestConstants.NAVIGATOR);
bot.button(ICreaterepoTestConstants.OK_BUTTON).click();
- SWTBotView view = bot.viewByTitle(ICreaterepoTestConstants.PACKAGE_EXPLORER);
+ SWTBotView view = bot.viewByTitle(ICreaterepoTestConstants.NAVIGATOR);
view.show();
// select the repo file from the package explorer and open it
Composite packageExplorer = (Composite)view.getWidget();
+ assertNotNull(packageExplorer);
Tree swtTree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), packageExplorer);
+ assertNotNull(swtTree);
SWTBotTree botTree = new SWTBotTree(swtTree);
- botTree.expandNode(TestCreaterepoProject.PROJECT_NAME).select(TestCreaterepoProject.REPO_NAME);
- bot.menu(ICreaterepoTestConstants.OPEN).click();
+ botTree.expandNode(ICreaterepoTestConstants.PROJECT_NAME).getNode(ICreaterepoTestConstants.REPO_NAME)
+ .contextMenu(ICreaterepoTestConstants.OPEN).click();
// get a handle on the multipage editor that was opened
- SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(TestCreaterepoProject.REPO_NAME);
+ SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(ICreaterepoTestConstants.REPO_NAME);
editor.show();
// 3 = repository form page, metadata form page, repo file
assertEquals(3, editor.getPageCount());
- // activate the pages to make sure they exist and work
+ // activate the metadata page
editor.activatePage(Messages.MetadataPage_title);
// make sure correct page is active
assertEquals(Messages.MetadataPage_title, editor.getActivePageTitle());
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoRepoFormEditorTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoRepoFormEditorTest.java
index 2bbbca7..8935cc1 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoRepoFormEditorTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/form/tests/CreaterepoRepoFormEditorTest.java
@@ -11,6 +11,9 @@
package org.eclipse.linuxtools.internal.rpm.createrepo.form.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.linuxtools.internal.rpm.createrepo.Messages;
@@ -41,13 +44,14 @@ public class CreaterepoRepoFormEditorTest {
private static SWTWorkbenchBot bot;
/**
- * Initialize the test project. Will close the welcome view.
+ * Initialize the test project.
*
* @throws CoreException
*/
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
testProject = new TestCreaterepoProject();
+ assertTrue(testProject.getProject().exists());
bot = new SWTWorkbenchBot();
try {
bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
@@ -64,6 +68,7 @@ public class CreaterepoRepoFormEditorTest {
@AfterClass
public static void tearDownAfterClass() throws CoreException {
testProject.dispose();
+ assertFalse(testProject.getProject().exists());
}
/**
@@ -77,24 +82,26 @@ public class CreaterepoRepoFormEditorTest {
bot.menu(ICreaterepoTestConstants.WINDOW).menu(ICreaterepoTestConstants.SHOW_VIEW).menu(ICreaterepoTestConstants.OTHER).click();
SWTBotShell shell = bot.shell(ICreaterepoTestConstants.SHOW_VIEW);
shell.activate();
- bot.tree().expandNode(ICreaterepoTestConstants.JAVA_NODE).select(ICreaterepoTestConstants.PACKAGE_EXPLORER);
+ bot.tree().expandNode(ICreaterepoTestConstants.GENERAL_NODE).select(ICreaterepoTestConstants.NAVIGATOR);
bot.button(ICreaterepoTestConstants.OK_BUTTON).click();
- SWTBotView view = bot.viewByTitle(ICreaterepoTestConstants.PACKAGE_EXPLORER);
+ SWTBotView view = bot.viewByTitle(ICreaterepoTestConstants.NAVIGATOR);
view.show();
// select the repo file from the package explorer and open it
Composite packageExplorer = (Composite)view.getWidget();
+ assertNotNull(packageExplorer);
Tree swtTree = bot.widget(WidgetMatcherFactory.widgetOfType(Tree.class), packageExplorer);
+ assertNotNull(swtTree);
SWTBotTree botTree = new SWTBotTree(swtTree);
- botTree.expandNode(TestCreaterepoProject.PROJECT_NAME).select(TestCreaterepoProject.REPO_NAME);
- bot.menu(ICreaterepoTestConstants.OPEN).click();
+ botTree.expandNode(ICreaterepoTestConstants.PROJECT_NAME).getNode(ICreaterepoTestConstants.REPO_NAME)
+ .contextMenu(ICreaterepoTestConstants.OPEN).click();
// get a handle on the multipage editor that was opened
- SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(TestCreaterepoProject.REPO_NAME);
+ SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(ICreaterepoTestConstants.REPO_NAME);
editor.show();
// 3 = repository form page, metadata form page, repo file
assertEquals(3, editor.getPageCount());
// activate the pages to make sure they exist and work
editor.activatePage(Messages.MetadataPage_title);
- editor.activatePage(TestCreaterepoProject.REPO_NAME);
+ editor.activatePage(ICreaterepoTestConstants.REPO_NAME);
editor.activatePage(Messages.ImportRPMsPage_title);
}
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tests/CreaterepoTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tests/CreaterepoTest.java
index bd9ad23..b011c3d 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tests/CreaterepoTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tests/CreaterepoTest.java
@@ -11,6 +11,9 @@
package org.eclipse.linuxtools.internal.rpm.createrepo.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
@@ -57,6 +60,7 @@ public class CreaterepoTest {
fail("Failed due to system not having the 'createrepo' command, or it cannot be found."); //$NON-NLS-1$
}
testProject = new TestCreaterepoProject();
+ assertTrue(testProject.getProject().exists());
}
/**
@@ -67,6 +71,7 @@ public class CreaterepoTest {
@AfterClass
public static void tearDownAfterClass() throws CoreException {
testProject.dispose();
+ assertFalse(testProject.getProject().exists());
}
/**
@@ -78,6 +83,7 @@ public class CreaterepoTest {
@Before
public void setUp() throws CoreException {
project = testProject.getCreaterepoProject();
+ assertNotNull(project);
console = new MessageConsole("testConsole", null, null, true); //$NON-NLS-1$
}
@@ -91,6 +97,7 @@ public class CreaterepoTest {
IEclipsePreferences pref = project.getEclipsePreferences();
pref.clear();
pref.flush();
+ assertEquals(0, pref.keys().length);
console.destroy();
}
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java
index 585498e..9bfe013 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java
@@ -11,6 +11,8 @@
package org.eclipse.linuxtools.internal.rpm.createrepo.tree.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -56,7 +58,7 @@ public class CreaterepoTreeTest {
private static final String[] REPO_TAGS = {"tag1"}; //$NON-NLS-1$
/*
- * Categories being used to test with.
+ * Categories and how many tags per categories to test with.
*/
private static final Map<String, Integer> CORRECT_CATEGORIES;
static {
@@ -80,6 +82,7 @@ public class CreaterepoTreeTest {
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
testProject = new TestCreaterepoProject();
+ assertTrue(testProject.getProject().exists());
}
/**
@@ -90,6 +93,7 @@ public class CreaterepoTreeTest {
@AfterClass
public static void tearDownAfterClass() throws CoreException {
testProject.dispose();
+ assertFalse(testProject.getProject().exists());
}
/**
@@ -100,6 +104,7 @@ public class CreaterepoTreeTest {
@Before
public void setUp() throws CoreException {
project = testProject.getCreaterepoProject();
+ assertNotNull(project);
}
/**
@@ -112,6 +117,7 @@ public class CreaterepoTreeTest {
IEclipsePreferences pref = project.getEclipsePreferences();
pref.clear();
pref.flush();
+ assertEquals(0, pref.keys().length);
}
/**
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/wizard/tests/CreaterepoWizardTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/wizard/tests/CreaterepoWizardTest.java
index 9e76011..855210c 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/wizard/tests/CreaterepoWizardTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/wizard/tests/CreaterepoWizardTest.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.internal.rpm.createrepo.wizard.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
@@ -45,7 +46,6 @@ import org.junit.runner.RunWith;
@RunWith(SWTBotJunit4ClassRunner.class)
public class CreaterepoWizardTest {
- private static final String PROJECT_NAME = "createrepo-test-project"; //$NON-NLS-1$
private static final String REPO_ID = "createrepo-test-repo"; //$NON-NLS-1$
private static final String REPO_FILE = REPO_ID.concat(".repo"); //$NON-NLS-1$
@@ -83,8 +83,9 @@ public class CreaterepoWizardTest {
@After
public void tearDown() throws CoreException {
if (project != null && project.exists()) {
- project.delete(true, monitor);
+ project.delete(true, true, monitor);
}
+ assertFalse(project.exists());
}
/**
@@ -102,7 +103,7 @@ public class CreaterepoWizardTest {
shell.activate();
bot.tree().expandNode(ICreaterepoTestConstants.CREATEREPO_CATEGORY).select(ICreaterepoTestConstants.CREATEREPO_PROJECT_WIZARD);
bot.button(ICreaterepoTestConstants.NEXT_BUTTON).click();
- bot.textWithLabel(ICreaterepoTestConstants.PROJECT_NAME_LABEL).setText(PROJECT_NAME);
+ bot.textWithLabel(ICreaterepoTestConstants.PROJECT_NAME_LABEL).setText(ICreaterepoTestConstants.PROJECT_NAME);
bot.button(ICreaterepoTestConstants.NEXT_BUTTON).click();
bot.textWithLabel(Messages.CreaterepoNewWizardPageTwo_labelID).setText(REPO_ID);
bot.textWithLabel(Messages.CreaterepoNewWizardPageTwo_labelName).setText(REPO_WIZARD_NAME);
@@ -110,7 +111,7 @@ public class CreaterepoWizardTest {
bot.button(ICreaterepoTestConstants.FINISH_BUTTON).click();
// verify that project has been initialized properly
- project = root.getProject(PROJECT_NAME);
+ project = root.getProject(ICreaterepoTestConstants.PROJECT_NAME);
assertTrue(project.exists());
assertTrue(project.hasNature(CreaterepoProjectNature.CREATEREPO_NATURE_ID));
// 3 = .project + content folder + .repo file
@@ -127,7 +128,7 @@ public class CreaterepoWizardTest {
// get the created .repo file contents
IFile repoFile = (IFile) project.findMember(REPO_FILE);
// repo file should not be empty
- assertNotEquals(repoFile.getContents().available(), 0);
+ assertNotEquals(0, repoFile.getContents().available());
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(repoFile.getContents()));
String line;
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectCreatorTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectCreatorTest.java
index f8c434a..fac9338 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectCreatorTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectCreatorTest.java
@@ -11,6 +11,8 @@
package org.eclipse.linuxtools.rpm.createrepo.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
@@ -36,9 +38,6 @@ import org.junit.Test;
*/
public class CreaterepoProjectCreatorTest {
- private static final String PROJECT_NAME = "createrepo-test-project"; //$NON-NLS-1$
- private static final String REPO_NAME = "createrepo-test-repo.repo"; //$NON-NLS-1$
-
private static IWorkspaceRoot root;
private static NullProgressMonitor monitor;
private IProject project;
@@ -60,8 +59,11 @@ public class CreaterepoProjectCreatorTest {
@Before
public void setUp() throws CoreException{
if (project == null || !project.exists()) {
- project = CreaterepoProjectCreator.create(PROJECT_NAME, root.getLocation(), REPO_NAME, monitor);
+ project = CreaterepoProjectCreator.create(ICreaterepoTestConstants.PROJECT_NAME,
+ root.getLocation(), ICreaterepoTestConstants.REPO_NAME, monitor);
}
+ assertNotNull(project);
+ assertTrue(project.exists());
}
/**
@@ -72,8 +74,9 @@ public class CreaterepoProjectCreatorTest {
@After
public void tearDown() throws CoreException {
if (project != null && project.exists()) {
- project.delete(true, monitor);
+ project.delete(true, true, monitor);
}
+ assertFalse(project.exists());
}
/**
@@ -86,14 +89,13 @@ public class CreaterepoProjectCreatorTest {
*/
@Test
public void testProjectContents() throws CoreException, IOException {
- assertTrue(project.exists());
- // 3 = .project + .repo file
+ // 2 = .project + .repo file
assertEquals(2, project.members().length);
// contains the repo file
- assertTrue(project.findMember(REPO_NAME).exists());
+ assertTrue(project.findMember(ICreaterepoTestConstants.REPO_NAME).exists());
- IFile repoFile = (IFile) project.findMember(REPO_NAME);
+ IFile repoFile = (IFile) project.findMember(ICreaterepoTestConstants.REPO_NAME);
// repo file should be empty because test did not go through project creation
// to initialize .repo contents
assertEquals(repoFile.getContents().available(), 0);
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectTest.java
index 8ee235d..ab43a26 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoProjectTest.java
@@ -12,6 +12,7 @@ package org.eclipse.linuxtools.rpm.createrepo.tests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -48,15 +49,10 @@ import org.osgi.service.prefs.BackingStoreException;
*/
public class CreaterepoProjectTest {
- private static final String PROJECT_NAME = "createrepo-test-project"; //$NON-NLS-1$
- private static final String REPO_NAME = "createrepo-test-repo.repo"; //$NON-NLS-1$
-
- private static final String TEST_RPM1 = "eclipse-egit-github-3.0.0-2.fc19.noarch.rpm"; //$NON-NLS-1$
private static final String TEST_RPM_LOC1 = ICreaterepoTestConstants.RPM_RESOURCE_LOC
- .concat(TEST_RPM1);
- private static final String TEST_RPM2 = "hello-2.8-1.fc19.src.rpm"; //$NON-NLS-1$
+ .concat(ICreaterepoTestConstants.RPM1);
private static final String TEST_RPM_LOC2 = ICreaterepoTestConstants.RPM_RESOURCE_LOC
- .concat(TEST_RPM2);
+ .concat(ICreaterepoTestConstants.RPM2);
private static IWorkspaceRoot root;
private static NullProgressMonitor monitor;
@@ -79,8 +75,11 @@ public class CreaterepoProjectTest {
@Before
public void setUp() throws CoreException {
if (project == null || !project.exists()) {
- project = CreaterepoProjectCreator.create(PROJECT_NAME, root.getLocation(), REPO_NAME, monitor);
+ project = CreaterepoProjectCreator.create(ICreaterepoTestConstants.PROJECT_NAME,
+ root.getLocation(), ICreaterepoTestConstants.REPO_NAME, monitor);
}
+ assertNotNull(project);
+ assertTrue(project.exists());
}
/**
@@ -89,10 +88,11 @@ public class CreaterepoProjectTest {
* @throws CoreException
*/
@After
- public void tearDown() throws CoreException{
+ public void tearDown() throws CoreException {
if (project != null && project.exists()) {
- project.delete(true, monitor);
+ project.delete(true, true, monitor);
}
+ assertFalse(project.exists());
}
/**
@@ -104,15 +104,15 @@ public class CreaterepoProjectTest {
*/
@Test
public void testInitialize() throws CoreException {
- assertTrue(project.exists());
- CreaterepoProject createrepoProject = new CreaterepoProject(project, (IFile)project.findMember(REPO_NAME));
+ CreaterepoProject createrepoProject = new CreaterepoProject(project,
+ (IFile)project.findMember(ICreaterepoTestConstants.REPO_NAME));
// content folder is defined, but not created (wizard does that)
- assertTrue(createrepoProject.getContentFolder() != null);
+ assertNotNull(createrepoProject.getContentFolder());
assertFalse(createrepoProject.getContentFolder().exists());
// repo file is found and exists
- assertTrue(createrepoProject.getRepoFile() != null);
+ assertNotNull(createrepoProject.getRepoFile());
assertTrue(createrepoProject.getRepoFile().exists());
- assertEquals(REPO_NAME, createrepoProject.getRepoFile().getName());
+ assertEquals(ICreaterepoTestConstants.REPO_NAME, createrepoProject.getRepoFile().getName());
}
/**
@@ -124,16 +124,15 @@ public class CreaterepoProjectTest {
*/
@Test
public void testInitializeNoRepoFileSpecfied() throws CoreException, BackingStoreException {
- assertTrue(project.exists());
// repo file will be found rather than initialized
CreaterepoProject createrepoProject = new CreaterepoProject(project);
// content folder is defined, but not created (wizard does that)
- assertTrue(createrepoProject.getContentFolder() != null);
+ assertNotNull(createrepoProject.getContentFolder());
assertFalse(createrepoProject.getContentFolder().exists());
// repo file is found and exists
- assertTrue(createrepoProject.getRepoFile() != null);
+ assertNotNull(createrepoProject.getRepoFile());
assertTrue(createrepoProject.getRepoFile().exists());
- assertEquals(REPO_NAME, createrepoProject.getRepoFile().getName());
+ assertEquals(ICreaterepoTestConstants.REPO_NAME, createrepoProject.getRepoFile().getName());
}
/**
@@ -152,18 +151,15 @@ public class CreaterepoProjectTest {
.getBundle(CreaterepoProjectTest.class), new Path(TEST_RPM_LOC1), null);
File rpmFile = new File(FileLocator.toFileURL(rpmURL).getPath());
createrepoProject.importRPM(rpmFile);
- assertTrue(createrepoProject.getContentFolder() != null);
+ assertNotNull(createrepoProject.getContentFolder());
assertTrue(createrepoProject.getContentFolder().exists());
assertEquals(1, createrepoProject.getContentFolder().members().length);
- assertTrue(createrepoProject.getContentFolder().findMember(TEST_RPM1).exists());
+ assertTrue(createrepoProject.getContentFolder().findMember(ICreaterepoTestConstants.RPM1).exists());
// test for duplicate file
- rpmURL = FileLocator.find(FrameworkUtil
- .getBundle(CreaterepoProjectTest.class), new Path(TEST_RPM_LOC1), null);
- rpmFile = new File(FileLocator.toFileURL(rpmURL).getPath());
createrepoProject.importRPM(rpmFile);
assertEquals(1, createrepoProject.getContentFolder().members().length);
- assertTrue(createrepoProject.getContentFolder().findMember(TEST_RPM1).exists());
+ assertTrue(createrepoProject.getContentFolder().findMember(ICreaterepoTestConstants.RPM1).exists());
// test for new file
rpmURL = FileLocator.find(FrameworkUtil
@@ -171,7 +167,7 @@ public class CreaterepoProjectTest {
rpmFile = new File(FileLocator.toFileURL(rpmURL).getPath());
createrepoProject.importRPM(rpmFile);
assertEquals(2, createrepoProject.getContentFolder().members().length);
- assertTrue(createrepoProject.getContentFolder().findMember(TEST_RPM2).exists());
+ assertTrue(createrepoProject.getContentFolder().findMember(ICreaterepoTestConstants.RPM2).exists());
}
/**
@@ -206,7 +202,8 @@ public class CreaterepoProjectTest {
@Test
public void testSimpleExecute() throws CoreException {
CreaterepoProject createrepoProject = new CreaterepoProject(project);
- assertTrue(!createrepoProject.getContentFolder().exists());
+ // make sure that content folder doesn't exist
+ assertFalse(createrepoProject.getContentFolder().exists());
// assume that there is creatrepo version of >= 0.9.8
IStatus validVersion = Createrepo.isCorrectVersion(CreaterepoUtils.findConsole("test").newMessageStream()); //$NON-NLS-1$
Assume.assumeTrue(validVersion.isOK());
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoUtilsTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoUtilsTest.java
index 1d16848..88406ee 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoUtilsTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/CreaterepoUtilsTest.java
@@ -12,6 +12,7 @@ package org.eclipse.linuxtools.rpm.createrepo.tests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
import org.eclipse.linuxtools.rpm.createrepo.CreaterepoUtils;
import org.eclipse.ui.console.ConsolePlugin;
@@ -49,6 +50,7 @@ public class CreaterepoUtilsTest {
if (manager != null) {
manager.removeConsoles(manager.getConsoles());
}
+ assertEquals(0, manager.getConsoles().length);
}
/**
@@ -62,6 +64,7 @@ public class CreaterepoUtilsTest {
createrepoConsole,
new MessageConsole("DummyConsole2", null, null, true) //$NON-NLS-1$
});
+ assertEquals(3, manager.getConsoles().length);
assertEquals(createrepoConsole, CreaterepoUtils.findConsole(CONSOLE_NAME));
}
@@ -76,6 +79,7 @@ public class CreaterepoUtilsTest {
new MessageConsole(CONSOLE_NAME, null, null, true),
new MessageConsole("DummyConsole2", null, null, true) //$NON-NLS-1$
});
+ assertEquals(3, manager.getConsoles().length);
assertNotEquals(createrepoConsole, CreaterepoUtils.findConsole(CONSOLE_NAME));
assertEquals(CONSOLE_NAME, CreaterepoUtils.findConsole(CONSOLE_NAME).getName());
}
@@ -86,7 +90,7 @@ public class CreaterepoUtilsTest {
@Test
public void testCreateConsoleIfNotFound() {
MessageConsole console = CreaterepoUtils.findConsole(CONSOLE_NAME);
- assertNotEquals(null, console);
+ assertNotNull(console);
assertEquals(CONSOLE_NAME, console.getName());
}
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/ICreaterepoTestConstants.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/ICreaterepoTestConstants.java
index c9f14a9..da60adf 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/ICreaterepoTestConstants.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/ICreaterepoTestConstants.java
@@ -12,7 +12,7 @@ package org.eclipse.linuxtools.rpm.createrepo.tests;
/**
- * Constants used for SWTBot testing.
+ * Constants used for testing.
*/
public interface ICreaterepoTestConstants {
@@ -36,8 +36,8 @@ public interface ICreaterepoTestConstants {
* Views
*/
String WELCOME_VIEW = "Welcome"; //$NON-NLS-1$
- String JAVA_NODE = "Java"; //$NON-NLS-1$
- String PACKAGE_EXPLORER = "Package Explorer"; //$NON-NLS-1$
+ String GENERAL_NODE = "General"; //$NON-NLS-1$
+ String NAVIGATOR = "Navigator"; //$NON-NLS-1$
/*
* Project Wizard Specific Stuff
@@ -51,6 +51,8 @@ public interface ICreaterepoTestConstants {
*/
String RPM_RESOURCE_LOC = "resources" + System.getProperty("file.separator") //$NON-NLS-1$//$NON-NLS-2$
+ "rpms" + System.getProperty("file.separator"); //$NON-NLS-1$ //$NON-NLS-2$
+ String RPM1 = "eclipse-egit-github-3.0.0-2.fc19.noarch.rpm"; //$NON-NLS-1$
+ String RPM2 = "hello-2.8-1.fc19.src.rpm"; //$NON-NLS-1$
/*
* Common createrepo files
@@ -58,4 +60,10 @@ public interface ICreaterepoTestConstants {
String REPODATA_FOLDER = "repodata"; //$NON-NLS-1$
String REPO_MD_NAME = "repomd.xml"; //$NON-NLS-1$
+ /*
+ * Test names
+ */
+ String PROJECT_NAME = "createrepo-test-project"; //$NON-NLS-1$
+ String REPO_NAME = "createrepo-test-repo.repo"; //$NON-NLS-1$
+
}
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/TestCreaterepoProject.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/TestCreaterepoProject.java
index 87397e7..17e9c24 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/TestCreaterepoProject.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/rpm/createrepo/tests/TestCreaterepoProject.java
@@ -35,12 +35,6 @@ import org.eclipse.linuxtools.rpm.createrepo.IRepoFileConstants;
*/
public class TestCreaterepoProject {
- /*
- * Test names for the project and .repo file.
- */
- public static final String PROJECT_NAME = "createrepo-test-project"; //$NON-NLS-1$
- public static final String REPO_NAME = "createrepo-test-repo.repo"; //$NON-NLS-1$
-
private static NullProgressMonitor monitor;
private IProject project;
@@ -52,9 +46,9 @@ public class TestCreaterepoProject {
public TestCreaterepoProject() throws CoreException {
monitor = new NullProgressMonitor();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- project = root.getProject(PROJECT_NAME);
+ project = root.getProject(ICreaterepoTestConstants.PROJECT_NAME);
IProjectDescription description = ResourcesPlugin.getWorkspace()
- .newProjectDescription(PROJECT_NAME);
+ .newProjectDescription(ICreaterepoTestConstants.PROJECT_NAME);
description.setNatureIds(new String[] {CreaterepoProjectNature.CREATEREPO_NATURE_ID});
if (!project.exists()) {
project.create(description, monitor);
@@ -70,7 +64,7 @@ public class TestCreaterepoProject {
*/
private void init() throws CoreException {
createFolder(ICreaterepoConstants.CONTENT_FOLDER);
- createFile(REPO_NAME);
+ createFile(ICreaterepoTestConstants.REPO_NAME);
}
/**
@@ -129,7 +123,7 @@ public class TestCreaterepoProject {
* @throws CoreException
*/
public CreaterepoProject getCreaterepoProject() throws CoreException {
- return new CreaterepoProject(project, project.getFile(REPO_NAME));
+ return new CreaterepoProject(project, project.getFile(ICreaterepoTestConstants.REPO_NAME));
}
/**
@@ -155,7 +149,7 @@ public class TestCreaterepoProject {
contents = contents.concat(String.format("%s=%s\n", IRepoFileConstants.NAME, name)); //$NON-NLS-1$
contents = contents.concat(String.format("%s=%s\n", IRepoFileConstants.BASE_URL, url)); //$NON-NLS-1$
InputStream stream = new ByteArrayInputStream(contents.getBytes());
- IFile repoFile = project.getFile(REPO_NAME);
+ IFile repoFile = project.getFile(ICreaterepoTestConstants.REPO_NAME);
if (repoFile.exists()) {
repoFile.setContents(stream, true, true, monitor);
} else {