Author: akazakov
Date: 2012-01-30 19:37:42 -0500 (Mon, 30 Jan 2012)
New Revision: 38308
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10753
org.jboss.tools.seam.ui.test.preferences.SeamSettingsPreferencesPageTest failure
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2012-01-31
00:17:08 UTC (rev 38307)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2012-01-31
00:37:42 UTC (rev 38308)
@@ -106,9 +106,12 @@
CASeamAddInfoInELMessagesTest.class), "org.jboss.tools.seam.ui.test",
//$NON-NLS-1$
new String[] { "projects/TestSeamELContentAssist", }, //$NON-NLS-1$
new String[] { "TestSeamELContentAssist" })); //$NON-NLS-1$
-
- suite.addTestSuite(SeamSettingsPreferencesPageTest.class);
-
+
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ SeamSettingsPreferencesPageTest.class), "org.jboss.tools.seam.ui.test",
//$NON-NLS-1$
+ new String[] { "projects/TestSeamSettingsPreferencesPage", },
//$NON-NLS-1$
+ new String[] { "TestSeamSettingsPreferencesPage" })); //$NON-NLS-1$
+
return suite;
}
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2012-01-31
00:17:08 UTC (rev 38307)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2012-01-31
00:37:42 UTC (rev 38308)
@@ -11,17 +11,13 @@
package org.jboss.tools.seam.ui.test.preferences;
import java.io.File;
-import java.io.IOException;
-import java.net.URL;
import java.text.MessageFormat;
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.preference.PreferenceDialog;
@@ -55,24 +51,23 @@
public static final String PROP_SEAM_1_2_HOME_PATH =
"jbosstools.test.seam.1.2.1.eap.home";
public static final String SEAM_1_2_HOME_PATH;
-
+
static {
SEAM_1_2_HOME_PATH = System.getProperty(PROP_SEAM_1_2_HOME_PATH);
if(SEAM_1_2_HOME_PATH == null) {
throw new IllegalArgumentException(MessageFormat.format(INIT_ERROR_MESSAGE,
PROP_SEAM_1_2_HOME_PATH));
}
}
-
+
public SeamSettingsPreferencesPageTest() {
super("Seam Settings Preferences Page Tests");
}
+ @Override
protected void setUp() throws Exception {
- IResource project = ResourcesPlugin.getWorkspace().getRoot().findMember(PROJECT_NAME);
- assertNotNull(PROJECT_NAME + " project is not imported.", project);
- this.project = project.getProject();
+ this.project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ assertTrue(PROJECT_NAME + " project is not imported.", project.exists());
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- JobUtils.waitForIdle();
}
public void testSettingsPage() throws Exception {
@@ -111,7 +106,7 @@
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
assertNotNull("Can't load seam project. It seems seam nature was not added to
rpoject by seam settings page.", seamProject);
-
+
IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(project);
assertEquals("Seam settings version 1.1 property is not set",
pref.get(ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION, ""),
ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION_1_1);
assertEquals("Seam runtime property is not set",
pref.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, ""), RUNTIME_NAME);
@@ -125,7 +120,7 @@
assertEquals("Test package name property is not set", TEST_PACKAGE_NAME,
pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, ""));
assertEquals("Test source folder property is not set",
pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, ""), "/" +
PROJECT_NAME + "/src");
assertEquals("View folder property is not set",
pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, ""), "/" +
PROJECT_NAME);
-
+
assertTrue("Seam Nature was not enabled for project \"" +
project.getName() + "\"",project.hasNature(ISeamProject.NATURE_ID));
}
}
\ No newline at end of file