[jbosstools-commits] JBoss Tools SVN: r42844 - in trunk/as/tests/org.jboss.tools.as.test.core: META-INF and 5 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Aug 3 02:45:42 EDT 2012


Author: rob.stryker at jboss.com
Date: 2012-08-03 02:45:42 -0400 (Fri, 03 Aug 2012)
New Revision: 42844

Modified:
   trunk/as/tests/org.jboss.tools.as.test.core/META-INF/MANIFEST.MF
   trunk/as/tests/org.jboss.tools.as.test.core/plugin.xml
   trunk/as/tests/org.jboss.tools.as.test.core/pom.xml
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/TestConstants.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/classpath/JEEClasspathContainerTest.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/internal/utils/ServerCreationTestUtils.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerBeanLoader3Test.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerHomeTest.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractComponentPublishingTest.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java
   trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/PublishingSuite.java
Log:
JBIDE-12363 unit tests

Modified: trunk/as/tests/org.jboss.tools.as.test.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/META-INF/MANIFEST.MF	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/META-INF/MANIFEST.MF	2012-08-03 06:45:42 UTC (rev 42844)
@@ -1,8 +1,8 @@
 hManifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: %Bundlehugs-Name.0
+Bundle-Name: %BundleName.0
 Bundle-SymbolicName: org.jboss.tools.as.test.core;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.4.0.qualifier
 Bundle-Localization: plugin
 Bundle-Activator: org.jboss.tools.as.test.core.ASMatrixTests
 Require-Bundle: org.eclipse.ui,

Modified: trunk/as/tests/org.jboss.tools.as.test.core/plugin.xml
===================================================================
(Binary files differ)

Modified: trunk/as/tests/org.jboss.tools.as.test.core/pom.xml
===================================================================
(Binary files differ)

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/TestConstants.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/TestConstants.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/TestConstants.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -14,6 +14,11 @@
 	public static final String JBOSS_AS_52_HOME = System.getProperty("jbosstools.test.jboss.home.5.2", "C:\\apps\\jboss\\jboss-5.2.0.GA\\");
 	public static final String JBOSS_AS_60_HOME = System.getProperty("jbosstools.test.jboss.home.6.0", "C:\\apps\\jboss\\jboss-6.0.0.GA\\");
 	public static final String JBOSS_AS_70_HOME = System.getProperty("jbosstools.test.jboss.home.7.0", "C:\\apps\\jboss\\jboss-7.0.0.GA\\");
+	public static final String JBOSS_AS_71_HOME = System.getProperty("jbosstools.test.jboss.home.7.1", "C:\\apps\\jboss\\jboss-7.1.0.GA\\");
+	public static final String JBOSS_EAP_43_HOME = System.getProperty("jbosstools.test.jboss.home.eap.4.3", "C:\\apps\\jboss\\jboss-eap-4.3.0.GA\\");
+	public static final String JBOSS_EAP_50_HOME = System.getProperty("jbosstools.test.jboss.home.eap.5.0", "C:\\apps\\jboss\\jboss-eap-5.0.0.GA\\");
+	public static final String JBOSS_EAP_60_HOME = System.getProperty("jbosstools.test.jboss.home.eap.6.0", "C:\\apps\\jboss\\jboss-eap-6.0.0.GA\\");
+	
 	public static final String JRE_14_HOME = System.getProperty("jbosstools.test.jre.1.4", "C:\\apps\\jboss\\jboss-5.2.0.GA\\");
 	public static final String JRE_5_HOME = System.getProperty("jbosstools.test.jre.5", "C:\\apps\\jboss\\jboss-5.2.0.GA\\");
 	public static final String JRE_6_HOME = System.getProperty("jbosstools.test.jre.6", "C:\\apps\\jboss\\jboss-5.2.0.GA\\");
