JBoss Tools SVN: r34225 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-24 09:13:46 -0400 (Wed, 24 Aug 2011)
New Revision: 34225
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java
Log:
[JBIDE-9576] added EAP6_RUNTIME as runtime that the AS7 service supports
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java 2011-08-24 13:12:57 UTC (rev 34224)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/v7/management/JBoss7ManagerUtil.java 2011-08-24 13:13:46 UTC (rev 34225)
@@ -18,7 +18,8 @@
public class JBoss7ManagerUtil {
private static final String JBOSS7_RUNTIME = "org.jboss.ide.eclipse.as.runtime.70"; //$NON-NLS-1$
-
+ private static final String EAP6_RUNTIME = "org.jboss.ide.eclipse.as.runtime.eap.60"; //$NON-NLS-1$
+
public static IJBoss7ManagerService getService(IServer server) throws InvalidSyntaxException {
BundleContext context = JBossServerCorePlugin.getContext();
JBoss7ManagerServiceProxy proxy = new JBoss7ManagerServiceProxy(context, getRequiredVersion(server));
@@ -28,7 +29,8 @@
private static String getRequiredVersion(IServer server) {
String id = server.getRuntime().getRuntimeType().getId();
- if (JBOSS7_RUNTIME.equals(id)) {
+ if (JBOSS7_RUNTIME.equals(id)
+ || EAP6_RUNTIME.equals(id)) {
return IJBoss7ManagerService.AS_VERSION_700;
}
return null;
14 years, 7 months
JBoss Tools SVN: r34224 - trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-24 09:12:57 -0400 (Wed, 24 Aug 2011)
New Revision: 34224
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
Log:
[JBIDE-9576] removed lazy-start (bundles with osgi services must be autostarted, there's no lazy service registration)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-08-24 12:29:44 UTC (rev 34223)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/MANIFEST.MF 2011-08-24 13:12:57 UTC (rev 34224)
@@ -7,7 +7,6 @@
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.wst.server.core;bundle-version="1.1.302"
-Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
jboss-as-controller-client-7.0.0.Final.jar,
14 years, 7 months
JBoss Tools SVN: r34223 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-24 08:29:44 -0400 (Wed, 24 Aug 2011)
New Revision: 34223
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java
Log:
[JBIDE-9576] corrected service disposal
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java 2011-08-24 11:55:27 UTC (rev 34222)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java 2011-08-24 12:29:44 UTC (rev 34223)
@@ -77,11 +77,8 @@
@Override
public void dispose() {
- try {
- JBoss7ManagerUtil.dispose(getService());
- } catch (InvalidSyntaxException e) {
- JBossServerCorePlugin.log(IStatus.ERROR, Messages.ErrorDisposingLocalJBoss7BehaviorDelegate, e);
- }
+ JBoss7ManagerUtil.dispose(service);
+ this.service = null;
}
protected IJBoss7ManagerService getService() throws InvalidSyntaxException {
14 years, 7 months
JBoss Tools SVN: r34222 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-24 07:55:27 -0400 (Wed, 24 Aug 2011)
New Revision: 34222
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
Log:
[JBIDE-9577] added margins and set minimal size for text field
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-08-24 11:53:37 UTC (rev 34221)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-08-24 11:55:27 UTC (rev 34222)
@@ -197,7 +197,7 @@
link = new Link(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(label);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(text);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).minSize(80, 10).grab(true, false).applyTo(text);
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(detect);
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(link);
@@ -304,7 +304,7 @@
FormData data;
Control c;
Composite wrapper = new Composite(parent, SWT.NONE);
- GridLayoutFactory.fillDefaults().numColumns(4).applyTo(wrapper);
+ GridLayoutFactory.fillDefaults().margins(6, 10).numColumns(4).applyTo(wrapper);
data = new FormData();
data.top = new FormAttachment(top,0);
data.left = new FormAttachment(0,0);
14 years, 7 months
JBoss Tools SVN: r34221 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-24 07:53:37 -0400 (Wed, 24 Aug 2011)
New Revision: 34221
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java
Log:
swtbotext: added constructor with params
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java 2011-08-24 11:52:43 UTC (rev 34220)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/entity/JavaClassEntity.java 2011-08-24 11:53:37 UTC (rev 34221)
@@ -20,6 +20,11 @@
private String className = "";
private String packageName = "";
+ public JavaClassEntity(String packageName, String className) {
+ this.className = className;
+ this.packageName = packageName;
+ }
+
public String getClassName() {
return className;
}
14 years, 7 months
JBoss Tools SVN: r34220 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-24 07:52:43 -0400 (Wed, 24 Aug 2011)
New Revision: 34220
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
Log:
swtbotext: do not load default config twice
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-24 11:51:53 UTC (rev 34219)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-24 11:52:43 UTC (rev 34220)
@@ -82,8 +82,6 @@
public static Properties multiProperties = new Properties();
public static TestConfiguration currentConfig;
static {
- boolean loadDefault = true;
-
try {
Pattern configMatch = Pattern.compile("");
try {
@@ -121,7 +119,6 @@
log.info("Adding configuration file "+file.getName());
multiProperties.put(file.getName().replace(".properties", ""), file.getAbsolutePath());
}
- loadDefault = false;
}
} else if (propFile != null) {
if (new File(propFile).exists()) {
@@ -136,33 +133,18 @@
multiProperties.put("Default", propFile);
}
- loadDefault = false;
} else {
throw new IOException(SWTBOT_TEST_PROPERTIES_FILE + " "
+ propFile + " does not exist!");
}
} else {
log.info("No configuration property passed, using default");
- multiProperties.put(SWTBOT_TEST_PROPERTIES_FILE, "");
+ multiProperties.put("default", "");
}
} catch (Exception ex) {
ex.printStackTrace();
}
-
- if (loadDefault) {
- // load default config by default
- try {
- log.info(" * Loading default configuration first");
- currentConfig = new TestConfiguration("default", "");
-
- } catch (Exception e) {
- // log only message, nothing
- log.error(e.getMessage());
- } finally {
- log.info(" * Defaults loaded");
- }
- }
log.info("Default Timing mulitiplier is set to "+Timing.multiplier);
}
14 years, 7 months
JBoss Tools SVN: r34219 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-24 07:51:53 -0400 (Wed, 24 Aug 2011)
New Revision: 34219
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
Log:
swtbotext: make default test config empty
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties 2011-08-24 11:32:32 UTC (rev 34218)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties 2011-08-24 11:51:53 UTC (rev 34219)
@@ -1,20 +1,20 @@
# SWTBotTest properties
# all properties are optional, all defined paths should exist
# <java version>,<jre/jdk home>
-JAVA=1.6,/opt/sun-jdk-1.6.0.19/jre
-#EAP|AS|EPP|SOA,<server version>,<jre version to run with>|default,<server home>,<optional remote system host>,<optional remote home>
+# JAVA=1.6,/opt/sun-jdk-1.6.0.19/jre
+# EAP|AS|EPP|SOA,<server version>,<jre version to run with>|default,<server home>,<optional remote system host>,<optional remote home>
# note : when server is type of SOA, version is version of SOA (not the bundled EAP)
-SERVER=EAP,5.0,1.6,/data/jboss/jboss-eap-5.0/jboss-as
+# SERVER=EAP,5.0,1.6,/data/jboss/jboss-eap-5.0/jboss-as
#SERVER=EAP,5.0,1.6,/data/jboss/jboss-eap-5.0/jboss-as,remote.example.com,/opt/jboss-eap-5.0/jboss-as
# note that zip will be unzipped into <server home> minus 1-2 folders. Change <server home> to reflect
# content of downloaded zip.
-SERVER_URL=http://localhost/eap5.zip
+# SERVER_URL=http://localhost/eap5.zip
# remote system= <user>,<host>,<private key>
#RS=lzoubek,remote.example.com,/home/lzoubek/.ssh/id_rsa
#<seam version>,<seam runtime home>
-SEAM=2.2,/data/jboss/jboss-eap-5.0/seam
+# SEAM=2.2,/data/jboss/jboss-eap-5.0/seam
#<esb versoin>,<esb runtime home>
-ESB=4.7,/data/jboss/esb-4.7
+# ESB=4.7,/data/jboss/esb-4.7
#DB Definition
#DB=<db_type>,<version>,<driver_path>,<jdbc_string>,<username>,[<password>,<scriptpath>]
#Supported types: hsqldb18, db2_97, mssql2005, mssql2008, mysql50, mysql51, oracle10g, oracle11gR1, oracle11gR1RAC, oracle11gR2, oracle11gR2RAC, postgresql82, postgresql83, postgresql84, sybase15
@@ -25,7 +25,7 @@
#DB=hsqldb18,1.8,/home/username/lib/hsqldb/lib/hsqldb.jar,jdbc:hsqldb:hsql://localhost:8001/xdb,sa,,
#Connection profile named <db_type>_<version> will be created
#Annotation usage for TestCase db=@DB
-DB=hsqldb18,internal,driver,jdbc,user,,
+# DB=hsqldb18,internal,driver,jdbc,user,,
# Secure Storage=<password>
# configure master password for secure storage
-SS=password
+# SS=password
14 years, 7 months
JBoss Tools SVN: r34218 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-24 07:32:32 -0400 (Wed, 24 Aug 2011)
New Revision: 34218
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
Log:
[JBIDE-9577] applied a grid layout to all port extensions so that all text fields can start at the same position (was: each port extension was in its own composite, so they could only be set to be left aligned by applying an offset that was expected to be larger that any possible label)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-08-24 11:07:52 UTC (rev 34217)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2011-08-24 11:32:32 UTC (rev 34218)
@@ -22,6 +22,8 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
@@ -107,7 +109,7 @@
public static interface IPortEditorExtension {
public void setServerAttributeHelper(ServerAttributeHelper helper);
public void setSection(PortSection section);
- public Control createControl(Composite parent);
+ public void createControl(Composite parent);
public String getValue();
}
@@ -182,43 +184,23 @@
public void setSection(PortSection section) {
this.section = section;
}
- public Control createControl(Composite parent) {
- Control c = createUI(parent);
+ public void createControl(Composite parent) {
+ createUI(parent);
initialize();
addListeners();
- return c;
}
- protected Control createUI(Composite parent) {
- Composite child = new Composite(parent, SWT.NONE);
- child.setLayout(new FormLayout());
- label = new Label(child, SWT.NONE);
- text = new Text(child, SWT.SINGLE | SWT.BORDER);
- detect = new Button(child, SWT.CHECK);
- link = new Link(child, SWT.NONE);
-
- FormData data;
- data = new FormData();
- data.top = new FormAttachment(0,8);
- data.right = new FormAttachment(100,-5);
- link.setLayoutData(data);
-
- data = new FormData();
- data.right = new FormAttachment(link, -5);
- data.top = new FormAttachment(0,5);
- detect.setLayoutData(data);
-
- data = new FormData();
- data.right = new FormAttachment(detect, -5);
- data.left = new FormAttachment(0, 75);
- data.top = new FormAttachment(0,5);
- text.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(0,5);
- data.top = new FormAttachment(0,8);
- label.setLayoutData(data);
-
+ protected void createUI(Composite parent) {
+ label = new Label(parent, SWT.NONE);
+ text = new Text(parent, SWT.SINGLE | SWT.BORDER);
+ detect = new Button(parent, SWT.CHECK);
+ link = new Link(parent, SWT.NONE);
+
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(label);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(text);
+ GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(detect);
+ GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(link);
+
label.setText(labelText);
detect.setText(Messages.EditorAutomaticallyDetectPort);
link.setText("<a href=\"\">" + Messages.Configure + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -236,7 +218,6 @@
});
- return child;
}
protected void initialize() {
boolean shouldDetect = helper.getAttribute(detectXPathKey, true);
@@ -323,7 +304,7 @@
FormData data;
Control c;
Composite wrapper = new Composite(parent, SWT.NONE);
- wrapper.setLayout(new FormLayout());
+ GridLayoutFactory.fillDefaults().numColumns(4).applyTo(wrapper);
data = new FormData();
data.top = new FormAttachment(top,0);
data.left = new FormAttachment(0,0);
@@ -333,16 +314,7 @@
for( int i = 0; i < extensions.length; i++ ) {
extensions[i].setServerAttributeHelper(helper);
extensions[i].setSection(this);
- c = extensions[i].createControl(wrapper);
- data = new FormData();
- if( top == null )
- data.top = new FormAttachment(0, 5);
- else
- data.top = new FormAttachment(top, 5);
- data.left = new FormAttachment(0,5);
- data.right = new FormAttachment(100,-5);
- c.setLayoutData(data);
- top = c;
+ extensions[i].createControl(wrapper);
}
}
14 years, 7 months
JBoss Tools SVN: r34217 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: src/org/jboss/tools/cdi/bot/test/quickfix and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-08-24 07:07:52 -0400 (Wed, 24 Aug 2011)
New Revision: 34217
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/MyBean.java.cdi
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
Log:
New bot tests operating on Quick Fixed of CDI components and new resource file have been added
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/MyBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/MyBean.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/MyBean.java.cdi 2011-08-24 11:07:52 UTC (rev 34217)
@@ -0,0 +1,16 @@
+package org.cdi.test;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+public class MyBean {
+
+ @Inject
+ public MyBean(String aaa) {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Produces
+ public String produceString(String aa) {
+ return "test";
+ }
+
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-08-24 08:50:30 UTC (rev 34216)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-08-24 11:07:52 UTC (rev 34217)
@@ -3,7 +3,6 @@
import java.util.logging.Logger;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
@@ -34,33 +33,30 @@
@SuiteClasses({ CDIAllBotTests.class })
public class CDIQuickFixTest extends SWTTestExt {
- private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class
- .getName());
+ private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class.getName());
private static final String PROJECT_NAME = "CDIProject";
private static final String PACKAGE_NAME = "org.cdi.test";
private static SWTBotTreeItem[] problemsTrees;
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
- private enum ANNOTATIONS {TARGET, RETENTION, NAMED, TYPED}
+ private enum ANNOTATIONS {TARGET, RETENTION, NAMED, TYPED,DISPOSES, OBSERVES}
+ private enum CDICOMPONENT {STEREOSCOPE, QUALIFIER, SCOPE, BEAN}
+ private SWTBotEclipseEditor ed;
@BeforeClass
public static void setup() {
eclipse.showView(ViewType.PROJECT_EXPLORER);
CDIUtil.disableFolding(bot, util);
- CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer,
- PROJECT_NAME);
+ CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer,PROJECT_NAME);
}
@After
public void waitForJobs() {
util.waitForNonIgnoredJobs();
}
-
+
@Test
public void testSerializableQF() {
- CDIUtil.bean(PACKAGE_NAME, "B1", true, false, false, false, null, null,
- null, null).finish();
- util.waitForNonIgnoredJobs();
- SWTBotEditor ed = bot.activeEditor();
+ createComponent(CDICOMPONENT.BEAN, "B1");
assertTrue(("B1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
LOGGER.fine(code);
@@ -83,22 +79,16 @@
"CDI Problem");
assertTrue(problemsTrees.length == 0);
}
-
+
@Test
public void testMultipleBeansQF() {
- CDIUtil.bean(PACKAGE_NAME, "Animal", true, false, false, false, null,
- null, null, null).finish();
- util.waitForNonIgnoredJobs();
- SWTBotEditor ed = bot.activeEditor();
+ createComponent(CDICOMPONENT.BEAN, "Animal");
assertTrue(("Animal.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
assertTrue(code.contains("public class Animal {"));
- CDIUtil.bean(PACKAGE_NAME, "Dog", true, false, false, false, null,
- null, null, null).finish();
- util.waitForNonIgnoredJobs();
- ed = bot.activeEditor();
+ createComponent(CDICOMPONENT.BEAN, "Dog");
CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/Dog.java.cdi"), false);
assertTrue(("Dog.java").equals(ed.getTitle()));
@@ -107,17 +97,12 @@
assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
assertTrue(code.contains("public class Dog extends Animal {"));
- CDIUtil.qualifier(PACKAGE_NAME, "Q1", false, false).finish();
- util.waitForNonIgnoredJobs();
- ed = bot.activeEditor();
+ createComponent(CDICOMPONENT.QUALIFIER, "Q1");
assertTrue(("Q1.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
LOGGER.fine(code);
- CDIUtil.bean(PACKAGE_NAME, "BrokenFarm", true, false, false, false,
- null, null, null, null).finish();
- util.waitForNonIgnoredJobs();
- ed = bot.activeEditor();
+ createComponent(CDICOMPONENT.BEAN, "BrokenFarm");
CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
false);
@@ -141,7 +126,7 @@
qualifBean = "Dog";
}
bot.activeShell().bot().button("Finish").click();
- bot.sleep(Timing.time2S());
+ bot.sleep(Timing.time1S());
util.waitForNonIgnoredJobs();
assertFalse(bot.button("Add >").isEnabled());
assertFalse(bot.button("Finish").isEnabled());
@@ -152,7 +137,7 @@
assertTrue(bot.button("Finish").isEnabled());
bot.clickButton("Finish");
- bot.sleep(Timing.time2S());
+ bot.sleep(Timing.time1S());
util.waitForNonIgnoredJobs();
code = ed.toTextEditor().getText();
assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
@@ -163,68 +148,62 @@
"BrokenFarm.java", "CDI Problem");
assertTrue(problemsTrees.length == 0);
}
-
+
@Test
public void testStereoscopeQF() {
- CDIUtil.stereotype(PACKAGE_NAME, "S1", null, null, false, false, false,
- false).finish();
- util.waitForNonIgnoredJobs();
- SWTBotEclipseEditor ed = bot.activeEditor().toTextEditor();
- checkStartupWarnings(bot);
- prepareStereoscope(ed);
+ prepareCdiComponent(CDICOMPONENT.STEREOSCOPE, "S1");
// 1.QF - https://issues.jboss.org/browse/JBIDE-7630
- checkTargetAnnotation(ed);
+ checkTargetAnnotation(CDICOMPONENT.STEREOSCOPE, ed);
// 2.QF - https://issues.jboss.org/browse/JBIDE-7631
- checkRetentionAnnotation(ed);
+ checkRetentionAnnotation(CDICOMPONENT.STEREOSCOPE, ed);
// 3.QF - https://issues.jboss.org/browse/JBIDE-7634
- checkNamedAnnotation(ed);
+ checkNamedAnnotation(CDICOMPONENT.STEREOSCOPE, ed);
// 4.QF - https://issues.jboss.org/browse/JBIDE-7640
- checkTypedAnnotation(ed);
+ checkTypedAnnotation(CDICOMPONENT.STEREOSCOPE, ed);
}
-
- @Ignore("not ready yet")
+
@Test
public void testQualifiersQF() {
- /*
- * 2 QF
- */
-
- CDIUtil.qualifier(PACKAGE_NAME, "Q1", false, false).finish();
- util.waitForNonIgnoredJobs();
- SWTBotEditor ed = bot.activeEditor();
- ed.setFocus();
+ prepareCdiComponent(CDICOMPONENT.QUALIFIER, "Q2");
+
+ // 1.QF - https://issues.jboss.org/browse/JBIDE-7631
+ checkRetentionAnnotation(CDICOMPONENT.QUALIFIER, ed);
+
+ // 2.QF - https://issues.jboss.org/browse/JBIDE-7632
+ checkTargetAnnotation(CDICOMPONENT.QUALIFIER, ed);
}
-
- @Ignore("not ready yet")
+
@Test
public void testScopeQF() {
- /*
- * 2 QF
- */
-
- CDIUtil.scope(PACKAGE_NAME, "Scope1", false, false, true, false)
- .finish();
- util.waitForNonIgnoredJobs();
- SWTBotEditor ed = bot.activeEditor();
- ed.setFocus();
+ prepareCdiComponent(CDICOMPONENT.SCOPE, "Scope1");
+
+ // 1.QF - https://issues.jboss.org/browse/JBIDE-7631
+ checkRetentionAnnotation(CDICOMPONENT.SCOPE, ed);
+
+ // 2.QF - https://issues.jboss.org/browse/JBIDE-7633
+ checkTargetAnnotation(CDICOMPONENT.SCOPE, ed);
}
-
- @Ignore("not ready yet")
+
@Test
public void testBeanQF() {
- /*
- * 5 QF
- */
-
- CDIUtil.bean(PACKAGE_NAME, "MyBean", true, false, false, false, null,
- null, null, null).finish();
- util.waitForNonIgnoredJobs();
- SWTBotEditor ed = bot.activeEditor();
- ed.setFocus();
+ prepareCdiComponent(CDICOMPONENT.BEAN, "MyBean");
+
+ // 1.QF - https://issues.jboss.org/browse/JBIDE-7664
+ checkConstructor(CDICOMPONENT.BEAN, ed);
+
+ // 2.QF - https://issues.jboss.org/browse/JBIDE-7665
+ checkProducerMethod(CDICOMPONENT.BEAN, ed);
+
+ // 3.QF - https://issues.jboss.org/browse/JBIDE-7667
+ checkObserverDisposerMethod(CDICOMPONENT.BEAN, ed);
+
+ // 4.QF - https://issues.jboss.org/browse/JBIDE-7668
+
+ // 5.QF - https://issues.jboss.org/browse/JBIDE-7680
}
@Ignore("not ready yet")
@@ -239,22 +218,58 @@
*/
}
- private void prepareStereoscope(SWTBotEclipseEditor ed) {
- CDIUtil.replaceInEditor(ed, bot, "@Target({ TYPE, METHOD, FIELD })",
- "@Target({TYPE, METHOD, FIELD})");
+ private void prepareCdiComponent(CDICOMPONENT component, String name) {
+ createComponent(component, name);
+ checkStartupWarnings(bot);
+ switch (component) {
+ case QUALIFIER:
+ CDIUtil.replaceInEditor(ed, bot, "@Target({ TYPE, METHOD, PARAMETER, FIELD })",
+ "@Target({TYPE, METHOD, PARAMETER, FIELD})");
+ break;
+ case STEREOSCOPE:
+ case SCOPE:
+ CDIUtil.replaceInEditor(ed, bot, "@Target({ TYPE, METHOD, FIELD })",
+ "@Target({TYPE, METHOD, FIELD})");
+ break;
+ default:
+ break;
+ }
}
+ private void createComponent(CDICOMPONENT component, String name) {
+ switch (component) {
+ case STEREOSCOPE:
+ CDIUtil.stereotype(PACKAGE_NAME, name, null, null, false, false, false,
+ false).finish();
+ break;
+ case QUALIFIER:
+ CDIUtil.qualifier(PACKAGE_NAME, name, false, false).finish();
+ break;
+ case SCOPE:
+ CDIUtil.scope(PACKAGE_NAME, name, false, false, true, false).finish();
+ break;
+ case BEAN:
+ CDIUtil.bean(PACKAGE_NAME, name, true, false, false, false, null,
+ null, null, null).finish();
+ break;
+ default:
+ break;
+ }
+ util.waitForNonIgnoredJobs();
+ ed = bot.activeEditor().toTextEditor();
+ }
+
private void prepareNamedAnnotation(SWTBotEclipseEditor ed, boolean add) {
if (add) {
ed.toTextEditor().insertText(ed.getLineCount()-4 , 0,
- "@Named(\"Stereoscope\")" + LINE_SEPARATOR);
+ "@Named(\"Name\")" + LINE_SEPARATOR);
ed.toTextEditor().insertText(6 , 0, "import javax.inject.Named;" + LINE_SEPARATOR);
} else {
CDIUtil.replaceInEditor(ed, bot, "@Named", "");
CDIUtil.replaceInEditor(ed, bot,
"import javax.inject.Named;", "");
}
- bot.sleep(Timing.time2S());
+ bot.sleep(Timing.time1S());
ed.save();
}
@@ -262,9 +277,28 @@
ed.toTextEditor().insertText(ed.getLineCount()-4 , 0,
"@Typed" + LINE_SEPARATOR);
ed.toTextEditor().insertText(6 , 0, "import javax.enterprise.inject.Typed;" + LINE_SEPARATOR);
- bot.sleep(Timing.time2S());
+ bot.sleep(Timing.time1S());
ed.save();
}
+
+ private void prepareInjectAnnot(SWTBotEclipseEditor ed) {
+ ed.toTextEditor().insertText(3 , 1, "@Inject" + LINE_SEPARATOR);
+ ed.toTextEditor().insertText(1 , 0, "import javax.inject.Inject;" + LINE_SEPARATOR);
+ ed.toTextEditor().insertText(6 , 15, "String aaa");
+ }
+
+ private void prepareProducer(SWTBotEclipseEditor ed) {
+ CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/MyBean.java.cdi"), false);
+ }
+
+ private void prepareObserverDisposer(SWTBotEclipseEditor ed) {
+ prepareProducer(ed);
+ CDIUtil.replaceInEditor(ed, bot, "@Produces", "@Inject");
+ CDIUtil.replaceInEditor(ed, bot, "import javax.enterprise.inject.Produces;", "");
+ CDIUtil.replaceInEditor(ed, bot, "String produceString", "void method");
+ CDIUtil.replaceInEditor(ed, bot, "return \"test\";", "");
+ }
private void checkStartupWarnings(SWTBotExt bot) {
SWTBotTreeItem[] warningTrees = ProblemsView
@@ -273,14 +307,32 @@
assertTrue(warningTrees.length == 0);
}
- private void checkTargetAnnotation(SWTBotEclipseEditor ed) {
- checkTargetAnnotWithReplac(ed, "@Target({TYPE, FIELD})");
- checkTargetAnnotWithReplac(ed, "");
+ private void checkTargetAnnotation(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
+ checkTargetAnnotWithReplac(comp, ed, "@Target({TYPE, FIELD})");
+ checkTargetAnnotWithReplac(comp, ed, "");
}
- private void checkTargetAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
- CDIUtil.replaceInEditor(ed, bot, "@Target({TYPE, METHOD, FIELD})",
- replacement);
+ private void checkTargetAnnotWithReplac(CDICOMPONENT comp, SWTBotEclipseEditor ed, String replacement) {
+ switch (comp) {
+ case STEREOSCOPE:
+ case SCOPE:
+ CDIUtil.replaceInEditor(ed, bot,
+ "@Target({TYPE, METHOD, FIELD})", replacement);
+ break;
+ case QUALIFIER:
+ if (replacement.equals("")) {
+ CDIUtil.replaceInEditor(ed, bot,
+ "@Target({TYPE, METHOD, FIELD, PARAMETER})", replacement);
+ } else {
+ CDIUtil.replaceInEditor(ed, bot,
+ "@Target({TYPE, METHOD, PARAMETER, FIELD})", replacement);
+ }
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.ElementType.PARAMETER;", "");
+ break;
+ default:
+ break;
+ }
CDIUtil.replaceInEditor(ed, bot,
"import static java.lang.annotation.ElementType.METHOD;", "");
if (replacement.equals("")) {
@@ -291,15 +343,15 @@
CDIUtil.replaceInEditor(ed, bot,
"import static java.lang.annotation.ElementType.FIELD;", "");
}
- checkSimpleQuickFix(ANNOTATIONS.TARGET, replacement, ed);
+ checkSimpleQuickFix(ANNOTATIONS.TARGET, comp, replacement, ed);
}
- private void checkRetentionAnnotation(SWTBotEclipseEditor ed) {
- checkRetenAnnotWithReplac(ed, "@Retention(CLASS)");
- checkRetenAnnotWithReplac(ed, "");
+ private void checkRetentionAnnotation(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
+ checkRetenAnnotWithReplac(comp, ed, "@Retention(CLASS)");
+ checkRetenAnnotWithReplac(comp, ed, "");
}
- private void checkRetenAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
+ private void checkRetenAnnotWithReplac(CDICOMPONENT comp, SWTBotEclipseEditor ed, String replacement) {
CDIUtil.replaceInEditor(ed, bot, "@Retention(RUNTIME)", replacement);
if (replacement.equals("@Retention(CLASS)")) {
CDIUtil.replaceInEditor(ed, bot,
@@ -313,68 +365,161 @@
"import java.lang.annotation.Retention;", "");
}
- checkSimpleQuickFix(ANNOTATIONS.RETENTION, replacement, ed);
+ checkSimpleQuickFix(ANNOTATIONS.RETENTION, comp, replacement, ed);
}
- private void checkNamedAnnotation(SWTBotEclipseEditor ed) {
+ private void checkNamedAnnotation(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
prepareNamedAnnotation(ed, true);
- checkNamedAnnotWithReplac(ed, "@Named");
+ checkNamedAnnotWithReplac(comp, ed, "@Named");
prepareNamedAnnotation(ed, false);
prepareNamedAnnotation(ed, true);
- checkNamedAnnotWithReplac(ed, "");
+ checkNamedAnnotWithReplac(comp, ed, "");
}
- private void checkNamedAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
- checkSimpleQuickFix(ANNOTATIONS.NAMED, replacement, ed);
+ private void checkNamedAnnotWithReplac(CDICOMPONENT comp, SWTBotEclipseEditor ed, String replacement) {
+ checkSimpleQuickFix(ANNOTATIONS.NAMED, comp, replacement, ed);
}
- private void checkTypedAnnotation(SWTBotEclipseEditor ed) {
+ private void checkTypedAnnotation(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
prepareTypedAnnotation(ed);
- checkTypedAnnotWithReplac(ed, "");
+ checkTypedAnnotWithReplac(comp, ed, "");
}
- private void checkTypedAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
- checkSimpleQuickFix(ANNOTATIONS.TYPED, replacement, ed);
+ private void checkTypedAnnotWithReplac(CDICOMPONENT comp, SWTBotEclipseEditor ed, String replacement) {
+ checkSimpleQuickFix(ANNOTATIONS.TYPED, comp, replacement, ed);
}
-
- private void checkSimpleQuickFix(ANNOTATIONS annonType, String replacement,
+
+ private void checkConstructor(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
+ prepareInjectAnnot(ed);
+ checkConstructorWithReplac(comp, ed, "@Disposes");
+ checkConstructorWithReplac(comp, ed, "@Observes");
+ }
+
+ private void checkConstructorWithReplac(CDICOMPONENT comp, SWTBotEclipseEditor ed,
+ String replacement) {
+ ed.toTextEditor().insertText(6 , 15, replacement + " ");
+ dispObserCompletion(comp, ed, replacement);
+ }
+
+ private void checkProducerMethod(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
+ prepareProducer(ed);
+ checkProducerWithReplac(comp, ed, "@Disposes");
+ checkProducerWithReplac(comp, ed, "@Observes");
+ }
+
+ private void checkProducerWithReplac(CDICOMPONENT comp, SWTBotEclipseEditor ed, String replacement) {
+ ed.toTextEditor().insertText(11, 29, replacement + " ");
+ dispObserCompletion(comp, ed, replacement);
+ }
+
+ private void checkObserverDisposerMethod(CDICOMPONENT comp, SWTBotEclipseEditor ed) {
+ prepareObserverDisposer(ed);
+ checkObserverDisposerWithReplac(comp, ed, "@Disposes");
+ checkObserverDisposerWithReplac(comp, ed, "@Observes");
+ }
+
+ private void checkObserverDisposerWithReplac(CDICOMPONENT comp,
+ SWTBotEclipseEditor ed, String replacement) {
+ ed.toTextEditor().insertText(10, 20, replacement + " ");
+ dispObserCompletion(comp, ed, replacement);
+ }
+
+ private void dispObserCompletion(CDICOMPONENT comp, SWTBotEclipseEditor ed, String replacement) {
+ ed.toTextEditor().insertText(2 , 0, "import javax.enterprise." +
+ (replacement.contains("Disposes")?"inject.":"event.") +
+ (replacement.substring(1) + ";" + LINE_SEPARATOR));
+ bot.sleep(Timing.time1S());
+ ed.save();
+ ANNOTATIONS annonType = (replacement.equals("@Disposes")?ANNOTATIONS.DISPOSES:ANNOTATIONS.OBSERVES);
+ checkSimpleQuickFix(annonType, comp, replacement, ed);
+ }
+
+
+ private void checkSimpleQuickFix(ANNOTATIONS annonType, CDICOMPONENT comp, String replacement,
SWTBotEclipseEditor ed) {
- if (annonType == ANNOTATIONS.NAMED || annonType == ANNOTATIONS.TYPED) {
- problemsTrees = ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
- + PROJECT_NAME, "S1.java", "CDI Problem");
+ String className = null;
+ setClassName(comp, className);
+ problemsTrees = getProblems(annonType, className);
+ assertTrue(problemsTrees.length != 0);
+ resolve(annonType, comp, replacement, ed);
+ problemsTrees = getProblems(annonType, className);
+ assertTrue(problemsTrees.length == 0);
+ }
+
+ private void setClassName(CDICOMPONENT comp, String className) {
+ switch (comp) {
+ case STEREOSCOPE:
+ className = "S1.java";
+ break;
+ case QUALIFIER:
+ className = "Q2.java";
+ break;
+ case SCOPE:
+ className = "Scope1.java";
+ break;
+ case BEAN:
+ className = "MyBean.java";
+ break;
+ default:
+ break;
+ }
+ }
+
+ private SWTBotTreeItem[] getProblems(ANNOTATIONS annonType, String className) {
+ SWTBotTreeItem[] problemsTree;
+ switch (annonType) {
+ case NAMED:
+ case TYPED:
+ case DISPOSES:
+ case OBSERVES:
+ problemsTree = ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
+ + PROJECT_NAME, className, "CDI Problem");
+ break;
+ default:
+ problemsTree = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
+ + PROJECT_NAME, className, "CDI Problem");
+ break;
+ }
+ return problemsTree;
+ }
+
+ private void resolve(ANNOTATIONS annonType, CDICOMPONENT comp, String replacement,
+ SWTBotEclipseEditor ed) {
+ boolean chooseFirstOption = true;
+ if (annonType == ANNOTATIONS.NAMED && replacement.equals("")) {
+ chooseFirstOption = false;
} else {
- problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
- + PROJECT_NAME, "S1.java", "CDI Problem");
- }
- assertTrue(problemsTrees.length == 1);
- if (annonType != ANNOTATIONS.NAMED) {
- CDIUtil.resolveQuickFix(problemsTrees[0], bot, util);
- if (annonType == ANNOTATIONS.RETENTION) {
- if (replacement.equals("@Retention(CLASS)")) {
- CDIUtil.replaceInEditor(ed, bot,
- "import static java.lang.annotation.RetentionPolicy.CLASS;","");
+ if ((comp == CDICOMPONENT.BEAN && annonType == ANNOTATIONS.DISPOSES) ||
+ (comp == CDICOMPONENT.BEAN && annonType == ANNOTATIONS.OBSERVES)) {
+ if (problemsTrees[0].getText().contains("Producer method has a parameter annotated "
+ + replacement) ||
+ problemsTrees[0].getText().contains("method cannot be annotated @Inject")) {
+ chooseFirstOption = false;
}
}
- } else {
- if (replacement.equals("@Named")) {
- CDIUtil.resolveQuickFix(problemsTrees[0], bot, util);
- } else {
- CDIUtil.openQuickFix(problemsTrees[0], bot);
- bot.table(0).click(1, 0);
- assertFalse(bot.button("Finish").isEnabled());
- bot.table(1).getTableItem(0).check();
- assertTrue(bot.button("Finish").isEnabled());
- bot.clickButton("Finish");
- bot.sleep(Timing.time2S());
- util.waitForNonIgnoredJobs();
+ }
+ resolveWithAnnonType(annonType, replacement, chooseFirstOption?0:1);
+ }
+
+ private void resolveWithAnnonType(ANNOTATIONS annonType, String replacement, int index) {
+ CDIUtil.openQuickFix(problemsTrees[0], bot);
+ bot.table(0).click(index, 0);
+ assertFalse(bot.button("Finish").isEnabled());
+ bot.table(1).getTableItem(0).check();
+ assertTrue(bot.button("Finish").isEnabled());
+ bot.clickButton("Finish");
+ bot.sleep(Timing.time1S());
+ util.waitForNonIgnoredJobs();
+ afterResolveclearImports(annonType, replacement);
+ }
+
+ private void afterResolveclearImports(ANNOTATIONS annonType, String replacement) {
+ if (annonType == ANNOTATIONS.RETENTION) {
+ if (replacement.equals("@Retention(CLASS)")) {
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.RetentionPolicy.CLASS;","");
}
}
- problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
- + PROJECT_NAME, "S1.java", "CDI Problem");
- assertTrue(problemsTrees.length == 0);
- problemsTrees = ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
- + PROJECT_NAME, "S1.java", "CDI Problem");
- assertTrue(problemsTrees.length == 0);
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-08-24 08:50:30 UTC (rev 34216)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-08-24 11:07:52 UTC (rev 34217)
@@ -73,7 +73,7 @@
ed.setText(ed.getText().replace(target +
(replacement.equals("")?System.getProperty("line.separator"):""),
replacement));
- bot.sleep(Timing.time3S());
+ bot.sleep(Timing.time1S());
ed.save();
}
14 years, 7 months
JBoss Tools SVN: r34216 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-08-24 04:50:30 -0400 (Wed, 24 Aug 2011)
New Revision: 34216
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
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/server/internal/AbstractLocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-9574 - initial impl for eap 6 server type
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -41,8 +41,10 @@
import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
import org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
/**
* Manages the extensions for this plugin
@@ -126,7 +128,7 @@
return true;
String[] allTypes = sTypes.split(","); //$NON-NLS-1$
for( int i = 0; i < allTypes.length; i++ ) {
- if( allTypes[i].equals(serverType.getId())) {
+ if( allTypes[i].trim().equals(serverType.getId())) {
return true;
}
}
@@ -366,7 +368,7 @@
return JBossLaunchDelegates;
}
public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer server) {
- if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
+ if( ServerUtil.isJBoss7(server)) {
return JBoss7setupParticipants;
}
return JBossSetupParticipants;
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 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -269,6 +269,7 @@
rtToPortsFile.put(IConstants.AS_70, properties.append(IJBossToolingConstants.DEFAULT_PROPS_70));
rtToPortsFile.put(IConstants.EAP_43, properties.append(IJBossToolingConstants.DEFAULT_PROPS_EAP_43));
rtToPortsFile.put(IConstants.EAP_50, properties.append(IJBossToolingConstants.DEFAULT_PROPS_EAP_50));
+ rtToPortsFile.put(IConstants.EAP_60, properties.append(IJBossToolingConstants.DEFAULT_PROPS_70));
}
private static ArrayList<XPathCategory> loadDefaults(IServer server, String configFolder) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -127,6 +127,7 @@
String typeId = rtType.getId();
if( typeId.equals(IConstants.EAP_50)
|| typeId.equals(IConstants.AS_60)
+ || typeId.equals(IConstants.EAP_60)
|| typeId.equals(IConstants.AS_70)) {
return EnvironmentsManager.getDefault().getEnvironment("JavaSE-1.6"); //$NON-NLS-1$
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
@@ -32,7 +33,11 @@
setAttribute(DEPLOY_DIRECTORY_TYPE, DEPLOY_SERVER);
setAttribute(IJBossToolingConstants.WEB_PORT_DETECT, true);
setAttribute(IJBossToolingConstants.WEB_PORT, IJBossToolingConstants.JBOSS_WEB_DEFAULT_PORT);
- setAttribute(IJBossToolingConstants.STARTUP_POLLER_KEY, JBoss7ManagerServicePoller.POLLER_ID);
+ // In an emergency, we can switch pollers for EAP
+ if( isEAP(getServer()))
+ setAttribute(IJBossToolingConstants.STARTUP_POLLER_KEY, WebPortPoller.WEB_POLLER_ID);
+ else
+ setAttribute(IJBossToolingConstants.STARTUP_POLLER_KEY, JBoss7ManagerServicePoller.POLLER_ID);
}
public boolean hasJMXProvider() {
return false;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -27,6 +27,7 @@
public static final String EAP_RUNTIME_PREFIX = "org.jboss.ide.eclipse.as.runtime.eap."; //$NON-NLS-1$
public static final String EAP_43 = "org.jboss.ide.eclipse.as.runtime.eap.43"; //$NON-NLS-1$
public static final String EAP_50 = "org.jboss.ide.eclipse.as.runtime.eap.50"; //$NON-NLS-1$
+ public static final String EAP_60 = "org.jboss.ide.eclipse.as.runtime.eap.60"; //$NON-NLS-1$
public static final String SERVER_AS_32 = "org.jboss.ide.eclipse.as.32"; //$NON-NLS-1$
public static final String SERVER_AS_40 = "org.jboss.ide.eclipse.as.40"; //$NON-NLS-1$
@@ -38,6 +39,7 @@
public static final String EAP_SERVER_PREFIX = "org.jboss.ide.eclipse.as.eap."; //$NON-NLS-1$
public static final String SERVER_EAP_43 = "org.jboss.ide.eclipse.as.eap.43"; //$NON-NLS-1$
public static final String SERVER_EAP_50 = "org.jboss.ide.eclipse.as.eap.50"; //$NON-NLS-1$
+ public static final String SERVER_EAP_60 = "org.jboss.ide.eclipse.as.eap.60"; //$NON-NLS-1$
public static final String DEPLOY_ONLY_RUNTIME = "org.jboss.ide.eclipse.as.runtime.stripped"; //$NON-NLS-1$
public static final String DEPLOY_ONLY_SERVER = "org.jboss.ide.eclipse.as.systemCopyServer"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -95,35 +95,13 @@
return p;
}
-// public static void cloneConfigToMetadata(IServer server, IProgressMonitor monitor) {
-// IPath dest = JBossServerCorePlugin.getServerStateLocation(server);
-// dest = dest.append(IJBossServerConstants.CONFIG_IN_METADATA);
-// IRuntime rt = server.getRuntime();
-// IJBossServerRuntime jbsrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-// IPath src = rt.getLocation().append(IJBossServerConstants.SERVER).append(jbsrt.getJBossConfiguration());
-// dest.toFile().mkdirs();
-//
-// File[] subFiles = src.toFile().listFiles();
-// dest.toFile().mkdirs();
-// String[] excluded = IJBossServerConstants.JBOSS_TEMPORARY_FOLDERS;
-// for (int i = 0; i < subFiles.length; i++) {
-// boolean found = false;
-// for( int j = 0; j < excluded.length; j++)
-// if( subFiles[i].getName().equals(excluded[j]))
-// found = true;
-// if( !found ) {
-// File newDest = new File(dest.toFile(), subFiles[i].getName());
-// FileUtil.fileSafeCopy(subFiles[i], newDest, null);
-// }
-// }
-// }
-
public static boolean isJBoss7(IServer server) {
return isJBoss7(server.getServerType());
}
public static boolean isJBoss7(IServerType type) {
- return type.getId().equals(IJBossToolingConstants.SERVER_AS_70);
+ return type.getId().equals(IJBossToolingConstants.SERVER_AS_70)
+ || type.getId().equals(IJBossToolingConstants.SERVER_EAP_60);
}
public static void createStandardFolders(IServer server) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.properties 2011-08-24 08:50:30 UTC (rev 34216)
@@ -40,6 +40,10 @@
jboss.eap.version.50.description=JBoss Enterprise Application Platform (EAP) 5.x
jboss.eap.version.50.runtime.name=JBoss Enterprise Application Platform 5.x Runtime
+jboss.eap.version.60.name=JBoss Enterprise Application Platform 6.x
+jboss.eap.version.60.description=JBoss Enterprise Application Platform (EAP) 6.x
+jboss.eap.version.60.runtime.name=JBoss Enterprise Application Platform 6.x Runtime
+
deploy.runtime.name=Deploy Only Runtime
deploy.runtime.description=A runtime provided to allow a deploy-only server the ability to deploy all project types.
@@ -49,8 +53,9 @@
Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = JBoss AS Core Plug-in
-AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
-AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer
-ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-08-24 08:50:30 UTC (rev 34216)
@@ -163,7 +163,24 @@
stopTimeout="450000"
supportsRemoteHosts="true"/>
+ <serverType
+ behaviourClass="org.jboss.ide.eclipse.as.core.server.internal.v7.DelegatingJBoss7ServerBehavior"
+ class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server"
+ description="%jboss.eap.version.60.description"
+ hasConfiguration="false"
+ id="org.jboss.ide.eclipse.as.eap.60"
+ initialState="stopped"
+ launchConfigId="org.jboss.ide.eclipse.as.core.server.JBoss7StartupConfiguration"
+ launchModes="run,debug,profile"
+ name="%jboss.eap.version.60.name"
+ runtime="true"
+ runtimeTypeId="org.jboss.ide.eclipse.as.runtime.eap.60"
+ startBeforePublish="false"
+ startTimeout="450000"
+ stopTimeout="450000"
+ supportsRemoteHosts="true"/>
+
<serverType
behaviourClass="org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior"
class="org.jboss.ide.eclipse.as.core.server.internal.DeployableServer"
@@ -593,6 +610,60 @@
</moduleType>
</runtimeType>
+ <runtimeType
+ vendor="%enterpriseProviderName"
+ class="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7ServerRuntime"
+ description="%jboss.eap.version.60.description"
+ name="%jboss.eap.version.60.runtime.name"
+ id="org.jboss.ide.eclipse.as.runtime.eap.60"
+ version="6.0">
+ <moduleType
+ types="jst.appclient"
+ versions="5.0, 6.0"/>
+ <moduleType
+ types="wst.web"
+ versions="1.0,1.2,1.3,1.4"/>
+ <moduleType
+ types="jst.web"
+ versions="2.2, 2.3, 2.4, 2.5, 3.0"/>
+ <moduleType
+ types="jst.ejb"
+ versions="1.0, 1.1, 2.0, 2.1, 3.0, 3.1"/>
+ <moduleType
+ types="jst.ear"
+ versions="1.2, 1.3, 1.4, 5.0, 6.0"/>
+ <moduleType
+ types="jst.connector"
+ versions="1.0, 1.5, 1.6"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
+ <moduleType
+ types="jboss.package"
+ versions="1.0"/>
+ <moduleType
+ types="jboss.singlefile"
+ versions="1.0"/>
+ <moduleType
+ types="jst.jboss.esb"
+ versions="4.2,4.3,4.4,4.5,4.6,4.7,4.9"/>
+ <moduleType
+ types="jst.jboss.sar"
+ versions="1.0"/>
+ <moduleType
+ types="jbt.bpel.module"
+ versions="1.1, 2.0">
+ </moduleType>
+ <moduleType
+ types="bpel.module"
+ versions="1.1, 2.0">
+ </moduleType>
+ <moduleType
+ types="jboss.osgi"
+ versions="1.0">
+ </moduleType>
+
+ </runtimeType>
<runtimeType
@@ -776,7 +847,7 @@
class="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagerServicePoller"
id="org.jboss.ide.eclipse.as.core.server.JBoss7ManagerServicePoller"
name="JBoss 7 Manager Service"
- serverTypes="org.jboss.ide.eclipse.as.70"
+ serverTypes="org.jboss.ide.eclipse.as.70, org.jboss.ide.eclipse.as.eap.60"
supportsShutdown="true"
supportsStartup="true">
</serverPoller>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7ServerWizardFragment.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -8,6 +8,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
@@ -16,6 +18,7 @@
import org.eclipse.wst.server.core.TaskModel;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
+import org.jboss.ide.eclipse.as.ui.IPreferenceKeys;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -41,11 +44,12 @@
protected void fillWidgets() {
IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+
if (rt != null) {
try {
fillNameWidgets(rt);
fillHomeDir(rt);
- fillJREWidgets(getRuntime());
+ fillJREWidgets(rt);
} catch (Exception e) {
IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID, MessageFormat.format(Messages.JBoss7ServerWizardFragment_could_not_create_ui, rt.getName()), e);
JBossServerUIPlugin.getDefault().getLog().log(status);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2011-08-24 08:50:30 UTC (rev 34216)
@@ -195,6 +195,8 @@
String locationDefault = Platform.getOS().equals(Platform.WS_WIN32)
? "c:/program files/jboss-" : "/usr/bin/jboss-"; //$NON-NLS-1$ //$NON-NLS-2$
+ if( isEAP() )
+ locationDefault += "eap-"; //$NON-NLS-1$
String version = rt.getRuntimeType().getVersion();
locationDefault += version + ".x"; //$NON-NLS-1$
homeDir = (value != null && value.length() != 0) ? value : locationDefault;
@@ -204,12 +206,16 @@
}
homeDirText.setText(homeDir);
- ((IRuntimeWorkingCopy)rt).setLocation(new Path(homeDir));
- homeDirText.setEditable(true);
- homeDirButton.setEnabled(true);
+ boolean isWC = rt instanceof IRuntimeWorkingCopy;
+ if( isWC ) {
+ ((IRuntimeWorkingCopy)rt).setLocation(new Path(homeDir));
+ }
+ homeDirText.setEnabled(isWC);
+ homeDirButton.setEnabled(isWC);
}
- protected void fillConfigWidgets(IJBossServerRuntime jbsrt) {
+ protected void fillConfigWidgets(IRuntime rt) {
+ IJBossServerRuntime jbsrt = getRuntime();
String dirText = jbsrt.getConfigLocation();
configDirText.setText(dirText == null ? IConstants.SERVER : dirText);
configurations.setConfiguration(jbsrt.getJBossConfiguration() == null
@@ -217,7 +223,8 @@
configurations.getTable().setVisible(true);
}
- protected void fillJREWidgets(IJBossServerRuntime jbsrt) {
+ protected void fillJREWidgets(IRuntime rt) {
+ IJBossServerRuntime jbsrt = getRuntime();
if (jbsrt.isUsingDefaultJRE()) {
jreCombo.select(0);
} else {
@@ -235,13 +242,17 @@
jreComboIndex = jreCombo.getSelectionIndex();
if( jreCombo.getSelectionIndex() < 0 && jreCombo.getItemCount() > 0)
jreCombo.select(0);
+
+ boolean isWC = rt instanceof IRuntimeWorkingCopy;
+ jreCombo.setEnabled(isWC);
+ jreButton.setEnabled(isWC);
}
protected void fillWidgets() {
- IJBossServerRuntime rt = getRuntime();
+ IRuntime rt = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
if (rt != null) {
- fillNameWidgets(rt.getRuntime());
- fillHomeDir(rt.getRuntime());
+ fillNameWidgets(rt);
+ fillHomeDir(rt);
fillConfigWidgets(rt);
fillJREWidgets(rt);
}
@@ -679,6 +690,11 @@
v = "6.";
if( !isEAP() && v.startsWith("7."))
v = "7.";
+ if( isEAP() && v.startsWith("6."))
+ v = "7.";
+ if( !isEAP() && v.startsWith("7."))
+ v = "7.";
+
return version.startsWith(v) ? null : NLS.bind(Messages.rwf_homeIncorrectVersion, v, version);
}
@@ -780,13 +796,14 @@
public void performFinish(IProgressMonitor monitor) throws CoreException {
exit();
- IRuntimeWorkingCopy r = (IRuntimeWorkingCopy) getTaskModel().getObject(
- TaskModel.TASK_RUNTIME);
- IRuntime saved = r.save(false, new NullProgressMonitor());
- Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
- prefs.setValue(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + saved.getRuntimeType().getId(), homeDir);
-
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, saved);
+ IRuntime rt = (IRuntime)getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ if( rt instanceof IRuntimeWorkingCopy ) {
+ IRuntimeWorkingCopy r = (IRuntimeWorkingCopy) rt;
+ IRuntime saved = r.save(false, new NullProgressMonitor());
+ Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ prefs.setValue(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + saved.getRuntimeType().getId(), homeDir);
+ getTaskModel().putObject(TaskModel.TASK_RUNTIME, saved);
+ }
}
public boolean isComplete() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.properties 2011-08-24 08:50:30 UTC (rev 34216)
@@ -23,9 +23,10 @@
NavigatorContent_XMLConfiguration=XML Configuration
NavigatorContent_JMX=JMX
-AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
-AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-JBossServer6AndBelow=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
-AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.eap.60
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.eap.60,org.jboss.ide.eclipse.as.systemCopyServer
+RuntimeTypesJBoss6OrLower=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
+ServerTypesJBoss6OrLower=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.70
-ServerTypesJBoss7=org.jboss.ide.eclipse.as.70
\ No newline at end of file
+ServerTypesJBoss7=org.jboss.ide.eclipse.as.70,org.jboss.ide.eclipse.as.eap.60
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-08-24 06:58:46 UTC (rev 34215)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-08-24 08:50:30 UTC (rev 34216)
@@ -31,22 +31,17 @@
point="org.eclipse.wst.server.ui.wizardFragments">
<fragment
class="org.jboss.ide.eclipse.as.ui.wizards.JBossRuntimeWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50,org.jboss.ide.eclipse.as.runtime.60"
+ typeIds="%RuntimeTypesJBoss6OrLower"
id="org.jboss.ide.eclipse.as.ui.JBossRuntimeWizardFragment"/>
<fragment
class="org.jboss.ide.eclipse.as.ui.wizards.JBoss7ServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.jboss7ServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.runtime.70"/>
+ typeIds="%ServerTypesJBoss7"/>
<fragment
class="org.jboss.ide.eclipse.as.ui.wizards.JBossServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.jbossServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.60"/>
- <!--
+ typeIds="%ServerTypesJBoss6OrLower"/>
<fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.JBoss7ServerWizardFragment"
- id="org.jboss.ide.eclipse.as.ui.jboss7ServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.70"/> -->
- <fragment
class="org.jboss.ide.eclipse.as.ui.wizards.StrippedServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.strippedServerWizardFragment"
typeIds="org.jboss.ide.eclipse.as.systemCopyServer"/>
@@ -181,7 +176,7 @@
id="org.jboss.ide.eclipse.as.ui.editor.passwordSection"
insertionId="org.eclipse.wst.server.editor.overview.left"
order="10"
- typeIds="%JBossServer6AndBelow"/>
+ typeIds="%ServerTypesJBoss6OrLower"/>
<section
class="org.jboss.ide.eclipse.as.ui.editor.ServerModeSection"
id="org.jboss.ide.eclipse.as.ui.editor.serverModeSection"
@@ -268,7 +263,7 @@
point="org.jboss.ide.eclipse.as.ui.ServerEditorPortSection">
<section
class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JNDIPortEditorExtension"
- serverIds="%JBossServer6AndBelow">
+ serverIds="%ServerTypesJBoss6OrLower">
</section>
<section
class="org.jboss.ide.eclipse.as.ui.editor.PortSection$WebPortEditorExtension"
@@ -280,7 +275,7 @@
</section>
<section
class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JBoss7ManagementPortEditorExtension"
- serverIds="org.jboss.ide.eclipse.as.70">
+ serverIds="%ServerTypesJBoss7">
</section>
</extension>
14 years, 7 months