Author: rob.stryker(a)jboss.com
Date: 2012-08-21 23:06:52 -0400 (Tue, 21 Aug 2012)
New Revision: 43144
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.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/CreateServerCheckDefaultsTest.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ProjectRuntimeClasspathTest.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/ServerParameterUtils.java
Log:
JBIDE-12363 more test stuff
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java 2012-08-22
00:49:07 UTC (rev 43143)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java 2012-08-22
03:06:52 UTC (rev 43144)
@@ -13,6 +13,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.internal.launching.environments.EnvironmentsManager;
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
@@ -88,7 +89,7 @@
// Overrides of as6-and-below's notion of configuration
@Override
public String getConfigLocation() {
- return ""; //$NON-NLS-1$
+ return new
Path(getConfigurationFile()).removeLastSegments(1).toFile().getAbsolutePath();
}
@Override
public String getJBossConfiguration() {
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-22
00:49:07 UTC (rev 43143)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/internal/utils/ServerCreationTestUtils.java 2012-08-22
03:06:52 UTC (rev 43144)
@@ -130,7 +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());
+ assertTrue("Runtime location for server type " + serverType + " ("
+ locFile.getAbsolutePath() + "), does not exist", 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/CreateServerCheckDefaultsTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/CreateServerCheckDefaultsTest.java 2012-08-22
00:49:07 UTC (rev 43143)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/CreateServerCheckDefaultsTest.java 2012-08-22
03:06:52 UTC (rev 43144)
@@ -89,7 +89,7 @@
ServerExtendedProperties props =
ExtendedServerPropertiesAdapterFactory.getServerExtendedProperties(server);
assertNotNull(props);
- assertTrue(props.verifyServerStructure().isOK());
+ assertTrue("Server creation structure fails a verify call for server type " +
serverType, props.verifyServerStructure().isOK());
if( props.canVerifyRemoteModuleState())
assertNotNull(props.getModuleStateVerifier());
if( props.hasWelcomePage()) {
@@ -151,7 +151,7 @@
}
assertNotNull("No filesets created", fs);
- assertTrue("0 filesets added for server " + server.getName(), fs.length >
0);
+ assertTrue("0 filesets added for server type " + serverType, fs.length >
0);
}
private IJBossServerRuntime getJBossRuntime(IServer s) {
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ProjectRuntimeClasspathTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ProjectRuntimeClasspathTest.java 2012-08-22
00:49:07 UTC (rev 43143)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ProjectRuntimeClasspathTest.java 2012-08-22
03:06:52 UTC (rev 43144)
@@ -66,7 +66,7 @@
@Before
public 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());
server = ServerCreationTestUtils.createServerWithRuntime(serverType,
getClass().getName() + serverType);
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-22
00:49:07 UTC (rev 43143)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerBeanLoader3Test.java 2012-08-22
03:06:52 UTC (rev 43144)
@@ -98,9 +98,9 @@
ServerBeanLoader loader = new ServerBeanLoader(serverDir);
JBossServerType type = loader.getServerType();
- assertEquals(expectedType, type);
+ assertEquals("Expected and actual server beans do not match for server type "
+ serverType, expectedType, type);
String fullVersion = loader.getFullServerVersion();
- assertTrue(fullVersion + " does not begin with " + expectedVersion,
+ assertTrue(fullVersion + " does not begin with " + expectedVersion + "
for server type " + serverType,
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/ServerParameterUtils.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerParameterUtils.java 2012-08-22
00:49:07 UTC (rev 43143)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ServerParameterUtils.java 2012-08-22
03:06:52 UTC (rev 43144)
@@ -1,6 +1,7 @@
package org.jboss.tools.as.test.core.parametized.server;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -29,14 +30,30 @@
}
return ret;
}
+
+ public static boolean skipPrivateRequirements() {
+ String prop =
System.getProperty("org.jboss.tools.tests.skipPrivateRequirements");
+ boolean skipReqs = prop == null || new Boolean(prop).booleanValue();
+ return skipReqs;
+ }
+
public static Object[] getJBossServerTypeParamterers() {
- return IJBossToolingConstants.ALL_JBOSS_SERVERS;
+ boolean skipReqs = skipPrivateRequirements();
+ ArrayList<String> jbservers = new ArrayList<String>();
+ for( int i = 0; i < IJBossToolingConstants.ALL_JBOSS_SERVERS.length; i++ ) {
+ // we're not skipping reqs, or, we are skipping AND it doesn't start with eap,
then add
+ if( !skipReqs ||
!IJBossToolingConstants.ALL_JBOSS_SERVERS[i].startsWith(IJBossToolingConstants.EAP_SERVER_PREFIX))
{
+ jbservers.add(IJBossToolingConstants.ALL_JBOSS_SERVERS[i]);
+ }
+ }
+ return (String[]) jbservers.toArray(new String[jbservers.size()]);
}
+
public static Object[] getAllJBossServerTypeParamterers() {
- Object[] ret = new Object[IJBossToolingConstants.ALL_JBOSS_SERVERS.length + 1];
- ret[0] = IJBossToolingConstants.DEPLOY_ONLY_SERVER;
- System.arraycopy(IJBossToolingConstants.ALL_JBOSS_SERVERS, 0, ret, 1,
IJBossToolingConstants.ALL_JBOSS_SERVERS.length);
- return ret;
+ ArrayList<Object> list = new ArrayList<Object>();
+ list.add(IJBossToolingConstants.DEPLOY_ONLY_SERVER);
+ list.addAll(Arrays.asList(getJBossServerTypeParamterers()));
+ return (Object[]) list.toArray(new Object[list.size()]);
}
/*