[jbosstools-commits] JBoss Tools SVN: r30883 - in trunk/maven: tests/org.jboss.tools.maven.ui.bot.test/META-INF and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Apr 27 14:27:04 EDT 2011


Author: snjeza
Date: 2011-04-27 14:27:03 -0400 (Wed, 27 Apr 2011)
New Revision: 30883

Modified:
   trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
   trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
   trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java
Log:
JBIDE-8797 Test failure in Maven trunk component

Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java	2011-04-27 17:51:19 UTC (rev 30882)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java	2011-04-27 18:27:03 UTC (rev 30883)
@@ -18,6 +18,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 
@@ -747,20 +748,20 @@
 		build.getPlugins().add(plugin);
 	}
 	
-	public static PomResourceImpl loadResource(IFile pomFile) throws CoreException {
-    String path = pomFile.getFullPath().toOSString();
-    URI uri = URI.createFileURI(path);
-    try {
-      PomResourceFactoryImpl factory = new PomResourceFactoryImpl();
-      PomResourceImpl resource = (PomResourceImpl) factory.createResource(uri);
-      resource.load(Collections.EMPTY_MAP);
-      return resource;
-
-    } catch (Exception ex) {
-      String msg = "Can't load model " + pomFile;
-      log(ex);
-      throw new CoreException(new Status(IStatus.ERROR,
-          IMavenConstants.PLUGIN_ID, -1, msg, ex));
-    }
-  }
+	public static PomResourceImpl loadResource(IFile pomFile)
+			throws CoreException {
+		String path = pomFile.getFullPath().toOSString();
+		URI uri = URI.createPlatformResourceURI(path, true);
+		try {
+			org.eclipse.emf.ecore.resource.Resource pomResource = new PomResourceFactoryImpl()
+					.createResource(uri);
+			pomResource.load(new HashMap());
+			return (PomResourceImpl) pomResource;
+		} catch (Exception ex) {
+			String msg = "Can't load model " + pomFile;
+			log(ex);
+			throw new CoreException(new Status(IStatus.ERROR,
+					IMavenConstants.PLUGIN_ID, -1, msg, ex));
+		}
+	}
 }

Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF	2011-04-27 17:51:19 UTC (rev 30882)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF	2011-04-27 18:27:03 UTC (rev 30883)
@@ -35,7 +35,9 @@
  org.eclipse.jst.jee,
  org.eclipse.jst.jee.ejb,
  org.eclipse.jst.jee.ui,
- org.eclipse.jst.jee.web
+ org.eclipse.jst.jee.web,
+ org.eclipse.m2e.lifecyclemapping.defaults;bundle-version="0.13.0",
+ org.eclipse.m2e.launching;bundle-version="0.13.0"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Eclipse-RegisterBuddy: org.apache.log4j

Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java	2011-04-27 17:51:19 UTC (rev 30882)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/CreateMavenizedSeamProjectTest.java	2011-04-27 18:27:03 UTC (rev 30883)
@@ -491,6 +491,18 @@
 	}
 	
 	@Test
+	public void testAsLocation() {
+		String asLocation = JBOSS_AS_HOME;
+		assertTrue("Invalid JBoss AS location:" + asLocation, new File(asLocation).isDirectory());
+	}
+	
+	@Test
+	public void testSeamLocation() {
+		String seamLocation = SEAM_HOME_PROPERTY;
+		assertTrue("Invalid Seam Runtime location:" + seamLocation, new File(seamLocation).isDirectory());
+	}
+	
+	@Test
 	public void testErrors() throws Exception {
 		checkErrors(PROJECT_NAME);
 		checkErrors(EAR_PROJECT_NAME);
@@ -511,7 +523,9 @@
 		for (int i = 0; i < projectMarkers.length; i++) {
 			if (projectMarkers[i].getAttribute(IMarker.SEVERITY,
 					IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_ERROR) {
-				markers.add(projectMarkers[i]);
+				if (!"org.eclipse.m2e.core.maven2Problem.lifecycleMapping".equals(projectMarkers[i].getType())) {
+						markers.add(projectMarkers[i]);
+				}
 			}
 		}
 		assertTrue("The '" + projectName + "' contains errors.", markers.size() == 0);
@@ -545,7 +559,7 @@
 		warProjectItem.select();
 		
 		SWTBotMenu runAs = tree.contextMenu("Run As");
-		runAs.menu("6 Maven build...").click();
+		runAs.menu("5 Maven build...").click();
 
 		SWTBotShell shell = bot.shell("Edit Configuration");
 		shell.activate();



More information about the jbosstools-commits mailing list