[jbosstools-dev] Fwd: [jbosstools-commits] JBoss Tools SVN: r4799 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet.

Max Rydahl Andersen max.andersen at redhat.com
Fri Nov 9 10:45:16 EST 2007


hi Denis,

This is a broken fix - we shouldn't reuse the projects since they can be  
different.

Why can't the project be deleted ? That works fine here...

/max


------- Forwarded message -------
From: jbosstools-commits at lists.jboss.org
To: jbosstools-commits at lists.jboss.org
Cc:
Subject: [jbosstools-commits] JBoss Tools SVN: r4799 -  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet.
Date: Thu, 08 Nov 2007 22:02:59 +0100

Author: dgolovin
Date: 2007-11-08 16:02:59 -0500 (Thu, 08 Nov 2007)
New Revision: 4799

Modified:
    trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
    trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
to fix exception 1 below test switched to using once created project.  
setUp just check if it is created and use it or create a new one.

delete project is commented out in abstract class, because it always  
shrows exceptions cannot delete project.

Exception 1
--------------
	Resource '/warprj' already exists.

org.eclipse.core.internal.resources.ResourceException: Resource '/warprj'  
already exists.
at  
org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:289)
at  
org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:276)
at org.eclipse.core.internal.resources.Project.create(Project.java:225)
at  
org.eclipse.wst.common.project.facet.core.internal.FacetedProjectFrameworkImpl.create(FacetedProjectFrameworkImpl.java:717)
at  
org.eclipse.wst.common.project.facet.core.ProjectFacetsManager.create(ProjectFacetsManager.java:399)
at  
org.jboss.tools.seam.core.test.project.facet.AbstractSeamFacetTest.createSeamProject(AbstractSeamFacetTest.java:142)
at  
org.jboss.tools.seam.core.test.project.facet.AbstractSeamFacetTest.createSeamWarProject(AbstractSeamFacetTest.java:157)
at  
org.jboss.tools.seam.core.test.project.facet.Seam2FacetInstallDelegateTest.setUp(Seam2FacetInstallDelegateTest.java:62)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:354)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:206)
at  
org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at  
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:572)
at  
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:171)
at  
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at  
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at  
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at  
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
at org.eclipse.core.launcher.Main.main(Main.java:30)

Modified:  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
---  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java	2007-11-08  
20:51:11 UTC (rev 4798)
+++  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java	2007-11-08  
21:02:59 UTC (rev 4799)
@@ -81,7 +81,7 @@
  		for (IResource r : this.resourcesToCleanup) {
  			try {
  				System.out.println("Deleting " + r);
-				r.delete(true, null);
+				//r.delete(true, null);
  			} catch(Exception e) {
  				System.out.println("Error deleting " + r);
  				e.printStackTrace();

Modified:  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
---  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java	2007-11-08  
20:51:11 UTC (rev 4798)
+++  
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java	2007-11-08  
21:02:59 UTC (rev 4799)
@@ -21,6 +21,8 @@
  import org.eclipse.core.resources.IResource;
  import org.eclipse.core.resources.IResourceProxy;
  import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
  import org.eclipse.core.runtime.CoreException;
  import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
  import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -50,22 +52,29 @@
  	
  	@Override
  	protected void setUp() throws Exception {
-	
-		seam2Facet = ProjectFacetsManager.getProjectFacet("jst.seam");
-		seam2FacetVersion = seam2Facet.getVersion("2.0");
+		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+		IProject war = (IProject)wsRoot.findMember("warprj");
+		IProject ear = (IProject)wsRoot.findMember("earprj");
  		
-		File folder = new  
File(System.getProperty("jbosstools.test.seam.2.0.0.home",  
"/home/max/work/products/jboss-seam-2.0.0.CR2"));
+		if(war==null && ear==null) {
  		
-		SeamRuntimeManager.getInstance().addRuntime(SEAM_2_0_0,  
folder.getAbsolutePath(), SeamVersion.SEAM_2_0, true);
-		SeamRuntimeManager.getInstance().findRuntimeByName(SEAM_2_0_0);
-	
-		warProject = createSeamWarProject("warprj");
-		earProject = createSeamEarProject("earprj");
+			seam2Facet = ProjectFacetsManager.getProjectFacet("jst.seam");
+			seam2FacetVersion = seam2Facet.getVersion("2.0");
+			
+			File folder = new  
File(System.getProperty("jbosstools.test.seam.2.0.0.home",  
"c:/java/jboss-seam-2.0.0.CR3"));
+			
+			SeamRuntimeManager.getInstance().addRuntime(SEAM_2_0_0,  
folder.getAbsolutePath(), SeamVersion.SEAM_2_0, true);
+			SeamRuntimeManager.getInstance().findRuntimeByName(SEAM_2_0_0);
  		
-		warProject.getProject().getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,  
null);
+			warProject = createSeamWarProject("warprj");
+			earProject = createSeamEarProject("earprj");
+			
+			warProject.getProject().getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,  
null);
+		} else {
+			warProject = ProjectFacetsManager.create(war);
+			earProject = ProjectFacetsManager.create(ear);			
+		}
  		
-		
-		
  		super.setUp();
  	}
  	
@@ -87,6 +96,9 @@
  		warlibs.add("antlr-runtime.jar");
  		warlibs.add("commons-beanutils.jar");
  		warlibs.add("commons-digester.jar");
+		warlibs.add("commons-collections.jar");
+		warlibs.add("janino.jar");
+		warlibs.add("antlr.jar");
  		warlibs.add("drools-compiler.jar");
  		warlibs.add("drools-core.jar");
  		warlibs.add("core.jar");

_______________________________________________
jbosstools-commits mailing list
jbosstools-commits at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbosstools-commits



-- 
/max




More information about the jbosstools-dev mailing list