Author: dgolovin
Date: 2008-01-09 03:02:39 -0500 (Wed, 09 Jan 2008)
New Revision: 5538
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
Log:
Test errors were fixed
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-01-09
08:00:04 UTC (rev 5537)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-01-09
08:02:39 UTC (rev 5538)
@@ -11,6 +11,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
@@ -30,9 +32,10 @@
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
import org.jboss.tools.seam.text.ext.hyperlink.SeamViewHyperlinkPartitioner;
+import org.jboss.tools.test.util.ResourcesUtils;
public class SeamViewHyperlinkPartitionerTest extends TestCase {
- TestProjectProvider provider = null;
+
IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "TestSeamELContentAssist";
@@ -43,21 +46,15 @@
}
public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null,
PROJECT_NAME, makeCopy);
- project = provider.getProject();
+ //provider = new TestProjectProvider("", null, PROJECT_NAME, makeCopy);
+ project =
ResourcesUtils.importProject(Platform.getBundle("org.jboss.tools.seam.ui.test"),
"/projects/TestSeamELContentAssist", new NullProgressMonitor());
Throwable exception = null;
- try {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (Exception x) {
- exception = x;
- x.printStackTrace();
- }
- assertNull("An exception caught: " + (exception != null?
exception.getMessage() : ""), exception);
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
}
protected void tearDown() throws Exception {
- if(provider != null) {
- provider.dispose();
+ if(project != null) {
+ project.delete(true, true, null);
}
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-01-09
08:00:04 UTC (rev 5537)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-01-09
08:02:39 UTC (rev 5538)
@@ -26,6 +26,7 @@
import org.eclipse.ui.PlatformUI;
import
org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.jboss.tools.common.util.WorkbenchUtils;
import org.jboss.tools.jst.firstrun.JBossASAdapterInitializer;
@@ -40,9 +41,22 @@
*/
public class SeamProjectNewWizardTest extends TestCase{
+
+ /**
+ *
+ */
+ private static final String SEAM_2_0_0_RT_NAME = "Seam 2.0";
+ /**
+ *
+ */
+ private static final String SEAM_1_2_1_RT_NAME = "Seam 1.2.1";
+ public static final String JBOSS_AS_42_HOME
+ = System.getProperty("jbosstools.test.jboss.home.4.2",
"C:\\java\\jboss-4.2.2.GA");
NewProjectDataModelFacetWizard wizard;
IWizardPage startSeamPrjWzPg;
-
+ SeamRuntimeManager manager = SeamRuntimeManager.getInstance();
+
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -83,7 +97,9 @@
// Create JBoss AS Runtime, Server, HSQL DB Driver
try {
- JBossASAdapterInitializer.initJBossAS("", new NullProgressMonitor());
+ IServerWorkingCopy server = JBossASAdapterInitializer.initJBossAS(JBOSS_AS_42_HOME,
new NullProgressMonitor());
+ System.out.println(server.getName());
+ System.out.println(server.getRuntime().getName());
} catch (CoreException e) {
fail("Cannot create JBoss AS Runtime, Server or HSQL Driver for unexisted AS
location to test New Seam Project Wizard. " + e.getMessage());
} catch (ConnectionProfileException e) {
@@ -91,14 +107,12 @@
}
// Create Seam Runtime and set proper field
- SeamRuntimeManager manager = SeamRuntimeManager.getInstance();
-
Bundle seamTest = Platform.getBundle("org.jboss.tools.seam.ui.test");
try {
URL seamUrl = FileLocator.resolve(seamTest.getEntry("/seam"));
File folder = new File(seamUrl.getPath());
- manager.addRuntime("Seam 1.2.1", folder.getAbsolutePath(),
SeamVersion.SEAM_1_2, true);
- manager.addRuntime("Seam 2.0", folder.getAbsolutePath(),
SeamVersion.SEAM_2_0, true);
+ manager.addRuntime(SEAM_1_2_1_RT_NAME, folder.getAbsolutePath(), SeamVersion.SEAM_1_2,
true);
+ manager.addRuntime(SEAM_2_0_0_RT_NAME, folder.getAbsolutePath(), SeamVersion.SEAM_2_0,
true);
} catch (IOException e) {
fail("Cannot create Seam Runtime to test New Seam Project Wizard. " +
e.getMessage());
}
@@ -122,5 +136,15 @@
assertTrue("Finish button is disabled at first wizard page in spite of created
JBoss AS Runtime, Server, DB Connection and Seam Runtime and valid project name.",
canFinish);
wizard.performCancel();
+
+ manager.removeRuntime(manager.findRuntimeByName(SEAM_1_2_1_RT_NAME));
+ manager.removeRuntime(manager.findRuntimeByName(SEAM_2_0_0_RT_NAME));
+
}
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
}
\ No newline at end of file