@@ -29,7 +34,10 @@
 		serverTypeToHome.put(IJBossToolingConstants.SERVER_AS_51, JBOSS_AS_51_HOME);
 		serverTypeToHome.put(IJBossToolingConstants.SERVER_AS_60, JBOSS_AS_60_HOME);
 		serverTypeToHome.put(IJBossToolingConstants.SERVER_AS_70, JBOSS_AS_70_HOME);
-		//serverTypeToHome.put(IJBossToolingConstants.SERVER_AS_71, JBOSS_AS_32_HOME);
+		serverTypeToHome.put(IJBossToolingConstants.SERVER_AS_71, JBOSS_AS_71_HOME);
+		serverTypeToHome.put(IJBossToolingConstants.SERVER_EAP_43, JBOSS_EAP_43_HOME);
+		serverTypeToHome.put(IJBossToolingConstants.SERVER_EAP_50, JBOSS_EAP_50_HOME);
+		serverTypeToHome.put(IJBossToolingConstants.SERVER_EAP_60, JBOSS_EAP_60_HOME);
 	}
 	
 	public static String getServerHome(String serverTypeId) {

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/classpath/JEEClasspathContainerTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/classpath/JEEClasspathContainerTest.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/classpath/JEEClasspathContainerTest.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -53,7 +53,7 @@
 	private IProject project;
 
 	protected void setUp() throws Exception {
-		provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true); 
+		provider = new TestProjectProvider("org.jboss.tools.as.test.core", null, "basicwebproject", true); 
 		project = provider.getProject();
 		project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
 	}

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/internal/utils/ServerCreationTestUtils.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/internal/utils/ServerCreationTestUtils.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/internal/utils/ServerCreationTestUtils.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -130,6 +130,7 @@
 		String loc = TestConstants.getServerHome(serverType);
 		assertNotNull("Runtime location for server type " + serverType + " not set in test suite", loc);
 		File locFile = new Path(loc).toFile();
+		assertTrue(locFile.exists());
 		return createServerWithRuntime(serverType, name, locFile);
 	}
 	

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerBeanLoader3Test.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerBeanLoader3Test.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerBeanLoader3Test.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -69,7 +69,11 @@
 		String fLoc = TestConstants.getServerHome(serverType);
 		if( fLoc == null )
 			fail("Test Suite has no server home for server type " + serverType);
