Author: rob.stryker(a)jboss.com
Date: 2012-07-27 04:56:30 -0400 (Fri, 27 Jul 2012)
New Revision: 42751
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/MySuite.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/CreateRuntimeTwiceTest.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/ParametizedSuite.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/DeploymentAssemblyArchivePathVarNestedWarTest.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarTest.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarWarTest.java
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/utiltests/ExpressionResolverUtilTest.java
Log:
JBIDE-12377 and JBIDE-12363 to trunk - much more to do
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -58,8 +58,8 @@
this.path = path;
this.javaProject = project;
String configName = path.segment(1);
- IProject p = project.getProject();
- if( configName == null && p.exists() && p.isOpen())
+ IProject p = project == null ? null : project.getProject();
+ if( configName == null && p != null && p.exists() &&
p.isOpen())
configName = findLegacyConfigName(project);
IServer foundServer = findServer(configName);
jbossServer = ServerConverter.getJBossServer(foundServer);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -35,7 +35,12 @@
public static final String JBOSS_CONFIG = "jboss_config"; //$NON-NLS-1$
public static final String JBOSS_CONFIG_DIR = "jboss_config_dir";
//$NON-NLS-1$
public static final String JBOSS_AS7_CONFIG_FILE = "jboss_config_file";
//$NON-NLS-1$
+ public static final String[] ALL_VARIABLES = new String[] {
+ JBOSS_CONFIG, JBOSS_CONFIG_DIR, JBOSS_AS7_CONFIG_FILE
+ };
+
+
/*
* entry points to fill out the server name in these variable substitutions
*/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/UnitedServerListenerManager.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -23,6 +23,7 @@
import org.eclipse.wst.server.core.IServerListener;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerEvent;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
/**
* The UnitedServerListenerManager keeps an array of
@@ -59,19 +60,9 @@
return (UnitedServerListener[]) list.toArray(new UnitedServerListener[list.size()]);
}
+ @Deprecated
public static boolean isJBossServer(IServer server) {
- if (server == null) {
- return false;
- }
- IRuntime rt = server.getRuntime();
- if (rt == null) {
- return false;
- }
- IJBossServerRuntime jbsrt =
(IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
- if (jbsrt == null) {
- return false;
- }
- return true;
+ return ServerConverter.getJBossServer(server) != null;
}
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/MySuite.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/MySuite.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/MySuite.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -1,13 +1,17 @@
package org.jboss.tools.as.test.core;
+import org.jboss.tools.as.test.core.classpath.ClasspathSuite;
import org.jboss.tools.as.test.core.parametized.server.ParametizedSuite;
+import org.jboss.tools.as.test.core.utiltests.UtilsSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
- ParametizedSuite.class
+ ParametizedSuite.class,
+ UtilsSuite.class,
+ ClasspathSuite.class
})
public class MySuite {
}
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-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/internal/utils/ServerCreationTestUtils.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -4,6 +4,8 @@
import java.io.IOException;
import java.util.HashMap;
+import junit.framework.Assert;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -30,7 +32,7 @@
* 2) Creating IServer objects out of either mock folders or legitimate installations
*
*/
-public class ServerCreationTestUtils {
+public class ServerCreationTestUtils extends Assert {
private static final IPath mockedServers =
ASMatrixTests.getDefault().getStateLocation().append("mockedServers");
private static HashMap<String, String> asSystemJar = new HashMap<String,
String>();
@@ -123,7 +125,10 @@
}
public static IServer createServerWithRuntime(String serverType, String name) throws
CoreException {
+ if( serverType.equals(IJBossToolingConstants.DEPLOY_ONLY_SERVER))
+ return createDeployOnlyServer();
String loc = TestConstants.getServerHome(serverType);
+ assertNotNull("Runtime location for server type " + serverType + " not
set in test suite", loc);
File locFile = new Path(loc).toFile();
return createServerWithRuntime(serverType, name, locFile);
}
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/CreateRuntimeTwiceTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/CreateRuntimeTwiceTest.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/CreateRuntimeTwiceTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -52,8 +52,8 @@
}
@Test
- private void createRuntimes(String serverTypeId) throws CoreException {
- IServerType type = ServerCore.findServerType(serverTypeId);
+ public void createRuntimes() throws CoreException {
+ IServerType type = ServerCore.findServerType(serverType);
IRuntimeType runtimeType = type.getRuntimeType();
IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new
NullProgressMonitor());
@@ -62,7 +62,7 @@
IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new
NullProgressMonitor());
IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
- assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
+ assertNotSame(savedRuntime.getName(), secondSavedRuntime.getName());
assertNotSame(savedRuntime, secondSavedRuntime);
assertFalse("Why are two different runtimes " + runtimeType.getId() + "
created with the same ID ?!",
savedRuntime.getId().equals(secondSavedRuntime.getId()));
}
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-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/CreateServerCheckDefaultsTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -1,10 +1,14 @@
package org.jboss.tools.as.test.core.parametized.server;
import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.charset.MalformedInputException;
import java.util.Collection;
import junit.framework.TestCase;
+import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.archives.webtools.filesets.Fileset;
@@ -12,9 +16,13 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import
org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory;
+import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7ServerRuntime;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
import org.jboss.tools.as.test.core.internal.utils.ServerCreationTestUtils;
import org.jboss.tools.test.util.JobUtils;
import org.junit.After;
@@ -61,8 +69,14 @@
assertFalse("Server name should not be empty", server.getName() == null ||
"".equals(server.getName()));
assertFalse("Runtime name should not be empty", server.getRuntime().getName()
== null || "".equals(server.getRuntime().getName()));
+ String typeId = server.getServerType().getId();
+ if( typeId.equals(IJBossToolingConstants.DEPLOY_ONLY_SERVER)) {
+ return;
+ }
+
+
IJBossServerRuntime rt = getJBossRuntime(server);
- assertNotNull("Created server does not adapt to IJBossServerRuntime", rt);
+ assertNotNull("Created server of type " + server.getServerType().getId() +
" does not adapt to IJBossServerRuntime", rt);
assertNotNull(rt.getVM());
assertNotNull(rt.getExecutionEnvironment());
@@ -72,6 +86,20 @@
} else {
assertEquals("default", rt.getJBossConfiguration());
}
+
+ ServerExtendedProperties props =
ExtendedServerPropertiesAdapterFactory.getServerExtendedProperties(server);
+ assertNotNull(props);
+ assertTrue(props.verifyServerStructure().isOK());
+ if( props.canVerifyRemoteModuleState())
+ assertNotNull(props.getModuleStateVerifier());
+ if( props.hasWelcomePage()) {
+ String s = props.getWelcomePageUrl();
+ try {
+ URL url = new URL(s);
+ } catch(MalformedURLException murle) {
+ fail(serverType + " has an invalid welcome page url: " +
murle.getMessage());
+ }
+ }
}
@Test
@@ -79,8 +107,13 @@
JobUtils.waitForIdle();
IServer s = server;
XPathCategory[] cats = XPathModel.getDefault().getCategories(s);
+ String typeId = server.getServerType().getId();
+ if( typeId.equals(IJBossToolingConstants.DEPLOY_ONLY_SERVER)) {
+ assertTrue("Deploy-only Servers should have no default xpaths.", cats ==
null || cats.length == 0);
+ return;
+ }
assertFalse("Server has no xpath categories automatically added", cats ==
null || cats.length == 0);
- assertNotNull("Server has no 'ports' xpath category. ",
XPathModel.getDefault().getCategory(s, "Ports"));
+ assertNotNull("Server has no 'ports' xpath category. ",
XPathModel.getDefault().getCategory(s, XPathModel.PORTS_CATEGORY_NAME));
File xpathFile =
JBossServerCorePlugin.getServerStateLocation(s).append(IJBossToolingConstants.XPATH_FILE_NAME).toFile();
try {
assertTrue("The XPath File has not been created. Xpaths will be lost on workspace
restart. " + xpathFile.getAbsolutePath(), xpathFile.exists());
@@ -88,17 +121,40 @@
t.printStackTrace();
throw t;
}
+
+ // Take this chance to test some xpath model
+ // Can maybe be moved out to their own test
+ assertNull(XPathModel.getDefault().getQuery(null, null));
+ assertNull(XPathModel.getDefault().getQuery(s, null));
+ assertNull(XPathModel.getDefault().getQuery(s, new
Path(XPathModel.PORTS_CATEGORY_NAME)));
+ XPathCategory cat = XPathModel.getDefault().getCategory(s,
XPathModel.PORTS_CATEGORY_NAME);
+ XPathQuery[] qs = cat.getQueries();
+ assertFalse(qs == null || qs.length == 0);
+ String name = qs[0].getName();
+ assertNotNull(name);
+ XPathQuery q = XPathModel.getDefault().getQuery(s, new
Path(XPathModel.PORTS_CATEGORY_NAME).append(name));
+ assertNotNull(q);
+ q = XPathModel.getDefault().getQuery(s, new Path("GaRbAgE").append(name));
+ assertNull(q);
+ assertTrue(XPathModel.getDefault().containsCategory(s,
XPathModel.PORTS_CATEGORY_NAME));
+ assertFalse(XPathModel.getDefault().containsCategory(s, "GaRbAgE"));
}
@Test
public void testDefaultFilesetsAdded() {
Fileset[] fs = FilesetUtil.loadFilesets(server);
+ String typeId = server.getServerType().getId();
+ if( typeId.equals(IJBossToolingConstants.DEPLOY_ONLY_SERVER)) {
+ assertTrue("Deploy-only Servers should have no default filesets.",
+ fs == null || fs.length == 0);
+ return;
+ }
+
assertNotNull("No filesets created", fs);
assertTrue("0 filesets added for server " + server.getName(), fs.length >
0);
}
private IJBossServerRuntime getJBossRuntime(IServer s) {
- IRuntime rt = s.getRuntime();
- return (IJBossServerRuntime) rt.loadAdapter(IJBossServerRuntime.class, null);
+ return RuntimeUtils.getJBossServerRuntime(s.getRuntime());
}
}
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ParametizedSuite.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ParametizedSuite.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/ParametizedSuite.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -7,11 +7,11 @@
@RunWith(Suite.class)
@SuiteClasses({
-// ServerHomeTest.class,
-// ServerBeanLoader3Test.class,
-// CreateServerCheckDefaultsTest.class,
-// ProjectRuntimeClasspathTest.class,
-// CreateRuntimeTwiceTest.class,
+ ServerHomeTest.class,
+ ServerBeanLoader3Test.class,
+ CreateServerCheckDefaultsTest.class,
+ ProjectRuntimeClasspathTest.class,
+ CreateRuntimeTwiceTest.class,
PublishingSuite.class
})
public class ParametizedSuite {
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-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractComponentPublishingTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -12,10 +12,21 @@
public class AbstractComponentPublishingTest extends AbstractPublishingTest {
public static Collection<Object[]> componentJarData() {
+ return componentJarData(false);
+ }
+ public static Collection<Object[]> fullComponentJarData() {
+ return componentJarData(true);
+ }
+ public static Collection<Object[]> componentJarData(boolean complete) {
Object[] servers = ServerParameterUtils.getPublishServerTypes();
Object[] zipOption = ServerParameterUtils.getServerZipOptions();
Object[] defaultDeployLoc = ServerParameterUtils.getDefaultDeployOptions();
Object[] perModOverrides = ServerParameterUtils.getPerModuleOverrideOptions();
+ if( !complete ) {
+ // simplify these options
+ defaultDeployLoc = new Object[]{defaultDeployLoc[0]};
+ perModOverrides = new Object[]{perModOverrides[0]};
+ }
Object[] junitName = new String[] { "junit.jar", "otherOut.jar"};
Object[] outFolder = new String[] { "lib", "otherFolder",
"deep/nested", ""};
Object[][] allOptions = new Object[][] {
@@ -24,6 +35,7 @@
};
return MatrixUtils.toMatrix(allOptions);
}
+
protected String jarFolder;
protected String jarName;
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarNestedWarTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarNestedWarTest.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarNestedWarTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -11,6 +11,7 @@
package org.jboss.tools.as.test.core.parametized.server.publishing;
import java.util.ArrayList;
+import java.util.Collection;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
@@ -27,12 +28,17 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
@RunWith(value = Parameterized.class)
public class DeploymentAssemblyArchivePathVarNestedWarTest extends
DeploymentAssemblyArchivePathVarTest {
private static String PROJECT_PREFIX = "qEar";
private static String PROJECT_NESTED_PREFIX = "qWar";
private static int PROJECT_ID = 1;
+ @Parameters
+ public static Collection<Object[]> params() {
+ return componentJarData();
+ }
public DeploymentAssemblyArchivePathVarNestedWarTest(String serverType, String zip,
String deployLoc, String perMod, String refName, String refFolder) {
super(serverType, zip, deployLoc, perMod, refName, refFolder);
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarTest.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -44,7 +44,7 @@
private static int PROJECT_ID = 1;
@Parameters
public static Collection<Object[]> params() {
- return componentJarData();
+ return fullComponentJarData();
}
public DeploymentAssemblyArchivePathVarTest(String serverType, String zip,
String deployLoc, String perMod, String refName, String refFolder) {
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarWarTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarWarTest.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/DeploymentAssemblyArchivePathVarWarTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.as.test.core.parametized.server.publishing;
+import java.util.Collection;
+
import
org.eclipse.wst.common.componentcore.internal.operation.AddReferenceDataModelProvider;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
@@ -17,11 +19,17 @@
import org.jboss.tools.as.test.core.internal.utils.wtp.JavaEEFacetConstants;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
@RunWith(value = Parameterized.class)
public class DeploymentAssemblyArchivePathVarWarTest extends
DeploymentAssemblyArchivePathVarTest {
private static String PROJECT_PREFIX = "pWar";
private static int PROJECT_ID = 1;
+ @Parameters
+ public static Collection<Object[]> params() {
+ return componentJarData();
+ }
+
public DeploymentAssemblyArchivePathVarWarTest(String serverType, String zip,
String deployLoc, String perMod, String refName, String refFolder) {
super(serverType, zip, deployLoc, perMod, refName, refFolder);
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-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/PublishingSuite.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -1,24 +1,25 @@
package org.jboss.tools.as.test.core.parametized.server.publishing;
+import
org.jboss.tools.as.test.core.parametized.server.publishing.defect.RepublishDefectTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
-// DeploymentAssemblyArchivePathVarTest.class,
-// DeploymentAssemblyArchivePathVarWarTest.class,
-// DeploymentAssemblyArchivePathVarNestedWarTest.class,
-// DeploymentAssemblyExternalArchiveVarTest.class,
-// DeploymentAssemblyExternalArchiveVarWarTest.class,
-// DeploymentAssemblyExternalArchiveVarNestedWarTest.class,
-// DeploymentAssemblyWorkspaceArchiveVarTest.class,
-// DeploymentAssemblyWorkspaceArchiveVarWarTest.class,
-// DeploymentAssemblyWorkspaceArchiveVarNestedWarTest.class,
+ DeploymentAssemblyArchivePathVarTest.class,
+ DeploymentAssemblyArchivePathVarWarTest.class,
+ DeploymentAssemblyArchivePathVarNestedWarTest.class,
+ DeploymentAssemblyExternalArchiveVarTest.class,
+ DeploymentAssemblyExternalArchiveVarWarTest.class,
+ DeploymentAssemblyExternalArchiveVarNestedWarTest.class,
+ DeploymentAssemblyWorkspaceArchiveVarTest.class,
+ DeploymentAssemblyWorkspaceArchiveVarWarTest.class,
+ DeploymentAssemblyWorkspaceArchiveVarNestedWarTest.class,
DeploymentAssemblyFilesetReferenceTest.class,
-// RepublishDefectTest.class,
-// SingleDeployableFileTest.class,
-// SingleDeployableFolderTest.class
+ RepublishDefectTest.class,
+ SingleDeployableFileTest.class,
+ SingleDeployableFolderTest.class
})
public class PublishingSuite {
}
Modified:
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/utiltests/ExpressionResolverUtilTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/utiltests/ExpressionResolverUtilTest.java 2012-07-27
05:31:58 UTC (rev 42750)
+++
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/utiltests/ExpressionResolverUtilTest.java 2012-07-27
08:56:30 UTC (rev 42751)
@@ -1,20 +1,30 @@
package org.jboss.tools.as.test.core.utiltests;
+import junit.framework.TestCase;
+
import org.jboss.ide.eclipse.as.core.util.ExpressionResolverUtil;
+import org.junit.Test;
-import junit.framework.TestCase;
-
public class ExpressionResolverUtilTest extends TestCase {
+ @Test
public void testExpressionResolver() {
- assertEquals("aaa",
ExpressionResolverUtil.safeReplaceProperties("aaa"));
- assertEquals("t9",
ExpressionResolverUtil.safeReplaceProperties("t${something:9}"));
- assertEquals("t9a",
ExpressionResolverUtil.safeReplaceProperties("t${something:9}a"));
+ assertEquals("aaa", re("aaa"));
+ assertEquals("t9", re("t${something:9}"));
+ assertEquals("t9a", re("t${something:9}a"));
// NO recursive checking
- assertEquals("5:notfound}",
ExpressionResolverUtil.safeReplaceProperties("${twoPoint${someNumber:5}:notfound}"));
+ assertEquals("5:notfound}",
re("${twoPoint${someNumber:5}:notfound}"));
// unresolvable, so no change
- assertEquals("t${something}",
ExpressionResolverUtil.safeReplaceProperties("t${something}"));
- assertEquals("t${something}a",
ExpressionResolverUtil.safeReplaceProperties("t${something}a"));
+ assertEquals("t${something}", re("t${something}"));
+ assertEquals("t${something}a", re("t${something}a"));
+ assertEquals("t$ablah", re("t$ablah"));
+
+ // custom handling
+ assertEquals("t$stuff", re("t$$stuff"));
}
+
+ private String re(String s) {
+ return ExpressionResolverUtil.safeReplaceProperties(s);
+ }
}