JBoss Tools SVN: r39160 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test: server and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-28 02:21:49 -0500 (Tue, 28 Feb 2012)
New Revision: 39160
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
Log:
Provide a superclass for tests that require one test for every server type
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java 2012-02-28 06:59:09 UTC (rev 39159)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java 2012-02-28 07:21:49 UTC (rev 39160)
@@ -1,21 +1,13 @@
package org.jboss.ide.eclipse.as.test.publishing.v2;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.server.SimpleServerImplTest;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
-public class BehaviourModelDefectTest extends TestCase {
- public void tearDown() {
- try {
- ServerRuntimeUtils.deleteAllServers();
- ServerRuntimeUtils.deleteAllRuntimes();
- } catch(CoreException ce) {}
- }
+public class BehaviourModelDefectTest extends SimpleServerImplTest {
public void serverTestImpl(String type) {
IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
@@ -47,39 +39,4 @@
assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local").createPublishMethod());
assertNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local").createLaunchDelegate());
}
-
- public void test32BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
- }
- public void test40BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
- }
- public void test42BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
- }
- public void test50BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- }
- public void test51BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
- }
- public void test60BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
- }
- public void test70BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_70);
- }
- public void test71BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_71);
- }
- public void testEap43BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
- }
- public void testEap50BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
- }
- public void testEap60BehaviourModel() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
- }
-
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-28 06:59:09 UTC (rev 39159)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-28 07:21:49 UTC (rev 39160)
@@ -27,19 +27,9 @@
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
-public class MockArgsTests extends TestCase {
- public void setUp() {
- }
- public void tearDown() {
- try {
- ServerRuntimeUtils.deleteAllServers();
- ServerRuntimeUtils.deleteAllRuntimes();
- } catch(CoreException ce) {}
- }
-
-
+public class MockArgsTests extends SimpleServerImplTest {
public void testRemoveCriticalVMArgs() {
- IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ IServer server = serverTestImpl2(IJBossToolingConstants.SERVER_AS_50);
try {
ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
@@ -63,7 +53,7 @@
public void testChangeArgs() {
// should still match the defaults since the defaults are extremely all required
- IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ IServer server = serverTestImpl2(IJBossToolingConstants.SERVER_AS_50);
try {
ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
@@ -79,7 +69,11 @@
}
}
- protected IServer serverTestImpl(String type) {
+ protected void serverTestImpl(String type) {
+ serverTestImpl2(type);
+ }
+
+ protected IServer serverTestImpl2(String type) {
IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
IServer fixed = setMockDetails(server);
String command = runAndGetCommand(fixed);
@@ -129,35 +123,4 @@
}
return null;
}
-
- public void test32Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
- }
-
- public void test40Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
- }
-
- public void test42Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
- }
-
- public void test50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- }
- public void test51Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
- }
- public void test60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
- }
- public void testEap43Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
- }
- public void testEap50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
- }
- public void testEap60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
- }
}
13 years, 2 months
JBoss Tools SVN: r39159 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-28 01:59:09 -0500 (Tue, 28 Feb 2012)
New Revision: 39159
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/SimpleServerImplTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StringSubstitutionTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.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/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
JBIDE-11058 - config file change to standalone-ha does not work for ports and xpaths
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2012-02-28 06:59:09 UTC (rev 39159)
@@ -34,6 +34,7 @@
org.jboss.ide.eclipse.as.core.modules,
org.jboss.ide.eclipse.as.core.publishers,
org.jboss.ide.eclipse.as.core.publishers.patterns,
+ org.jboss.ide.eclipse.as.core.resolvers,
org.jboss.ide.eclipse.as.core.server,
org.jboss.ide.eclipse.as.core.server.bean,
org.jboss.ide.eclipse.as.core.server.internal,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -29,6 +29,7 @@
import org.jaxen.dom4j.Dom4jXPath;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver;
import org.jboss.ide.eclipse.as.core.util.IMemento;
/**
@@ -46,6 +47,7 @@
protected String baseDir;
protected volatile String effectiveBaseDir;
protected String filePattern;
+ protected volatile String effectiveFilePattern;
protected String xpathPattern;
protected String attribute;
@@ -70,6 +72,7 @@
this.xpathPattern = memento.getString("xpathPattern"); //$NON-NLS-1$
this.attribute = memento.getString("attribute"); //$NON-NLS-1$
setEffectiveBaseDir();
+ setEffectiveFilePattern();
}
public XPathQuery(String name, List list) {
@@ -79,6 +82,7 @@
this.xpathPattern = list.get(2).equals(XPathModel.EMPTY_STRING) ? null : (String)list.get(2);
this.attribute = list.size() < 3 || list.get(3).equals(XPathModel.EMPTY_STRING) ? null : (String)list.get(3);
setEffectiveBaseDir();
+ setEffectiveFilePattern();
}
public XPathQuery(IServer server, String name, String baseDir,
@@ -91,42 +95,33 @@
this.attribute = attribute;
this.results = null;
setEffectiveBaseDir();
+ setEffectiveFilePattern();
}
private void setEffectiveBaseDir() {
String serverName = server == null ? "" : server.getName(); //$NON-NLS-1$
String dir1 = baseDir == null ? null : baseDir;
-
- String dir2 = null;
- if( dir1 != null ) {
- dir2 = dir1.replace("${jboss_config_dir}", //$NON-NLS-1$
- "${jboss_config_dir:" + serverName + "}"); //$NON-NLS-1$ //$NON-NLS-2$
- dir2 = dir2.replace("${jboss_config}", //$NON-NLS-1$
- "${jboss_config:" + serverName + "}"); //$NON-NLS-1$ //$NON-NLS-2$
-
- try {
- StringSubstitutionEngine engine = new StringSubstitutionEngine();
- dir2 = engine.performStringSubstitution(dir2, true,
- true, StringVariableManager.getDefault());
- } catch( CoreException ce ) {
- JBossServerCorePlugin.log(ce.getStatus());
- }
- }
-
-
+ String dir2 = new ConfigNameResolver().performSubstitutions(dir1, serverName);
IPath dir = dir2 == null ? null : new Path(dir2);
if( dir == null && category != null) {
dir = getCategory().getServer().getRuntime().getLocation();
}
if( dir != null && !dir.isAbsolute() && category != null)
dir = getCategory().getServer().getRuntime().getLocation().append(dir);
-
effectiveBaseDir = dir == null ? null : dir.toString();
}
+ private void setEffectiveFilePattern() {
+ String serverName = server == null ? "" : server.getName(); //$NON-NLS-1$
+ String pattern = filePattern == null ? null : filePattern;
+ String pattern2 = new ConfigNameResolver().performSubstitutions(pattern, serverName);
+ effectiveFilePattern = pattern2;
+ }
+
+
protected AntFileFilter getFilter() {
if( filter == null ) {
- filter = new AntFileFilter(effectiveBaseDir, filePattern);
+ filter = new AntFileFilter(effectiveBaseDir, effectiveFilePattern);
}
return filter;
}
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-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -11,6 +11,8 @@
package org.jboss.ide.eclipse.as.core.resolvers;
+import org.eclipse.core.internal.variables.StringSubstitutionEngine;
+import org.eclipse.core.internal.variables.StringVariableManager;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.variables.IDynamicVariable;
@@ -18,31 +20,83 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7ServerRuntime;
/**
* These classes are primarily geared for as6-and-below
* and are meant to serve as a dereferencing point to discover
* the configuration name and it's parent directory in the case
* other portions of the tool, such as xpaths or classpaths,
* want to use these variables in their saved strings.
- *
- * They are not really geared for use with as7 and above, and their
- * behaviour with regards to as7 and above are officially undefined,
- * though unofficially both should return the empty string in these cases
- * @author rob
- *
*/
public class ConfigNameResolver implements IDynamicVariableResolver {
+ 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_as7_config_file"; //$NON-NLS-1$
+
+ /*
+ * entry points to fill out the server name in these variable substitutions
+ */
+
+ /**
+ * Kick off the substitution engine for this string, doing
+ * server-related replacements (adding variables) beforehand.
+ *
+ * @param dir1
+ * @param serverName
+ * @return
+ */
+ public String performSubstitutions(String dir1, String serverName) {
+ String dir2 = null;
+ if( dir1 != null ) {
+ dir2 = replace(dir1, ConfigNameResolver.JBOSS_CONFIG, serverName);
+ dir2 = replace(dir2, ConfigNameResolver.JBOSS_CONFIG_DIR, serverName);
+ dir2 = replace(dir2, ConfigNameResolver.JBOSS_AS7_CONFIG_FILE, serverName);
+
+ try {
+ StringSubstitutionEngine engine = new StringSubstitutionEngine();
+ dir2 = engine.performStringSubstitution(dir2, true,
+ true, StringVariableManager.getDefault());
+ } catch( CoreException ce ) {
+ JBossServerCorePlugin.log(ce.getStatus());
+ }
+ }
+ return dir2;
+ }
+
+ private String replace(String original, String variable, String serverName) {
+ if( original != null ) {
+ return original.replace(getVariablePattern(variable), getVariablePattern(variable, serverName));
+ }
+ return null;
+ }
+
+ private String getVariablePattern(String var) {
+ return "${" + var + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private String getVariablePattern(String var, String serverName) {
+ return "${" + var + ":" + serverName + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+
+ /*
+ * Actual resolution of these dynamic variables are performed below
+ */
+
public String resolveValue(IDynamicVariable variable, String argument)
throws CoreException {
- if( variable.getName().equals("jboss_config")) //$NON-NLS-1$
+ if( variable.getName().equals(JBOSS_CONFIG))
return handleConfig(variable, argument);
- if( variable.getName().equals("jboss_config_dir")) //$NON-NLS-1$
+ if( variable.getName().equals(JBOSS_CONFIG_DIR))
return handleConfigDir(variable, argument);
+ if( variable.getName().equals(JBOSS_AS7_CONFIG_FILE))
+ return handleAS7ConfigFile(variable, argument);
return null;
}
-
+
protected String handleConfig(IDynamicVariable variable, String argument) {
IJBossServerRuntime ajbsrt = findJBossServerRuntime(argument);
if( ajbsrt != null ) {
@@ -66,6 +120,14 @@
return null;
}
+ protected String handleAS7ConfigFile(IDynamicVariable variable, String argument) {
+ IJBossServerRuntime ajbsrt = findJBossServerRuntime(argument);
+ if( ajbsrt != null && ajbsrt instanceof LocalJBoss7ServerRuntime) {
+ return ((LocalJBoss7ServerRuntime)ajbsrt).getConfigurationFile();
+ }
+ return null;
+ }
+
private IJBossServerRuntime findJBossServerRuntime(String serverName) {
IServer[] servers = ServerCore.getServers();
for( int i = 0; i < servers.length; i++ ) {
@@ -82,7 +144,6 @@
}
}
return null;
-
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-02-28 06:59:09 UTC (rev 39159)
@@ -1123,6 +1123,12 @@
resolver="org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver"
supportsArgument="true">
</variable>
+ <variable
+ name="jboss_as7_config_file"
+ description="Returns the full path of the configuration file for the server who's name matches the variable, or, if none, the runtime who's name matches the variable"
+ resolver="org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver"
+ supportsArgument="true">
+ </variable>
</extension>
<extension
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.70.default.ports.properties 2012-02-28 06:59:09 UTC (rev 39159)
@@ -3,4 +3,4 @@
JBoss_Web_ATTRIBUTE=port
JBoss_Management=//*[local-name()="management-interfaces"]/*[local-name()="native-interface"]
JBoss_Management_ATTRIBUTE=port
-JBoss_Management_FILE=standalone/configuration/standalone.xml
\ No newline at end of file
+JBoss_Management_FILE=standalone/configuration/${jboss_as7_config_file}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/properties/jboss.71.default.ports.properties 2012-02-28 06:59:09 UTC (rev 39159)
@@ -3,4 +3,4 @@
JBoss_Web_ATTRIBUTE=port
JBoss_Management=//*[local-name()="socket-binding-group"]/*[local-name()="socket-binding"][@name="management-native"]
JBoss_Management_ATTRIBUTE=port
-JBoss_Management_FILE=standalone/configuration/standalone.xml
\ No newline at end of file
+JBoss_Management_FILE=standalone/configuration/${jboss_as7_config_file}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -67,6 +67,7 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
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.resolvers.ConfigNameResolver;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -372,27 +373,23 @@
final String xpText = xpathText.getText();
final String attText = attributeText.getText();
- final String filePattern = filesetText.getText();
+ String filePattern = filesetText.getText();
String directory = baseDirText.getText();
- directory = directory.replace("${jboss_config_dir}", //$NON-NLS-1$
- "${jboss_config_dir:" + server.getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
- directory = directory.replace("${jboss_config}", //$NON-NLS-1$
- "${jboss_config:" + server.getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
- try {
- StringSubstitutionEngine engine = new StringSubstitutionEngine();
- directory = engine.performStringSubstitution(directory, true,
- true, StringVariableManager.getDefault());
- } catch( CoreException ce ) {
- //use the non-substituted string instead
- }
+
+ // substitute in basedir
+ directory = new ConfigNameResolver().performSubstitutions(directory, server.getName());
if( !new Path(directory).isAbsolute()) {
directory = server.getRuntime().getLocation().append(directory).toString();
}
-
final String directory2 = directory;
+
+ // substitute in filePattern
+ filePattern = new ConfigNameResolver().performSubstitutions(filePattern, server.getName());
+ final String filePattern2 = filePattern;
+
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- XPathQuery tmp = new XPathQuery(null, "", directory2, filePattern, xpText, attText); //$NON-NLS-1$
+ XPathQuery tmp = new XPathQuery(null, "", directory2, filePattern2, xpText, attText); //$NON-NLS-1$
tmp.setRepository(repository);
final ArrayList<XPathFileResult> list = new ArrayList<XPathFileResult>();
list.addAll(Arrays.asList(tmp.getResults()));
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -46,7 +46,7 @@
import org.jboss.ide.eclipse.as.test.publishing.v2.SingleFileDeploymentTester;
import org.jboss.ide.eclipse.as.test.server.JBossServerAPITest;
import org.jboss.ide.eclipse.as.test.server.ServerBeanLoaderTest;
-import org.jboss.ide.eclipse.as.test.server.ServerSecureStorageTest;
+import org.jboss.ide.eclipse.as.test.server.StringSubstitutionTest;
import org.jboss.ide.eclipse.as.test.server.XPathModelTest;
import org.jboss.ide.eclipse.as.test.util.ArgsUtilTest;
import org.jboss.ide.eclipse.as.test.util.ExpressionResolverUtilTest;
@@ -60,6 +60,7 @@
suite.addTestSuite(PreReqTest.class);
suite.addTestSuite(ServerBeanLoaderTest.class);
+
// Cannot find a way to run this test and pre-load the credentials for the keystore
//suite.addTestSuite(ServerSecureStorageTest.class);
suite.addTestSuite(RuntimeServerModelTest.class);
@@ -68,6 +69,7 @@
suite.addTestSuite(JSTDeploymentWarUpdateXML.class);
suite.addTestSuite(SingleFileDeployableMockDeploymentTester.class);
suite.addTestSuite(XPathModelTest.class);
+ suite.addTestSuite(StringSubstitutionTest.class);
// Publishing tests
suite.addTestSuite(BehaviourModelDefectTest.class);
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/SimpleServerImplTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/SimpleServerImplTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/SimpleServerImplTest.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -0,0 +1,63 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import junit.framework.TestCase;
+
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+
+/**
+ * Superclass for testing simple bits of functionality for each
+ * and every server type
+ *
+ * @author rob
+ *
+ */
+
+public abstract class SimpleServerImplTest extends TestCase {
+
+ protected abstract void serverTestImpl(String type);
+
+ public void tearDown() {
+ try {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ ASTest.clearStateLocation();
+ } catch(Exception ce ) {
+ // ignore
+ }
+ }
+
+ public void test32Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
+ }
+
+ public void test40Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
+ }
+
+ public void test42Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
+ }
+
+ public void test50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ }
+ public void test51Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
+ }
+ public void test60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
+ }
+ public void testEap43Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
+ }
+ public void testEap50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
+ }
+ public void testEap60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
+ }
+}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StringSubstitutionTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StringSubstitutionTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/StringSubstitutionTest.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -0,0 +1,39 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver;
+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.test.util.ServerRuntimeUtils;
+
+
+public class StringSubstitutionTest extends TestCase /* SimpleServerImplTest */ {
+
+ public void testAS7ConfigFileReplacement() throws CoreException {
+ IServer server = ServerRuntimeUtils.createMockServerWithRuntime(IJBossToolingConstants.SERVER_AS_70, "server1", "default");
+ IRuntime rt = server.getRuntime();
+
+ String ret = new ConfigNameResolver().performSubstitutions("some/path", server.getName());
+ assertEquals("some/path", ret);
+ ret = new ConfigNameResolver().performSubstitutions("some/path/${jboss_as7_config_file}" , server.getName());
+ assertEquals("some/path/standalone.xml", ret);
+
+ IRuntimeWorkingCopy rtwc = rt.createWorkingCopy();
+ LocalJBoss7ServerRuntime rtwc7 = (LocalJBoss7ServerRuntime)rtwc.loadAdapter(LocalJBoss7ServerRuntime.class, new NullProgressMonitor());
+ rtwc7.setConfigurationFile("someFile.xml");
+ rtwc.save(false, new NullProgressMonitor());
+ ret = new ConfigNameResolver().performSubstitutions("some/path/${jboss_as7_config_file}" , server.getName());
+ assertEquals("some/path/someFile.xml", ret);
+ }
+
+// protected void serverTestImpl(String type) {
+// // TODO how to handle this check for every server type? Not needed right now
+// }
+
+}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -2,9 +2,6 @@
import java.io.File;
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -13,7 +10,7 @@
import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
import org.jboss.tools.test.util.JobUtils;
-public class XPathModelTest extends TestCase {
+public class XPathModelTest extends SimpleServerImplTest {
static {
JobUtils.waitForIdle(5000);
@@ -23,17 +20,6 @@
JobUtils.waitForIdle();
}
- public void tearDown() {
- try {
- ServerRuntimeUtils.deleteAllServers();
- ServerRuntimeUtils.deleteAllRuntimes();
- ProjectUtility.deleteAllProjects();
- ASTest.clearStateLocation();
- } catch(Exception ce ) {
- // ignore
- }
- }
-
protected void serverTestImpl(String type) {
IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
File xpathFile = JBossServerCorePlugin.getServerStateLocation(server).append(IJBossToolingConstants.XPATH_FILE_NAME).toFile();
@@ -44,35 +30,5 @@
if( !xpathFile.exists())
fail("The XPath File has not been created. Xpaths will be lost on workspace restart");
}
- public void test32Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
- }
-
- public void test40Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
- }
-
- public void test42Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
- }
- public void test50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- }
- public void test51Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
- }
- public void test60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
- }
- public void testEap43Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
- }
- public void testEap50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
- }
- public void testEap60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
- }
-
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-02-28 04:06:02 UTC (rev 39158)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-02-28 06:59:09 UTC (rev 39159)
@@ -38,6 +38,7 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.IServer.IOperationListener;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
@@ -51,6 +52,7 @@
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerCreationUtils;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.test.ASTest;
import org.jboss.ide.eclipse.as.test.publishing.AbstractDeploymentTest;
import org.osgi.framework.Bundle;
@@ -159,9 +161,9 @@
public static IServer createMockServerWithRuntime(String serverType, String name, String config) {
try {
- if( serverType.equals(IJBossToolingConstants.SERVER_AS_70))
+ IServerType type = ServerCore.findServerType(serverType);
+ if( ServerUtil.isJBoss7(type))
return createMockJBoss7Server();
-
IPath serverDir = createAS6AndBelowMockServerDirectory(name, asSystemJar.get(serverType), config);
return createServer(serverRuntimeMap.get(serverType), serverType, serverDir.toOSString(), config);
} catch( CoreException ce ) {
13 years, 2 months
JBoss Tools SVN: r39158 - in trunk/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-27 23:06:02 -0500 (Mon, 27 Feb 2012)
New Revision: 39158
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
Stupid stupid regression due to fixing error logging. Added a test case to prevent this in the future
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2012-02-28 02:33:01 UTC (rev 39157)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2012-02-28 04:06:02 UTC (rev 39158)
@@ -177,12 +177,10 @@
saveCategory(categories[i], server, child);
}
File f = getFile(server);
- if( f != null && f.exists()) {
- try {
- memento.save(new FileOutputStream(f));
- } catch( IOException ioe) {
- JBossServerCorePlugin.log(ioe);
- }
+ try {
+ memento.save(new FileOutputStream(f));
+ } catch( IOException ioe) {
+ JBossServerCorePlugin.log("The XPath Model could not be saved", ioe); //$NON-NLS-1$
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-02-28 02:33:01 UTC (rev 39157)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-02-28 04:06:02 UTC (rev 39158)
@@ -47,6 +47,7 @@
import org.jboss.ide.eclipse.as.test.server.JBossServerAPITest;
import org.jboss.ide.eclipse.as.test.server.ServerBeanLoaderTest;
import org.jboss.ide.eclipse.as.test.server.ServerSecureStorageTest;
+import org.jboss.ide.eclipse.as.test.server.XPathModelTest;
import org.jboss.ide.eclipse.as.test.util.ArgsUtilTest;
import org.jboss.ide.eclipse.as.test.util.ExpressionResolverUtilTest;
@@ -58,6 +59,7 @@
suite.addTestSuite(ExpressionResolverUtilTest.class);
suite.addTestSuite(PreReqTest.class);
suite.addTestSuite(ServerBeanLoaderTest.class);
+
// Cannot find a way to run this test and pre-load the credentials for the keystore
//suite.addTestSuite(ServerSecureStorageTest.class);
suite.addTestSuite(RuntimeServerModelTest.class);
@@ -65,6 +67,7 @@
suite.addTestSuite(ProjectRuntimeTest.class);
suite.addTestSuite(JSTDeploymentWarUpdateXML.class);
suite.addTestSuite(SingleFileDeployableMockDeploymentTester.class);
+ suite.addTestSuite(XPathModelTest.class);
// Publishing tests
suite.addTestSuite(BehaviourModelDefectTest.class);
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/XPathModelTest.java 2012-02-28 04:06:02 UTC (rev 39158)
@@ -0,0 +1,78 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+import org.jboss.tools.test.util.JobUtils;
+
+public class XPathModelTest extends TestCase {
+
+ static {
+ JobUtils.waitForIdle(5000);
+ }
+
+ public void setUp() {
+ JobUtils.waitForIdle();
+ }
+
+ public void tearDown() {
+ try {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ ASTest.clearStateLocation();
+ } catch(Exception ce ) {
+ // ignore
+ }
+ }
+
+ protected void serverTestImpl(String type) {
+ IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
+ File xpathFile = JBossServerCorePlugin.getServerStateLocation(server).append(IJBossToolingConstants.XPATH_FILE_NAME).toFile();
+ JobUtils.waitForIdle(500);
+ System.out.println(xpathFile.exists());
+
+ System.out.println(xpathFile.exists());
+ if( !xpathFile.exists())
+ fail("The XPath File has not been created. Xpaths will be lost on workspace restart");
+ }
+ public void test32Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
+ }
+
+ public void test40Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
+ }
+
+ public void test42Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
+ }
+
+ public void test50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ }
+ public void test51Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
+ }
+ public void test60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
+ }
+ public void testEap43Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
+ }
+ public void testEap50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
+ }
+ public void testEap60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
+ }
+
+}
13 years, 2 months
JBoss Tools SVN: r39157 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-27 21:33:01 -0500 (Mon, 27 Feb 2012)
New Revision: 39157
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java
Log:
JBIDE-11066
https://issues.jboss.org/browse/JBIDE-11066
Prevented loading of entities from internet.
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java 2012-02-28 02:32:24 UTC (rev 39156)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLEntityResolver.java 2012-02-28 02:33:01 UTC (rev 39157)
@@ -10,6 +10,7 @@
import java.util.Properties;
import org.eclipse.core.runtime.FileLocator;
+import org.jboss.tools.common.CommonPlugin;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -96,10 +97,16 @@
}
}
- if(deactivate && (systemId != null) && (source == null) && (systemId.toLowerCase().endsWith(".dtd"))) { // this deactivates DTD //$NON-NLS-1$
+ if(deactivate && (systemId != null) && (source == null)
+ // this deactivates DTD for .dtd and .ent resources
+ && (systemId.toLowerCase().endsWith(".dtd") || systemId.toLowerCase().endsWith(".ent"))
+ ) { //$NON-NLS-1$ //$NON-NLS-2$
source = new InputSource(new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes())); //$NON-NLS-1$
}
-
+ if(source == null) {
+ CommonPlugin.getDefault().logError("WARNING: Cannot resolve entity " + systemId); //$NON-NLS-1$
+ }
+ // TODO study if we can always return non-null value.
return source;
}
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java 2012-02-28 02:32:24 UTC (rev 39156)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java 2012-02-28 02:33:01 UTC (rev 39157)
@@ -155,7 +155,8 @@
public static EntityResolver createEmptyEntityResolver() {
return new EntityResolver() {
public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException, java.io.IOException {
- if((systemId != null) && systemId.toLowerCase().endsWith(".dtd")) { // this deactivates DTD //$NON-NLS-1$
+ if((systemId != null) &&
+ (systemId.toLowerCase().endsWith(".dtd") || systemId.toLowerCase().endsWith(".ent"))) { // this deactivates DTD //$NON-NLS-1$ //$NON-NLS-2$
return new InputSource(new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes())); //$NON-NLS-1$
} else {
return null;
13 years, 2 months
JBoss Tools SVN: r39156 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-27 21:32:24 -0500 (Mon, 27 Feb 2012)
New Revision: 39156
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java
Log:
JBIDE-11066
https://issues.jboss.org/browse/JBIDE-10787
Prevented loading of entities from internet.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2012-02-27 17:51:23 UTC (rev 39155)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2012-02-28 02:32:24 UTC (rev 39156)
@@ -13,7 +13,6 @@
import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.model.markers.ResourceMarkers;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.RecognizedFileImpl;
@@ -54,7 +53,12 @@
}
protected final void setErrors(String body, boolean checkDTD, boolean checkSchema) {
- String[] errors = (body.length() == 0) ? null : XMLUtil.getXMLErrors(new java.io.StringReader(body), checkDTD, checkSchema);
+ String[] errors = (body.length() == 0) ? null
+ //do not compute errors for unrecognized files.
+ : "FileXML".equals(getModelEntity().getName()) ? null //$NON-NLS-1$
+ //do not compute errors for files in jars
+ : (getParent() instanceof JarFolderImpl) ? null
+ : XMLUtil.getXMLErrors(new java.io.StringReader(body), checkDTD, checkSchema);
if(errors == null || errors.length == 0) {
if(loaderError != null) errors = new String[]{loaderError};
}
@@ -85,7 +89,7 @@
// but use similar format to mention io exception.
// ModelPlugin.getPluginLog().logError(e);
}
- String ep = MessageFormat.format("ERROR: {0} {1}", FindObjectHelper.makeRef(getPath() + ":" + ln1, ln + ":" + pos), er); //$NON-NLS-2$ //$NON-NLS-3$
+ String ep = MessageFormat.format("ERROR: {0} {1}", FindObjectHelper.makeRef(getPath() + ":" + ln1, ln + ":" + pos), er); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(iln < 0) markers.lines.remove(ep);
else markers.lines.put(ep, Integer.valueOf(iln));
sb.append(ep).append('\n');
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java 2012-02-27 17:51:23 UTC (rev 39155)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileXMLImpl.java 2012-02-28 02:32:24 UTC (rev 39156)
@@ -31,7 +31,8 @@
if(name.equals("_hasErrors_")) { //$NON-NLS-1$
return super.get(XModelObjectConstants.ATTR_NAME_IS_INCORRECT);
}
- if(!markersReset && isActive()) {
+ if(!markersReset && isActive()
+ && !"NAME".equals(name) && !"EXTENSION".equals(name) && !"overlapped".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
updateMarkers(super.get(XModelObjectConstants.ATTR_NAME_BODY));
}
return super.get(name);
13 years, 2 months
JBoss Tools SVN: r39155 - trunk/documentation/whatsnew/openshift.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-27 12:51:23 -0500 (Mon, 27 Feb 2012)
New Revision: 39155
Modified:
trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html
Log:
[JBIDE-11031] creating N&N for openshift (not finished yet)
Modified: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html 2012-02-27 17:48:23 UTC (rev 39154)
+++ trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html 2012-02-27 17:51:23 UTC (rev 39155)
@@ -100,202 +100,6 @@
</p>
</td>
</tr>
- <tr>
- <td colspan="2">
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><a name="itemname3"
- id="itemname3"></a><b>Tail files/logs</b></td>
- <td valign="top">
- <p>
- You can now tail the live logs from the remote JBossAS7 instance
- running on OpenShift right into your Eclipse Console view. This
- feature is available from the <b>"Show In>Remote Console"</b>
- contextual menu item of the Server Adapter associated with your
- OpenShift Application.
- </p>
- <p>
- <image src="images/show-in-remote-console.png" alt="Show In Remote Console" />
- </p>
- <p>
- This works in the same manner as the '<b>rhc-tail-files</b>'
- command line tool, which means that the underlying action issues a
- single 'ssh tail' command on the remote VM, and thus may prompt
- you for the passphrase associated with your OpenShift SSH Key if
- it was not previously loaded during the Eclipse session.
- </p>
- <p>Both the 'boot.log' and 'server.log' will be shown in the
- console, including their 100 previous lines.</p>
- <p>
- <img src="images/remote-console.png" alt="Remote Console" />
- </p>
- <p>You can stop the 'ssh tail' command from the console by
- clicking on the 'Close Console' button.</p>
- <p>
- <small><a
- href="https://issues.jboss.org/browse/JBIDE-10152">Related
- Jira</a></small>
- </p>
-
-
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <hr />
- <h3>OpenShift Express Application Wizard</h3>
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Use
- Existing Projects</b></td>
- <td valign="top">
- <p>The OpenShift Express Application wizard previously only
- allowed you to import the existing application installed to
- OpenShift into your workspace.</p>
- <p>It was then up to you to merge the demo with your own
- application and push things to the OpenShift PaaS. Our tooling did
- not assist you in that case.</p>
- <p>
- M5 we now support to setup your own application directly for
- deployment to OpenShift. Just uncheck <b>"Create New Project"</b>
- and choose an existing project from your workspace, that you want
- to publish to OpenShift. The wizard will then copy OpenShift
- configurations and enable git on the project. You'll then be able
- to push it to OpenShift via git or let the OpenShift Server Adapter
- do that job for you.
- </p>
-
- <p>
- <img src="images/push-existing-project.png"
- alt="push existing project" />
- </p>
- <p>
- <small><a
- href="https://issues.jboss.org/browse/JBIDE-10171">Related
- Jira</a></small>
- </p>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <hr />
- <h3>Cartridges</h3>
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Embed
- Cartridges</b></td>
- <td valign="top">You can now manage cartridges for your
- OpenShift applition directly from JBoss Tools. Cartridges add
- capabilities to your application. A typical usecase is to add a
- mysql database. You allow your application to use a mysql database
- by embedding the mysql cartridge to it. The OpenShift Express
- Application wizard will list all available cartridges and allow you
- to add/remove cartridges at will.
- <p>
- <img src="images/embed-cartridge.png" alt="embed cartridge" />
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Embed
- Jenkins</b></td>
- <td valign="top">OpenShift now has support for Jenkins, turning
- OpenShift into an Continous Integration server. Anytime you push
- changes to OpenShift, a jenkins CI server will build your
- application. The OpenShift Express Application wizard allows you to
- embed the jenkins client. It will verify behind the scenes that you
- already have a jenkins application and prompt you to create one if
- you haven't yet.
-
- <p>
- <img src="images/create-jenkins.png" alt="create jenkins" />
- </p> Credentials and url of your new jenkins instance will get reported
- to you - keep those for future reference.
- <p>
- <img src="images/jenkins-creation-log.png"
- alt="jenkins creation log" />
- </p>
- <p>
- <small><a href="https://issues.jboss.org/browse/JBIDE-9927">Related
- Jira</a></small>
- </p>
- </td>
- </tr>
-
-
-
- <tr>
- <td colspan="2">
- <hr />
- <h3>Maven pom.xml editor</h3>
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>New
- OpenShift Express profile template</b></td>
- <td valign="top">If you want to deploy your Web application to
- OpenShift Express, you will need to define an <strong><i>openshift</i></strong>
- maven profile. It basically configures the maven build to generate a
- ROOT.war archive in the deployments folder of your project.
- <p>
- In the pom.xml editor, create a <profiles> section if it
- doesn't exist and press <strong>CTRL+<space></strong> to
- trigger auto-completion, an OpenShift Express Maven profile
- template is now available :
- </p>
- <p></p> <img src="images/openshift-profile.png"
- alt="new OpenShift Express maven profile template" />
- </p> Press enter to select and insert the <strong><i>openshift</i></strong>
- profile in your pom.xml.
- <p>
- <small><a
- href="https://issues.jboss.org/browse/JBIDE-10354">Related
- Jira</a></small>
- </p>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <hr />
- <h3>OpenShift Express REST client</h3>
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>REST
- Client</b></td>
- <td valign="top">We developed a client for the OpenShift Express
- REST service in M4. It offers most features that are currently
- available in the rhc-* command line tools (create/rename a domain,
- create/destroy applications, list all existing applications,
- available cartridges, read the application log, embed cartridges
- etc.). <br /> We moved it to github and joined forces with the
- OpenShift team. The official client is now maintained at <a
- href="https://github.com/bdecoste/openshift-java-client">https://github.com/bdecoste/openshift-java-client</a>
- <p>
- <small><a
- href="https://issues.jboss.org/browse/JBIDE-10068">Related
- Jira</a>, <a href="https://issues.jboss.org/browse/JBIDE-10455">Related
- Jira</a></small>
- </p>
- </td>
- </tr>
-
</table>
</body>
13 years, 2 months
JBoss Tools SVN: r39154 - in trunk/documentation/whatsnew/openshift: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-27 12:48:23 -0500 (Mon, 27 Feb 2012)
New Revision: 39154
Added:
trunk/documentation/whatsnew/openshift/images/console-create-a-server-adapter.png
trunk/documentation/whatsnew/openshift/images/openshift-console-2.png
trunk/documentation/whatsnew/openshift/images/openshift-console.png
trunk/documentation/whatsnew/openshift/images/openshift-import-application-details.png
trunk/documentation/whatsnew/openshift/images/openshift-import-application.png
trunk/documentation/whatsnew/openshift/images/openshift-new-application.png
trunk/documentation/whatsnew/openshift/images/openshift-properties.png
trunk/documentation/whatsnew/openshift/images/openshift-server-editor.png
trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html
Log:
[JBIDE-11031] creating N&N for openshift (not finished yet)
Added: trunk/documentation/whatsnew/openshift/images/console-create-a-server-adapter.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/console-create-a-server-adapter.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-console-2.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-console-2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-console.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-console.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-import-application-details.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-import-application-details.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-import-application.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-import-application.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-new-application.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-new-application.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-properties.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-properties.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/openshift-server-editor.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/openshift-server-editor.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html (rev 0)
+++ trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html 2012-02-27 17:48:23 UTC (rev 39154)
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>OpenShift Tools 2.3.0.Beta1 What's New</title>
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push([ '_setAccount', 'UA-17645367-5' ]);
+ _gaq.push([ '_trackPageview' ]);
+
+ (function() {
+ var ga = document.createElement('script');
+ ga.type = 'text/javascript';
+ ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl'
+ : 'http://www')
+ + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(ga, s);
+ })();
+</script>
+</head>
+<body>
+ <h1>OpenShift 2.3.0.Beta1 What's New</h1>
+
+ <p align="right">
+ <a href="../index.html">< Main Index</a> <a
+ href="../as/as-news-3.3.0.Beta1.html">Server Tools ></a>
+ </p>
+ <table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>OpenShift Express Console</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname3" id="itemname3"></a>
+ <b>OpenShift Express Console</b>
+ </td>
+ <td valign="top">
+ We reworked the whole UI for OpenShift in JBoss Tools 3.3.0 Beta1. Was was a single wizard in M5 is now split up
+ into different parts with concise aims. The central entry point is now what we call the <b>OpenShift Express console</b>.
+ <p>
+ <img src="images/openshift-console.png" alt="OpenShift Express Console" />
+ </p>
+ The OpenShift Express console will list your accounts and
+ applications and allow you to manage your resources on the Red Hat
+ PaaS. Actions in the context menu allow you to create new users,
+ manage domains, applications, etc. The OpenShift console also allows
+ you to import OpenShift applications to projects in your local
+ workspace, to create Eclipse WTP server adapters etc. <br />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a>
+ <b>Properties</b>
+ </td>
+ <td valign="top">Details to what's selected in the in the
+ OpenShift Express console are shown in the <b>Properties view</b>
+ <p>
+ <img src="images/openshift-properties.png" alt="OpenShift Express Properties" />
+ </p>
+ <p>
+ <small> <a
+ href="https://issues.jboss.org/browse/JBIDE-10528">Related
+ Jira</a>
+ </small>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>OpenShift Server</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a>
+ <b>OpenShift Server Runtime</b></td>
+ <td valign="top">
+ You may now create the server adapter for an <b>OpenShift
+ Express Application</b> by choosing <b>Create a Server Adapter</b> in the
+ context menu of the <b>OpenShift Express Console</b>
+ <p>
+ <img src="images/console-create-a-server-adapter.png" alt="create server adapter" />
+ </p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-10716">Related Jira</a>
+ </small>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3"
+ id="itemname3"></a><b>Tail files/logs</b></td>
+ <td valign="top">
+ <p>
+ You can now tail the live logs from the remote JBossAS7 instance
+ running on OpenShift right into your Eclipse Console view. This
+ feature is available from the <b>"Show In>Remote Console"</b>
+ contextual menu item of the Server Adapter associated with your
+ OpenShift Application.
+ </p>
+ <p>
+ <image src="images/show-in-remote-console.png" alt="Show In Remote Console" />
+ </p>
+ <p>
+ This works in the same manner as the '<b>rhc-tail-files</b>'
+ command line tool, which means that the underlying action issues a
+ single 'ssh tail' command on the remote VM, and thus may prompt
+ you for the passphrase associated with your OpenShift SSH Key if
+ it was not previously loaded during the Eclipse session.
+ </p>
+ <p>Both the 'boot.log' and 'server.log' will be shown in the
+ console, including their 100 previous lines.</p>
+ <p>
+ <img src="images/remote-console.png" alt="Remote Console" />
+ </p>
+ <p>You can stop the 'ssh tail' command from the console by
+ clicking on the 'Close Console' button.</p>
+ <p>
+ <small><a
+ href="https://issues.jboss.org/browse/JBIDE-10152">Related
+ Jira</a></small>
+ </p>
+
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>OpenShift Express Application Wizard</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Use
+ Existing Projects</b></td>
+ <td valign="top">
+ <p>The OpenShift Express Application wizard previously only
+ allowed you to import the existing application installed to
+ OpenShift into your workspace.</p>
+ <p>It was then up to you to merge the demo with your own
+ application and push things to the OpenShift PaaS. Our tooling did
+ not assist you in that case.</p>
+ <p>
+ M5 we now support to setup your own application directly for
+ deployment to OpenShift. Just uncheck <b>"Create New Project"</b>
+ and choose an existing project from your workspace, that you want
+ to publish to OpenShift. The wizard will then copy OpenShift
+ configurations and enable git on the project. You'll then be able
+ to push it to OpenShift via git or let the OpenShift Server Adapter
+ do that job for you.
+ </p>
+
+ <p>
+ <img src="images/push-existing-project.png"
+ alt="push existing project" />
+ </p>
+ <p>
+ <small><a
+ href="https://issues.jboss.org/browse/JBIDE-10171">Related
+ Jira</a></small>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Cartridges</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Embed
+ Cartridges</b></td>
+ <td valign="top">You can now manage cartridges for your
+ OpenShift applition directly from JBoss Tools. Cartridges add
+ capabilities to your application. A typical usecase is to add a
+ mysql database. You allow your application to use a mysql database
+ by embedding the mysql cartridge to it. The OpenShift Express
+ Application wizard will list all available cartridges and allow you
+ to add/remove cartridges at will.
+ <p>
+ <img src="images/embed-cartridge.png" alt="embed cartridge" />
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Embed
+ Jenkins</b></td>
+ <td valign="top">OpenShift now has support for Jenkins, turning
+ OpenShift into an Continous Integration server. Anytime you push
+ changes to OpenShift, a jenkins CI server will build your
+ application. The OpenShift Express Application wizard allows you to
+ embed the jenkins client. It will verify behind the scenes that you
+ already have a jenkins application and prompt you to create one if
+ you haven't yet.
+
+ <p>
+ <img src="images/create-jenkins.png" alt="create jenkins" />
+ </p> Credentials and url of your new jenkins instance will get reported
+ to you - keep those for future reference.
+ <p>
+ <img src="images/jenkins-creation-log.png"
+ alt="jenkins creation log" />
+ </p>
+ <p>
+ <small><a href="https://issues.jboss.org/browse/JBIDE-9927">Related
+ Jira</a></small>
+ </p>
+ </td>
+ </tr>
+
+
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Maven pom.xml editor</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>New
+ OpenShift Express profile template</b></td>
+ <td valign="top">If you want to deploy your Web application to
+ OpenShift Express, you will need to define an <strong><i>openshift</i></strong>
+ maven profile. It basically configures the maven build to generate a
+ ROOT.war archive in the deployments folder of your project.
+ <p>
+ In the pom.xml editor, create a <profiles> section if it
+ doesn't exist and press <strong>CTRL+<space></strong> to
+ trigger auto-completion, an OpenShift Express Maven profile
+ template is now available :
+ </p>
+ <p></p> <img src="images/openshift-profile.png"
+ alt="new OpenShift Express maven profile template" />
+ </p> Press enter to select and insert the <strong><i>openshift</i></strong>
+ profile in your pom.xml.
+ <p>
+ <small><a
+ href="https://issues.jboss.org/browse/JBIDE-10354">Related
+ Jira</a></small>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>OpenShift Express REST client</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>REST
+ Client</b></td>
+ <td valign="top">We developed a client for the OpenShift Express
+ REST service in M4. It offers most features that are currently
+ available in the rhc-* command line tools (create/rename a domain,
+ create/destroy applications, list all existing applications,
+ available cartridges, read the application log, embed cartridges
+ etc.). <br /> We moved it to github and joined forces with the
+ OpenShift team. The official client is now maintained at <a
+ href="https://github.com/bdecoste/openshift-java-client">https://github.com/bdecoste/openshift-java-client</a>
+ <p>
+ <small><a
+ href="https://issues.jboss.org/browse/JBIDE-10068">Related
+ Jira</a>, <a href="https://issues.jboss.org/browse/JBIDE-10455">Related
+ Jira</a></small>
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.Beta1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 2 months
JBoss Tools SVN: r39153 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-27 12:38:40 -0500 (Mon, 27 Feb 2012)
New Revision: 39153
Modified:
trunk/documentation/whatsnew/index.html
Log:
JBIDE-11067 : JBoss Central N&N : new GWT project
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2012-02-27 17:38:02 UTC (rev 39152)
+++ trunk/documentation/whatsnew/index.html 2012-02-27 17:38:40 UTC (rev 39153)
@@ -53,8 +53,8 @@
-->
<p><a href="seam/seam-news-3.3.0.Beta1.html">Seam 2 Tools</a></p>
<p><a href="maven/maven-news-3.3.0.Beta1.html">Maven Tools</a></p>
+ <p><a href="central/central-news-1.0.0.Beta1.html">JBoss Central</a></p>
<!--
- <p><a href="central/central-news-1.0.0.M5.html">JBoss Central</a></p>
<p><a href="teiid/teiid-news-7.6.html">Teiid Designer</a></p>
<p><a href="ws/ws-news-1.2.2.M5.html">Webservices Tools</a></p>
-->
13 years, 2 months
JBoss Tools SVN: r39152 - in trunk/documentation/whatsnew: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-27 12:38:02 -0500 (Mon, 27 Feb 2012)
New Revision: 39152
Added:
trunk/documentation/whatsnew/central/central-news-1.0.0.Beta1.html
trunk/documentation/whatsnew/images/gwt-project-requirements.png
trunk/documentation/whatsnew/images/jboss-central-create-projects2.png
Log:
JBIDE-11067 : JBoss Central N&N : new GWT project
Added: trunk/documentation/whatsnew/central/central-news-1.0.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/central/central-news-1.0.0.Beta1.html (rev 0)
+++ trunk/documentation/whatsnew/central/central-news-1.0.0.Beta1.html 2012-02-27 17:38:02 UTC (rev 39152)
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css"/>
+<title>JBoss Central 1.0.0.Beta1 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>JBoss Central 1.0.0.Beta1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+href="../teiid/teiid-news-7.6.html">Teiid Designer ></a>
+
+</p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr/>
+ <h3>General</h3>
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemnam1e" id="itemname1"></a><b>New GWT project wizard</b>
+ </td>
+ <td width="70%" valign="top">
+ A new GWT project wizard has been added to the <strong>Create Project</strong> section of JBoss Central :
+
+ <p><img src="../images/jboss-central-create-projects2.png"/></p>
+ <p>
+ The created project is based on <a href="http://www.jboss.org/errai">JBoss Errai</a>, which brings the CDI programming model to GWT applications.<br/>
+ In order to use this project, you will need :
+ <ul>
+ <li>The latest m2e-wtp plugin</li>
+ <li>The Google Plugin for Eclipse</li>
+ </ul>
+ </p>
+ These plugins, if missing, can be installed directly from the first page of the project wizard :
+ <p><img src="../images/gwt-project-requirements.png"/></p>
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-10798">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <!--
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemnam1e" id="itemname1"></a><b>Search and quick access buttons</b>
+ </td>
+ <td width="70%" valign="top">
+ <p>The top section of JBoss Central provides an easy way to search
+ jboss.org and the knowledge base from Red Hat. The result will
+ show up in the browser configured in Eclipse preferences.
+ </p>
+
+ <p>There is is also a set of quick access icons to access JBoss
+ Tools homepage, Eclipse Marketplace, Preferences and Twitter account.</p>
+
+ <p><img src="../images/jbosscentralsearch.png"/></p>
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-9368">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemnam1e" id="itemname1"></a><b>News</b>
+ </td>
+ <td width="70%" valign="top">
+ <p>On the right side of JBoss Central there are two feeds, one
+ for News another for Blogs - all related to jboss.org and JBoss technology.
+ </p>
+
+ <p>The feeds can be refreshed and if you want to subscribe to
+ these feeds in your newsreader you can click the RSS & Blog icon
+ to get the feedd address.</p>
+
+ <p><img src="../images/jbosscentralfeeds.png"/></p>
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-9368">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemnam1e" id="itemname1"></a><b>Create
+ Projects/Project Examples</b>
+ </td>
+ <td width="70%" valign="top">
+ <p>On the left side there are quick access to central wizards in
+ Eclipse & JBoss Tools which will create and setup projects for you.</p>
+
+ <p>In the Project Examples section there is a selected set of
+ Project Examples to get you started using JBoss AS.</p>
+
+ <p><img src="../images/jbosscentralprojects.png"/></p>
+
+ <p>If the examples requires certain runtimes or plugins it will
+ let you know and in case there is a publically available
+ download available it will offer to Download and install
+ it.</p>
+
+ <p><img src="../images/jbosscentraldownloadas.png"/></p>
+
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-9368">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemnam1e" id="itemname1"></a><b>Software/Update</b>
+ </td>
+ <td width="70%" valign="top">
+ <p>The second tab of JBoss Central provides a list of plugins
+ which works with JBoss Tools - initially we've just added some
+ basic plugins like Maven JBoss Tools integration, TestNG and
+ eGit.</p>
+
+ <p><img src="../images/jbosscentralsoftwareupdate.png"/></p>
+
+ <p>In the future we will add more to this list as they come available.</p>
+
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-9368">Related Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ -->
+</table>
+
+</body>
+
+</html>
Added: trunk/documentation/whatsnew/images/gwt-project-requirements.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/gwt-project-requirements.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/images/jboss-central-create-projects2.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/jboss-central-create-projects2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
13 years, 2 months
JBoss Tools SVN: r39151 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/behaviour and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-27 12:25:58 -0500 (Mon, 27 Feb 2012)
New Revision: 39151
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ShowInWelcomePageActionProvider.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
Log:
[JBIDE-11052] added new ShowInWelcomePage action to OpenShift server adapter
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-27 17:09:10 UTC (rev 39150)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-27 17:25:58 UTC (rev 39151)
@@ -171,6 +171,40 @@
sourcePathComputerId="org.eclipse.jst.server.generic.core.sourcePathComputer"/>
</extension>
+ <extension point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding viewerId="org.eclipse.wst.server.ui.ServersView">
+ </viewerContentBinding>
+ <viewerActionBinding viewerId="org.eclipse.wst.server.ui.ServersView">
+ <includes>
+ <actionExtension
+ pattern="org.jboss.tools.openshift.express.ui.internal.ui.console.tailServerLogActionProvider"/>
+ </includes>
+ </viewerActionBinding>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <actionProvider
+ class="org.jboss.tools.openshift.express.internal.ui.behaviour.ShowInWelcomePageActionProvider"
+ id="org.jboss.tools.openshift.express.internal.ui.behaviour.ShowInWelcomePageActionProvider">
+ <enablement>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ </enablement>
+ </actionProvider>
+ </extension>
+ <extension point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding viewerId="org.eclipse.wst.server.ui.ServersView">
+ </viewerContentBinding>
+ <viewerActionBinding viewerId="org.eclipse.wst.server.ui.ServersView">
+ <includes>
+ <actionExtension
+ pattern="org.jboss.tools.openshift.express.internal.ui.behaviour.ShowInWelcomePageActionProvider"/>
+ </includes>
+ </viewerActionBinding>
+ </extension>
+
<!-- Extensions to Server View to provide 'tail' of the remote server.log file -->
<extension point="org.eclipse.ui.navigator.navigatorContent">
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-27 17:09:10 UTC (rev 39150)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-27 17:25:58 UTC (rev 39151)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jgit.transport.URIish;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerAttributes;
@@ -35,6 +36,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerCreationUtils;
import org.jboss.tools.openshift.egit.core.EGitUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel;
import com.openshift.express.client.IApplication;
@@ -328,17 +330,23 @@
}
public static IProject findProjectForServersApplication(IServer server) {
+ IApplication app = findApplicationForServer(server);
+ if (app == null) {
+ return null;
+ }
+ return ExpressServerUtils.findProjectForApplication(app);
+ }
+
+ public static IApplication findApplicationForServer(IServer server) {
try {
String user = ExpressServerUtils.getExpressUsername(server);
IUser user2 = UserModel.getDefault().findUser(user);
String appName = ExpressServerUtils.getExpressApplicationName(server);
IApplication app = user2.getApplicationByName(appName);
- IProject destProj = ExpressServerUtils.findProjectForApplication(app);
- return destProj;
+ return app;
} catch(OpenShiftException ose) {
- //TODO log and throw core e
+ Logger.error(NLS.bind("Could not find application for server {0}", server.getName()));
+ return null;
}
- return null;
}
-
}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ShowInWelcomePageActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ShowInWelcomePageActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ShowInWelcomePageActionProvider.java 2012-02-27 17:25:58 UTC (rev 39151)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.behaviour;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.AbstractOpenBrowserServerAction;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * Action that shows the welcome page for a given openshift application. This is
+ * actually a copy of org.jboss.ide.eclipse.as.ui.views.server.extensions.
+ * ShowInWelcomePageActionProvider, should be consolidated at some point.
+ *
+ * @author Andre Dietisheim
+ */
+public class ShowInWelcomePageActionProvider extends AbstractOpenBrowserServerAction {
+
+ protected String getActionText() {
+ return Messages.ShowInWelcomePage_Action_Text;
+ }
+
+ protected boolean shouldAddForSelection(IStructuredSelection sel) {
+ IServer server = getSingleServer(sel);
+ boolean shouldAddForSelection = false;
+ /**
+ * TODO: move this logic to the server, allow this action to ask the
+ * server if it supports welcome page: ex. #hasWelcomePage
+ */
+ if (server != null) {
+ shouldAddForSelection =
+ ExpressServerUtils.isOpenShiftRuntime(server)
+ && accepts(server);
+ }
+ return shouldAddForSelection;
+ }
+
+ protected boolean accepts(IServer server) {
+ return server.getServerState() == IServer.STATE_STARTED;
+ }
+
+ /**
+ * TODO: move this logic to the server, allow this action to ask the
+ * server for welcome page: ex. #getWelcomePage
+ */
+ protected String getURL(IServer server) throws CoreException {
+ if (!ExpressServerUtils.isOpenShiftRuntime(server)) {
+ return null;
+ }
+ IApplication application = ExpressServerUtils.findApplicationForServer(server);
+ if (application == null) {
+ return null;
+ }
+ try {
+ return application.getApplicationUrl();
+ } catch (OpenShiftException e) {
+ IStatus status = OpenShiftUIActivator.createErrorStatus(
+ NLS.bind("Could not get application url for server {0}", server.getName()), e);
+ throw new CoreException(status);
+ }
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ShowInWelcomePageActionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 2 months