-		inner_testServerBeanLoaderForFolder(new File(fLoc));
+		Pair p = expected.get(serverType);
+		inner_testServerBeanLoaderForFolder(new File(fLoc), p.type, p.version);
+		if( p.type.equals(JBossServerType.EAP_STD)) {
+			inner_testServerBeanLoaderForFolder(new File(fLoc).getParentFile(), JBossServerType.EAP, p.version);
+		}
 	}
 
 	/*
@@ -80,10 +84,11 @@
 		File serverDir = (ServerCreationTestUtils.createMockServerLayout(serverType));
 		if( serverDir == null || !serverDir.exists())
 			fail("Creation of mock server type " + serverType + " has failed.");
-		inner_testServerBeanLoaderForFolder(serverDir);
+		Pair p = expected.get(serverType);
+		inner_testServerBeanLoaderForFolder(serverDir, p.type, p.version);
 	}
 	
-	private void inner_testServerBeanLoaderForFolder(File serverDir) {
+	private void inner_testServerBeanLoaderForFolder(File serverDir, JBossServerType expectedType, String expectedVersion) {
 		assertNotNull(serverType);
 		IServerType itype = ServerCore.findServerType(serverType);
 		if( itype == null )
@@ -93,10 +98,10 @@
 		
 		ServerBeanLoader loader = new ServerBeanLoader(serverDir);
 		JBossServerType type = loader.getServerType();
-		assertTrue(type.equals(expected.get(serverType).type));
+		assertEquals(expectedType, type);
 		String fullVersion = loader.getFullServerVersion();
-		assertTrue(fullVersion + " does not begin with " + expected.get(serverType).version, 
-				fullVersion.startsWith(expected.get(serverType).version));
+		assertTrue(fullVersion + " does not begin with " + expectedVersion, 
+				fullVersion.startsWith(expectedVersion));
 		assertEquals(loader.getServerAdapterId(), serverType);
 	}
 }

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerHomeTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerHomeTest.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerHomeTest.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -35,8 +35,8 @@
 		String loc = TestConstants.getServerHome(serverType);
 		if( loc == null )
 			fail( "Test Runtime for " + serverType + " is not set properly in the build" );
-		if (!new File(loc).exists())
+		boolean exists = new File(loc).exists();
+		if (!exists)
 			fail(serverType + " (" + loc + ") does not exist.");
 	}
-
 }

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractComponentPublishingTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractComponentPublishingTest.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractComponentPublishingTest.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -47,6 +47,10 @@
 		jarFolder = refFolder;
 	}
 	
+	protected void printConstructor() {
+		System.out.println(getClass().getName() + ":  " + param_serverType + ", " + param_zip + ", " + param_deployLoc + ", " + param_perModOverride + ", " + jarName + ", " + jarFolder);
+	}
+
 	protected void completeSetUp() {
 		// Keep it local for REAL publishes
 		wc.setAttribute(IDeployableServer.SERVER_MODE, "local");

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -17,6 +17,7 @@
 import org.eclipse.wst.server.core.IServerWorkingCopy;
 import org.eclipse.wst.server.core.internal.ServerPreferences;
 import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.validation.ValidationFramework;
 import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
 import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
 import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
@@ -68,16 +69,22 @@
 	protected IModule primaryModule;
 	
 	public AbstractPublishingTest(String serverType, String zip, String deployLoc, String perMod) { 
-		System.out.println(serverType + ", " + zip + ", " + deployLoc + ", " + perMod);
 		this.param_serverType = serverType;
 		this.param_zip = zip;
 		this.param_deployLoc = deployLoc;
 		this.param_perModOverride = perMod;
 	}
+	
+	protected void printConstructor() {
+		System.out.println(getClass().getName() + ":  " + param_serverType + ", " + param_zip + ", " + param_deployLoc + ", " + param_perModOverride);
+	}
+	
 
 	@Before
 	public void setUp() throws Exception {
+		printConstructor();
 		ServerPreferences.getInstance().setAutoPublishing(false);
+		ValidationFramework.getDefault().suspendAllValidation(true);
 		JobUtils.waitForIdle();
 		server = ServerCreationTestUtils.createMockServerWithRuntime(param_serverType, getClass().getName() + param_serverType);
 		wc = server.createWorkingCopy();
@@ -94,7 +101,11 @@
 	
 	@After 
 	public void tearDown() throws Exception {
-		ASMatrixTests.cleanup();
+		try {
+			ASMatrixTests.cleanup();
+		} finally {
+			ValidationFramework.getDefault().suspendAllValidation(false);
+		}
 	}
 	
 	protected void setMockPublishMethod4(IServerWorkingCopy wc) {

Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/PublishingSuite.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/PublishingSuite.java	2012-08-03 06:43:53 UTC (rev 42843)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/PublishingSuite.java	2012-08-03 06:45:42 UTC (rev 42844)
@@ -1,6 +1,6 @@
 package org.jboss.tools.as.test.core.parametized.server.publishing;
 
-import org.jboss.tools.as.test.core.parametized.server.publishing.defect.RepublishDefectTest;
+import org.jboss.tools.as.test.core.parametized.server.publishing.defect.PublishDefectSuite;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
@@ -17,9 +17,9 @@
 	DeploymentAssemblyWorkspaceArchiveVarWarTest.class,
 	DeploymentAssemblyWorkspaceArchiveVarNestedWarTest.class,
 	DeploymentAssemblyFilesetReferenceTest.class,
-	RepublishDefectTest.class,
 	SingleDeployableFileTest.class,
-	SingleDeployableFolderTest.class
+	SingleDeployableFolderTest.class,
+	PublishDefectSuite.class
 })
 public class PublishingSuite {
 }



More information about the jbosstools-commits mailing list