JBoss Tools SVN: r37150 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: resources/seam3 and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-12-09 05:09:43 -0500 (Fri, 09 Dec 2011)
New Revision: 37150
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBean.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBeanInjections.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyConfigProd.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyExtendConfig.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean2.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericType.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/openon/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/openon/BeanWithResourceAnnotation.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISeam3AllBotTests.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3GenericOpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3ResourceOpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3TestBase.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/generic/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/Bean.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/ConfigurationPresetTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java
Log:
Huge refactoring Seam3 tests + CDISeam3AllBotTests added + seam3 resources refactoring
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/Bean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/Bean.java.cdi 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/Bean.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -1,19 +0,0 @@
-package cdi;
-
-import java.net.URL;
-
-import javax.inject.Inject;
-
-import org.jboss.seam.solder.resourceLoader.Resource;
-
-public class BeanComponent {
-
- @Inject
- @Resource("WEB-INF/beans.xml")
- URL beansXml;
-
- public ResourceBean() {
- // TODO Auto-generated constructor stub
- }
-
-}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBean.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBean.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,7 @@
+package cdi.seam;
+
+public class MyBeanX {
+
+ public MyBeanX(String s) {}
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBeanInjections.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBeanInjections.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyBeanInjections.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,82 @@
+package cdi.seam;
+
+import javax.inject.Inject;
+
+public class MyBeanInjections {
+
+ /**
+ * Injected method producer MyGenericBean.createMyFirstBean()
+ * Configuration produced by MyConfigurationProducer.getOneConfig()
+ */
+ @Inject
+ MyBean first1;
+
+ /**
+ * Injected method producer MyGenericBean.createMyFirstBean()
+ * Configuration produced by MyConfigurationProducer.getSecondConfig()
+ */
+ @Inject
+ @Qualifier1
+ MyBean first2;
+
+ /**
+ * Injected method producer MyGenericBean.createMyFirstBean()
+ * Configuration produced by MyExtendedConfiguration
+ */
+ @Inject
+ @Qualifier2
+ MyBean first3;
+
+
+
+
+ /**
+ * Injected method producer MyGenericBean.createMySecondBean()
+ * Configuration produced by MyConfigurationProducer.getOneConfig()
+ */
+ @Inject
+ MyBean2 second1;
+
+ /**
+ * Injected method producer MyGenericBean.createMySecondBean()
+ * Configuration produced by MyConfigurationProducer.getSecondConfig()
+ */
+ @Inject
+ @Qualifier1
+ MyBean2 second2;
+
+ /**
+ * Injected method producer MyGenericBean.createMySecondBean()
+ * Configuration produced by MyExtendedConfiguration
+ */
+ @Inject
+ @Qualifier2
+ MyBean2 second3;
+
+
+
+
+ /**
+ * Injected field producer MyGenericBean.myThirdBean
+ * Configuration produced by MyConfigurationProducer.getOneConfig()
+ */
+ @Inject
+ MyBean3 third1;
+
+ /**
+ * Injected field producer MyGenericBean.myThirdBean
+ * Configuration produced by MyConfigurationProducer.getSecondConfig()
+ */
+ @Inject
+ @Qualifier1
+ MyBean3 third2;
+
+ /**
+ * Injected field producer MyGenericBean.myThirdBean
+ * Configuration produced by MyExtendedConfiguration
+ */
+ @Inject
+ @Qualifier2
+ MyBean3 third3;
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyConfigProd.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyConfigProd.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyConfigProd.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,29 @@
+package cdi.seam;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.Produces;
+
+public class MyConfigurationProducer {
+
+ /**
+ * Configuration created by field producer.
+ */
+ @Produces
+ @MyGenericType("first")
+ @Default
+ MyConfiguration getOneConfig() {
+ return null;
+ }
+
+ /**
+ * Configuration created by method producer with specified scope.
+ */
+ @Produces
+ @MyGenericType("second")
+ @Qualifier1
+ @SessionScoped
+ MyConfiguration getSecondConfig() {
+ return null;
+ }
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyExtendConfig.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyExtendConfig.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyExtendConfig.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,9 @@
+package cdi.seam;
+
+@MyGenericType("third")
+@Qualifier2
+public class MyExtendedConfiguration extends MyConfiguration {
+ public MyExtendedConfiguration() {
+ super("");
+ }
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,27 @@
+package cdi.seam;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.jboss.seam.solder.bean.generic.ApplyScope;
+import org.jboss.seam.solder.bean.generic.Generic;
+import org.jboss.seam.solder.bean.generic.GenericConfiguration;
+
+(a)GenericConfiguration(MyGenericType.class)
+public class MyGenericBean {
+ @Inject
+ @Generic
+ MyConfiguration config;
+
+ @Inject
+ MyGenericType type;
+
+ @Produces @ApplyScope
+ MyBean createMyFirstBean() {
+ return new MyBean("bean1");
+ }
+
+ @Produces @ApplyScope
+ MyBean3 myThirdBean = new MyBean3("bean3");
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean2.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean2.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericBean2.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,35 @@
+package cdi.seam;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.jboss.seam.solder.bean.generic.Generic;
+import org.jboss.seam.solder.bean.generic.GenericConfiguration;
+
+(a)GenericConfiguration(MyGenericType.class)
+public class MyGenericBean2 {
+ @Inject
+ @Generic
+ MyConfiguration config;
+
+ @Inject
+ @Generic
+ MyBean c;
+
+ @Inject
+ void setMyBean(@Generic MyBean parameter1) {}
+
+ @Inject
+ @Generic
+ MyBean2 c2;
+
+ @Inject
+ @Generic
+ MyBean3 c3;
+
+ @Produces
+ MyBean2 createMySecondBean() {
+ return new MyBean2("");
+ }
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericType.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericType.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/generic/MyGenericType.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,8 @@
+package cdi.seam;
+
+import org.jboss.seam.solder.bean.generic.GenericType;
+
+(a)GenericType(MyConfiguration.class)
+public @interface MyGenericType {
+ String value();
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/openon/BeanWithResourceAnnotation.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/openon/BeanWithResourceAnnotation.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/seam3/openon/BeanWithResourceAnnotation.java.cdi 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,15 @@
+package cdi.seam;
+
+import java.net.URL;
+
+import javax.inject.Inject;
+
+import org.jboss.seam.solder.resourceLoader.Resource;
+
+public class BeanComponent {
+
+ @Inject
+ @Resource("WEB-INF/beans.xml")
+ URL beansXml;
+
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -26,7 +26,8 @@
import org.jboss.tools.cdi.bot.test.quickfix.test.QualifierValidationQuickFixTest;
import org.jboss.tools.cdi.bot.test.quickfix.test.ScopeValidationQuickFixTest;
import org.jboss.tools.cdi.bot.test.quickfix.test.StereotypeValidationQuickFixTest;
-import org.jboss.tools.cdi.bot.test.seam3.Seam3Test;
+import org.jboss.tools.cdi.bot.test.seam3.Seam3GenericOpenOnTest;
+import org.jboss.tools.cdi.bot.test.seam3.Seam3ResourceOpenOnTest;
import org.jboss.tools.cdi.bot.test.uiutils.SWTEclipseCDIExtUtil;
import org.jboss.tools.cdi.bot.test.wizard.ConfigurationPresetTest;
import org.jboss.tools.cdi.bot.test.wizard.FacetTest;
@@ -53,7 +54,7 @@
* JAVA=1.6,/space/java/sdk/jdk1.6.0_22
*
*
- * Suite duration: aprox. 28min
+ * Suite duration: aprox. 29min
*
* @author Lukas Jungmann
* @author Jaroslav Jankovic
@@ -80,7 +81,8 @@
IBindingValidationQuickFixTest.class,
OpenOnTest.class,
FindObserverForEventTest.class,
- Seam3Test.class
+ Seam3ResourceOpenOnTest.class,
+ Seam3GenericOpenOnTest.class,
})
public class CDIAllBotTests extends CDITestBase {
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISeam3AllBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISeam3AllBotTests.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISeam3AllBotTests.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2010-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.cdi.bot.test;
+
+import org.jboss.tools.cdi.bot.test.seam3.Seam3GenericOpenOnTest;
+import org.jboss.tools.cdi.bot.test.seam3.Seam3ResourceOpenOnTest;
+import org.jboss.tools.cdi.bot.test.seam3.Seam3TestBase;
+import org.jboss.tools.cdi.bot.test.uiutils.SWTEclipseCDIExtUtil;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.types.ViewType;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * This test suite requires JBoss AS 6 or newer
+ *
+ * System properties:
+ * -Dswtbot.test.properties.file=$PATH
+ * -Dusage_reporting_enabled=$BOOLEAN
+ *
+ * Format of swtbot.properties file:
+ * SERVER=EAP|JBOSS_AS,<server version>,<jre version to run with>|default,<server home>
+ *
+ * Sample swtbot.properties file:
+ *
+ * SERVER=JBOSS_AS,6.0,default,/home/jjankovi/Dokumenty/Red_Hat_Stuff/Runtimes/jboss-6.0.0.Final
+ * JAVA=1.6,/space/java/sdk/jdk1.6.0_22
+ *
+ *
+ * Suite duration: aprox. 3min
+ *
+ * @author Jaroslav Jankovic
+ */
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({
+ Seam3ResourceOpenOnTest.class,
+ Seam3GenericOpenOnTest.class,
+ })
+public class CDISeam3AllBotTests extends Seam3TestBase {
+
+ /*
+ * init method "setup()" shows a project explorer view as default,
+ * disable folding (due to easier source code editing)
+ */
+ @BeforeClass
+ public static void setUpSuite() {
+ eclipse.showView(ViewType.PROJECT_EXPLORER);
+ SWTEclipseCDIExtUtil.disableFolding(bot, util);
+ }
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,20 +11,34 @@
package org.jboss.tools.cdi.bot.test;
+import java.util.logging.Logger;
+
import org.jboss.tools.cdi.bot.test.uiutils.BeansXMLValidationHelper;
import org.jboss.tools.cdi.bot.test.uiutils.CDIProjectHelper;
import org.jboss.tools.cdi.bot.test.uiutils.CDIWizardHelper;
import org.jboss.tools.cdi.bot.test.uiutils.EditorResourceHelper;
import org.jboss.tools.cdi.bot.test.uiutils.LibraryHelper;
import org.jboss.tools.cdi.bot.test.uiutils.OpenOnHelper;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.After;
import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+@Require(clearProjects = true, perspective = "Java EE",
+ server = @Server(state = ServerState.NotRunning,
+ version = "6.0", operator = ">="))
+ @RunWith(RequirementAwareSuite.class)
+ @SuiteClasses({ CDIAllBotTests.class })
public class CDITestBase extends CDIBase {
private String projectName = "CDIProject";
private String packageName = "cdi";
protected final String LINE_SEPARATOR = System.getProperty("line.separator");
+ protected static final Logger LOGGER = Logger.getLogger(CDITestBase.class.getName());
protected static CDIProjectHelper projectHelper = new CDIProjectHelper();
protected static BeansXMLValidationHelper beansHelper = new BeansXMLValidationHelper();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -13,24 +13,16 @@
import java.util.Arrays;
import java.util.List;
-import java.util.logging.Logger;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.helper.ContentAssistHelper;
import org.jboss.tools.ui.bot.ext.parts.ContentAssistBot;
import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on code completion in beans.xml
@@ -39,15 +31,7 @@
*
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class BeansXMLCompletionTest extends CDITestBase {
-
- private static final Logger LOGGER = Logger
- .getLogger(BeansXMLCompletionTest.class.getName());
private static final List<String> BEANS_XML_TAGS = Arrays.asList(
"alternatives", "decorators", "interceptors");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,18 +11,11 @@
package org.jboss.tools.cdi.bot.test.beansxml;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.annotations.BeansXMLValidationErrors;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on beans validation in beans.xml
@@ -31,11 +24,6 @@
*
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class BeansXMLValidationTest extends CDITestBase {
private final String someBean = "Bean1";
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -16,7 +16,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -24,6 +23,7 @@
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.editor.BeansEditor.Item;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
@@ -50,14 +50,13 @@
* @author jjankovi
*/
@Require(clearProjects = false, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
+server = @Server(state = ServerState.NotRunning,
+version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
+@SuiteClasses({ CDIAllBotTests.class, CDISmokeBotTests.class })
public class BeansEditorTest extends CDITestBase {
private static final String descPath = "WebContent/WEB-INF/beans.xml";
- private static final Logger LOGGER = Logger.getLogger(BeansEditorTest.class.getName());
@BeforeClass
public static void setup() {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -15,20 +15,13 @@
import java.util.List;
import java.util.Map;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardBaseExt;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.SearchNamedDialogWizard;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.After;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on @Named searching
@@ -36,11 +29,7 @@
* @author Jaroslav Jankovic
*
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
+
public class NamedComponentsSearchingTest extends CDITestBase {
private final CDIWizardBaseExt wizardExt = new CDIWizardBaseExt();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -14,18 +14,11 @@
import java.util.Arrays;
import java.util.Collection;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.jsf.JSFTestBase;
import org.jboss.tools.cdi.bot.test.uiutils.CollectionsUtil;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.After;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on @Named refactoring
@@ -33,11 +26,7 @@
* @author Jaroslav Jankovic
*
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
+
public class NamedRefactoringTest extends JSFTestBase {
private static final String MANAGED_BEAN_1 = "ManagedBean1";
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,19 +11,10 @@
package org.jboss.tools.cdi.bot.test.openon;
-import java.util.logging.Logger;
-
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on finding right observer for event and vice versa
@@ -31,15 +22,8 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class FindObserverForEventTest extends OpenOnBase {
- private static final Logger LOGGER = Logger.getLogger(FindObserverForEventTest.class.getName());
-
@Override
public String getProjectName() {
return "CDIObserverTest";
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,19 +11,10 @@
package org.jboss.tools.cdi.bot.test.openon;
-import java.util.logging.Logger;
-
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on hyperlinks-openons using CDI support
@@ -32,15 +23,8 @@
*
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class OpenOnTest extends OpenOnBase {
-
- private static final Logger LOGGER = Logger.getLogger(OpenOnTest.class.getName());
-
+
@Override
public String getProjectName() {
return "CDIOpenOnTest";
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,17 +11,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.injection;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.EligibleInjectionQuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.After;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test checks if Quick Fix provides useful operations when
@@ -30,11 +23,6 @@
*
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class ProblemEligibleInjectionTest extends EligibleInjectionQuickFixTestBase {
private final String ANIMAL = "Animal";
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI bean component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class BeanValidationQuickFixTest extends QuickFixTestBase {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,16 +11,9 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.BeansXMLQuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of beans.xml
@@ -28,11 +21,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class BeansXMLValidationQuickFixTest extends BeansXMLQuickFixTestBase {
@Override
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI Decorator component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class DecoratorValidationQuickFixTest extends QuickFixTestBase {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI Interceptor Binding component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class IBindingValidationQuickFixTest extends QuickFixTestBase {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI Interceptor component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class InterceptorValidationQuickFixTest extends QuickFixTestBase {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI Qualifier component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class QualifierValidationQuickFixTest extends QuickFixTestBase {
@Override
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI Scope component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class ScopeValidationQuickFixTest extends QuickFixTestBase {
@Override
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.quickfix.test;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.quickfix.base.QuickFixTestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
/**
* Test operates on quick fixes used for validation errors of CDI Stereotype component
@@ -30,11 +23,6 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
public class StereotypeValidationQuickFixTest extends QuickFixTestBase {
@Override
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3GenericOpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3GenericOpenOnTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3GenericOpenOnTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.cdi.bot.test.seam3;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.junit.Test;
+
+/**
+ * Test operates on generic points openOn in Seam3 using CDI tools
+ *
+ * @author jjankovi
+ *
+ */
+
+public class Seam3GenericOpenOnTest extends Seam3TestBase {
+
+ private final String GENERIC_POINT_1 = "MyExtendedConfiguration ";
+ private final String GENERIC_POINT_2 = "MyConfigurationProducer.getOneConfig()";
+ private final String GENERIC_POINT_3 = "MyConfigurationProducer.getSecondConfig()";
+
+ @Override
+ public String getProjectName() {
+ return "Seam3GenericOpenOnTest";
+ }
+
+ /**
+ * https://issues.jboss.org/browse/JBIDE-8692
+ */
+ @Test
+ public void testGenericOpenOn() {
+
+ prepareGenericOpenOn();
+
+ checkFirstOpenOnAndGeneric();
+ checkSecondOpenOnAndGeneric();
+ checkThirdOpenOnAndGeneric();
+
+ String parameter = "MyConfiguration config";
+ String classTitle = "MyGenericBean.java";
+ checkAllGenericPointsForAtribute(parameter, classTitle);
+
+
+ classTitle = "MyGenericBean2.java";
+ String[] atributes = {"MyConfiguration config", "MyBean c", "MyBean2 c2",
+ "MyBean3 c3", "MyBean parameter1"};
+ for (String atribute : atributes) {
+ checkAllGenericPointsForAtribute(atribute, classTitle);
+ }
+
+ }
+
+ /**
+ * wizard.create all necessary components for this test
+ */
+ private void prepareGenericOpenOn() {
+ /**
+ * injectable beans + qualifiers + generic configuration components
+ */
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBean",
+ getPackageName(), null, "/resources/seam3/generic/MyBean.java.cdi");
+ editResourceUtil.replaceInEditor("MyBeanX", "MyBean");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBean2",
+ getPackageName(), null, "/resources/seam3/generic/MyBean.java.cdi");
+ editResourceUtil.replaceInEditor("MyBeanX", "MyBean2");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBean3",
+ getPackageName(), null, "/resources/seam3/generic/MyBean.java.cdi");
+ editResourceUtil.replaceInEditor("MyBeanX", "MyBean3");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyConfiguration",
+ getPackageName(), null, "/resources/seam3/generic/MyBean.java.cdi");
+ editResourceUtil.replaceInEditor("MyBeanX", "MyConfiguration");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyGenericType",
+ getPackageName(), null, "/resources/seam3/generic/MyGenericType.java.cdi");
+
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Qualifier1", getPackageName(), null);
+ wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Qualifier2", getPackageName(), null);
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyExtendedConfiguration",
+ getPackageName(), null, "/resources/seam3/generic/MyExtendConfig.java.cdi");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyConfigurationProducer",
+ getPackageName(), null, "/resources/seam3/generic/MyConfigProd.java.cdi");
+
+ /**
+ * beans which include atributes suggesting opening all the available
+ * generic configurations
+ */
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBeanInjections",
+ getPackageName(), null, "/resources/seam3/generic/MyBeanInjections.java.cdi");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyGenericBean",
+ getPackageName(), null, "/resources/seam3/generic/MyGenericBean.java.cdi");
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyGenericBean2",
+ getPackageName(), null, "/resources/seam3/generic/MyGenericBean2.java.cdi");
+ }
+
+ private void checkFirstOpenOnAndGeneric() {
+ checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getOneConfig");
+ checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean.java", "createMyFirstBean");
+
+ checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getSecondConfig");
+ checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean.java", "createMyFirstBean");
+
+ checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyExtendedConfiguration.java", "MyExtendedConfiguration");
+ checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean.java", "createMyFirstBean");
+ }
+
+ private void checkSecondOpenOnAndGeneric() {
+ checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getOneConfig");
+ checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean2.java", "createMySecondBean");
+
+ checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getSecondConfig");
+ checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean2.java", "createMySecondBean");
+
+ checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyExtendedConfiguration.java", "MyExtendedConfiguration");
+ checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean2.java", "createMySecondBean");
+ }
+
+ private void checkThirdOpenOnAndGeneric() {
+ checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getOneConfig");
+ checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean.java", "myThirdBean");
+
+ checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyConfigurationProducer.java", "getSecondConfig");
+ checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean.java", "myThirdBean");
+
+ checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "Generic Configuration Point",
+ "MyExtendedConfiguration.java", "MyExtendedConfiguration");
+ checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "@Inject Bean",
+ "MyGenericBean.java", "myThirdBean");
+ }
+
+ private void checkOpenOnAndGeneric(String openOnString, String titleName, String chosenOption,
+ String afterOpenOnTitleName, String injectSelectionAtribute) {
+ openOnUtil.openOnByOption(openOnString, titleName, chosenOption);
+ String activeEditor = bot.activeEditor().getTitle();
+ String selectedString = bot.activeEditor().toTextEditor().getSelection();
+ assertTrue(activeEditor, activeEditor.equals(afterOpenOnTitleName));
+ assertTrue(selectedString, selectedString.equals(injectSelectionAtribute));
+ }
+
+ private void checkAllGenericPointsForAtribute(String atribute,
+ String classTitle) {
+ openOnUtil.openOnByOption(atribute, classTitle, "Show All Generic Configuration Points...");
+ bot.sleep(Timing.time1S());
+ SWTBotTable genericPointTable = bot.table(0);
+ assertTrue(checkAllGenericConfPoints(genericPointTable));
+ bot.sleep(Timing.time2S());
+ }
+
+ private boolean checkAllGenericConfPoints(SWTBotTable genericPointTable) {
+ boolean isGenericPoint1Present = false;
+ boolean isGenericPoint2Present = false;
+ boolean isGenericPoint3Present = false;
+ for (int rowIterator = 0; rowIterator < genericPointTable.rowCount(); rowIterator++) {
+ String itemInTable = genericPointTable.getTableItem(rowIterator).getText();
+ if (itemInTable.contains(GENERIC_POINT_1)) {
+ isGenericPoint1Present = true;
+ continue;
+ }
+ if (itemInTable.contains(GENERIC_POINT_2)) {
+ isGenericPoint2Present = true;
+ continue;
+ }
+ if (itemInTable.contains(GENERIC_POINT_3)) {
+ isGenericPoint3Present = true;
+ continue;
+ }
+ }
+ return isGenericPoint1Present && isGenericPoint2Present && isGenericPoint3Present;
+ }
+
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3ResourceOpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3ResourceOpenOnTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3ResourceOpenOnTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.cdi.bot.test.seam3;
+
+
+import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
+import org.junit.Test;
+
+/**
+ * Test operates on resource openOn in Seam3 using CDI tools
+ *
+ * @author Jaroslav Jankovic
+ */
+
+public class Seam3ResourceOpenOnTest extends Seam3TestBase {
+
+ @Override
+ public String getProjectName() {
+ return "Seam3ResourceOpenOnTest";
+ }
+
+ /**
+ * https://issues.jboss.org/browse/JBIDE-8202
+ */
+ @Test
+ public void testResourceOpenOn() {
+
+ String className = "Bean1";
+
+ wizard.createCDIComponent(CDIWizardType.BEANS_XML, "beans.xml", getProjectName() + "/WebContent/WEB-INF", null);
+
+ wizard.createCDIComponentWithContent(CDIWizardType.BEAN, className,
+ getPackageName(), null, "/resources/seam3/openon/BeanWithResourceAnnotation.java.cdi");
+ editResourceUtil.replaceInEditor("BeanComponent", className);
+
+ openOnUtil.openOnByOption("beansXml", className + ".java", "Open Resource");
+
+ String destinationFile = getEd().getTitle();
+ assertTrue("ERROR: redirected to " + destinationFile,
+ destinationFile.equals("beans.xml"));
+
+ editResourceUtil.moveFileInProjectExplorer("beans.xml", getProjectName() + "/WebContent/WEB-INF",
+ getProjectName() + "/WebContent/META-INF");
+ LOGGER.info("bean.xml was moved to META-INF");
+
+ setEd(bot.swtBotEditorExtByTitle(className + ".java"));
+ editResourceUtil.replaceInEditor("WEB", "META");
+ openOnUtil.openOnByOption("beansXml", className + ".java", "Open Resource");
+
+ destinationFile = getEd().getTitle();
+ assertTrue("ERROR: redirected to " + destinationFile,
+ destinationFile.equals("beans.xml"));
+
+ }
+
+}
+
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3Test.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.cdi.bot.test.seam3;
-
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
-import org.jboss.tools.cdi.bot.test.CDITestBase;
-import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite.SuiteClasses;
-
-/**
- * Test operates on seam3 features using CDI tools
- *
- * @author Jaroslav Jankovic
- */
-
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
-@SuiteClasses({ CDIAllBotTests.class })
-public class Seam3Test extends CDITestBase {
-
- private static final Logger LOGGER = Logger.getLogger(Seam3Test.class.getName());
- private final String genericPoint1 = "MyExtendedConfiguration ";
- private final String genericPoint2 = "MyConfigurationProducer.getOneConfig()";
- private final String genericPoint3 = "MyConfigurationProducer.getSecondConfig()";
-
-
- @Override
- public void checkAndCreateProject() {
- if (!projectHelper.projectExists(getProjectName())) {
- projectHelper.createCDIProject(getProjectName());
- addLibrary("seam-solder.jar");
- checkLibrary("seam-solder.jar");
- }
- }
-
- @Override
- public String getProjectName() {
- return "CDISeam3Test";
- }
-
- private String getGenericPackageName() {
- return "org.cdi.generic";
- }
-
-
- /**
- * https://issues.jboss.org/browse/JBIDE-8202
- */
- @Test
- public void testResourceOpenOn() {
-
- String className = "Bean1";
-
- wizard.createCDIComponent(CDIWizardType.BEANS_XML, "beans.xml", getProjectName() + "/WebContent/WEB-INF", null);
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, className,
- getPackageName(), null, "/resources/seam3/Bean.java.cdi");
- editResourceUtil.replaceInEditor("BeanComponent", className);
-
- openOnUtil.openOnByOption("beansXml", className + ".java", "Open Resource");
-
- String destinationFile = getEd().getTitle();
- assertTrue("ERROR: redirected to " + destinationFile,
- destinationFile.equals("beans.xml"));
-
- editResourceUtil.moveFileInProjectExplorer("beans.xml", getProjectName() + "/WebContent/WEB-INF",
- getProjectName() + "/WebContent/META-INF");
- LOGGER.info("bean.xml was moved to META-INF");
-
- setEd(bot.swtBotEditorExtByTitle(className + ".java"));
- editResourceUtil.replaceInEditor("WEB", "META");
- openOnUtil.openOnByOption("beansXml", className + ".java", "Open Resource");
-
- destinationFile = getEd().getTitle();
- assertTrue("ERROR: redirected to " + destinationFile,
- destinationFile.equals("beans.xml"));
-
- }
-
- /**
- * https://issues.jboss.org/browse/JBIDE-8692
- */
- @Test
- public void testGenericOpenOn() {
-
- prepareGenericOpenOn();
-
- checkMyBeanInjections();
-
- checkMyGenericBean();
-
- checkMyGenericBean2();
- }
-
- private void addLibrary(String libraryName) {
- try {
- libraryUtil.addLibraryIntoProject(getProjectName(), libraryName);
- LOGGER.info("Library: \"" + libraryName + "\" copied");
- util.waitForNonIgnoredJobs();
- libraryUtil.addLibraryToProjectsClassPath(getProjectName(), libraryName);
- LOGGER.info("Library: \"" + libraryName + "\" on class path of project\"" + getProjectName() + "\"");
- } catch (IOException exc) {
- LOGGER.log(Level.SEVERE, "Error while adding seam solder library into project");
- }
- }
-
- private void checkLibrary(String libraryName) {
- assertTrue(libraryUtil.isLibraryInProjectClassPath(getProjectName(), libraryName));
- }
-
- /**
- * wizard.create all necessary components for this test
- */
- private void prepareGenericOpenOn() {
- /**
- * injectable beans + qualifiers + generic configuration components
- */
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBean",
- getGenericPackageName(), null, "/resources/generic/MyBean.java.cdi");
- editResourceUtil.replaceInEditor("MyBeanX", "MyBean");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBean2",
- getGenericPackageName(), null, "/resources/generic/MyBean.java.cdi");
- editResourceUtil.replaceInEditor("MyBeanX", "MyBean2");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBean3",
- getGenericPackageName(), null, "/resources/generic/MyBean.java.cdi");
- editResourceUtil.replaceInEditor("MyBeanX", "MyBean3");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyConfiguration",
- getGenericPackageName(), null, "/resources/generic/MyBean.java.cdi");
- editResourceUtil.replaceInEditor("MyBeanX", "MyConfiguration");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyGenericType",
- getGenericPackageName(), null, "/resources/generic/MyGenericType.java.cdi");
-
- wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Qualifier1", getGenericPackageName(), null);
- wizard.createCDIComponent(CDIWizardType.QUALIFIER, "Qualifier2", getGenericPackageName(), null);
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyExtendedConfiguration",
- getGenericPackageName(), null, "/resources/generic/MyExtendConfig.java.cdi");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyConfigurationProducer",
- getGenericPackageName(), null, "/resources/generic/MyConfigProd.java.cdi");
-
- /**
- * beans which include atributes suggesting opening all the available
- * generic configurations
- */
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyBeanInjections",
- getGenericPackageName(), null, "/resources/generic/MyBeanInjections.java.cdi");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyGenericBean",
- getGenericPackageName(), null, "/resources/generic/MyGenericBean.java.cdi");
-
- wizard.createCDIComponentWithContent(CDIWizardType.BEAN, "MyGenericBean2",
- getGenericPackageName(), null, "/resources/generic/MyGenericBean2.java.cdi");
- }
-
- private void checkMyBeanInjections() {
- checkFirstOpenOnAndGeneric();
- checkSecondOpenOnAndGeneric();
- checkThirdOpenOnAndGeneric();
- }
-
- private void checkMyGenericBean() {
- String parameter = "MyConfiguration config";
- String classTitle = "MyGenericBean.java";
- checkAllGenericPointsForAtribute(parameter, classTitle);
- }
-
- private void checkMyGenericBean2() {
- String classTitle = "MyGenericBean2.java";
-
- checkAllGenericPointsForAtribute("MyConfiguration config", classTitle);
-
- checkAllGenericPointsForAtribute("MyBean c", classTitle);
-
- checkAllGenericPointsForAtribute("MyBean2 c2", classTitle);
-
- checkAllGenericPointsForAtribute("MyBean3 c3", classTitle);
-
- checkAllGenericPointsForAtribute("MyBean parameter1", classTitle);
-
- }
- private void checkFirstOpenOnAndGeneric() {
- checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "Generic Configuration Point",
- "MyConfigurationProducer.java", "getOneConfig");
- checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean.java", "createMyFirstBean");
-
- checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "Generic Configuration Point",
- "MyConfigurationProducer.java", "getSecondConfig");
- checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean.java", "createMyFirstBean");
-
- checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "Generic Configuration Point",
- "MyExtendedConfiguration.java", "MyExtendedConfiguration");
- checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean.java", "createMyFirstBean");
- }
-
- private void checkSecondOpenOnAndGeneric() {
- checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "Generic Configuration Point",
- "MyConfigurationProducer.java", "getOneConfig");
- checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean2.java", "createMySecondBean");
-
- checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "Generic Configuration Point",
- "MyConfigurationProducer.java", "getSecondConfig");
- checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean2.java", "createMySecondBean");
-
- checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "Generic Configuration Point",
- "MyExtendedConfiguration.java", "MyExtendedConfiguration");
- checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean2.java", "createMySecondBean");
- }
-
- private void checkThirdOpenOnAndGeneric() {
- checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "Generic Configuration Point",
- "MyConfigurationProducer.java", "getOneConfig");
- checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean.java", "myThirdBean");
-
- checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "Generic Configuration Point",
- "MyConfigurationProducer.java", "getSecondConfig");
- checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean.java", "myThirdBean");
-
- checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "Generic Configuration Point",
- "MyExtendedConfiguration.java", "MyExtendedConfiguration");
- checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "@Inject Bean",
- "MyGenericBean.java", "myThirdBean");
- }
-
- private void checkOpenOnAndGeneric(String openOnString, String titleName, String chosenOption,
- String afterOpenOnTitleName, String injectSelectionAtribute) {
- openOnUtil.openOnByOption(openOnString, titleName, chosenOption);
- String activeEditor = bot.activeEditor().getTitle();
- String selectedString = bot.activeEditor().toTextEditor().getSelection();
- assertTrue(activeEditor, activeEditor.equals(afterOpenOnTitleName));
- assertTrue(selectedString, selectedString.equals(injectSelectionAtribute));
- }
-
- private void checkAllGenericPointsForAtribute(String parameter, String classTitle) {
- openOnUtil.openOnByOption(parameter, classTitle, "Show All Generic Configuration Points...");
- bot.sleep(Timing.time1S());
- SWTBotTable genericPointTable = bot.table(0);
- assertTrue(checkAllGenericConfPoints(genericPointTable));
- //getEd().pressShortcut(Keystrokes.ESC);
- bot.sleep(Timing.time2S());
- }
-
- private boolean checkAllGenericConfPoints(SWTBotTable genericPointTable) {
- boolean isGenericPoint1Present = false;
- boolean isGenericPoint2Present = false;
- boolean isGenericPoint3Present = false;
- for (int rowIterator = 0; rowIterator < genericPointTable.rowCount(); rowIterator++) {
- String itemInTable = genericPointTable.getTableItem(rowIterator).getText();
- if (itemInTable.contains(genericPoint1)) {
- isGenericPoint1Present = true;
- continue;
- }
- if (itemInTable.contains(genericPoint2)) {
- isGenericPoint2Present = true;
- continue;
- }
- if (itemInTable.contains(genericPoint3)) {
- isGenericPoint3Present = true;
- continue;
- }
- }
- return isGenericPoint1Present && isGenericPoint2Present && isGenericPoint3Present;
- }
-
-}
-
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3TestBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3TestBase.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/Seam3TestBase.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.cdi.bot.test.seam3;
+
+import java.io.IOException;
+import java.util.logging.Level;
+
+import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.CDISeam3AllBotTests;
+import org.jboss.tools.cdi.bot.test.CDITestBase;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+@Require(clearProjects = true, perspective = "Java EE",
+server = @Server(state = ServerState.NotRunning,
+version = "6.0", operator = ">="))
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ CDIAllBotTests.class, CDISeam3AllBotTests.class })
+public class Seam3TestBase extends CDITestBase {
+
+ private String projectName = "CDISeam3Project";
+ private String packageName = "cdi.seam";
+
+ protected String getProjectName() {
+ return projectName;
+ }
+
+ protected String getPackageName() {
+ return packageName;
+ }
+
+ @Override
+ public void checkAndCreateProject() {
+ if (!projectHelper.projectExists(getProjectName())) {
+ projectHelper.createCDIProject(getProjectName());
+ addSeamSolderLibrary();
+ }
+ }
+
+ protected void addSeamSolderLibrary() {
+ addLibrary("seam-solder.jar");
+ checkLibrary("seam-solder.jar");
+ }
+
+ private void addLibrary(String libraryName) {
+ try {
+ libraryUtil.addLibraryIntoProject(getProjectName(), libraryName);
+ LOGGER.info("Library: \"" + libraryName + "\" copied");
+ util.waitForNonIgnoredJobs();
+ libraryUtil.addLibraryToProjectsClassPath(getProjectName(), libraryName);
+ LOGGER.info("Library: \"" + libraryName + "\" on class path of project\"" + getProjectName() + "\"");
+ } catch (IOException exc) {
+ LOGGER.log(Level.SEVERE, "Error while adding seam solder library into project");
+ }
+ }
+
+ private void checkLibrary(String libraryName) {
+ assertTrue(libraryUtil.isLibraryInProjectClassPath(getProjectName(), libraryName));
+ }
+
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/ConfigurationPresetTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/ConfigurationPresetTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/ConfigurationPresetTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,17 +12,10 @@
package org.jboss.tools.cdi.bot.test.wizard;
-import java.util.logging.Logger;
-
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
/**
@@ -31,15 +24,9 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class , CDISmokeBotTests.class })
public class ConfigurationPresetTest extends CDITestBase {
- private static final Logger LOGGER = Logger.getLogger(ConfigurationPresetTest.class.getName());
-
@Override
public void checkAndCreateProject() {
if (!projectHelper.projectExists(getProjectName())) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,17 +11,10 @@
package org.jboss.tools.cdi.bot.test.wizard;
-import java.util.logging.Logger;
-
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
import org.jboss.tools.cdi.bot.test.CDITestBase;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
/**
@@ -30,16 +23,9 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class , CDISmokeBotTests.class })
public class FacetTest extends CDITestBase {
- private static final Logger LOGGER = Logger.getLogger(FacetTest.class.getName());
-
-
@Override
public void checkAndCreateProject() {
if (!projectHelper.projectExists(getProjectName())) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -12,8 +12,6 @@
package org.jboss.tools.cdi.bot.test.wizard;
-import java.util.logging.Logger;
-
import org.eclipse.swt.SWTException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -22,14 +20,9 @@
import org.jboss.tools.cdi.bot.test.CDITestBase;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.uiutils.NodeContextUtil;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
/**
@@ -38,15 +31,9 @@
* @author Jaroslav Jankovic
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDIAllBotTests.class, CDISmokeBotTests.class })
public class PerspectiveTest extends CDITestBase {
- private static final Logger LOGGER = Logger.getLogger(PerspectiveTest.class.getName());
-
@Override
public void checkAndCreateProject() {
if (!projectHelper.projectExists(getProjectName())) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java 2011-12-09 10:01:34 UTC (rev 37149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java 2011-12-09 10:09:43 UTC (rev 37150)
@@ -11,8 +11,6 @@
package org.jboss.tools.cdi.bot.test.wizard;
-import java.util.logging.Logger;
-
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
@@ -22,13 +20,8 @@
import org.jboss.tools.cdi.bot.test.uiutils.actions.NewCDIFileWizard;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardBase;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardBaseExt;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
/**
@@ -37,14 +30,10 @@
* @author Lukas Jungmann
* @author jjankovi
*/
-@Require(clearProjects = true, perspective = "Java EE",
- server = @Server(state = ServerState.NotRunning,
- version = "6.0", operator = ">="))
-(a)RunWith(RequirementAwareSuite.class)
+
@SuiteClasses({ CDIAllBotTests.class, CDISmokeBotTests.class })
public class WizardTest extends CDITestBase {
- private static final Logger L = Logger.getLogger(WizardTest.class.getName());
private final CDIWizardBaseExt wizard = new CDIWizardBaseExt();
public String getProjectName() {
@@ -67,7 +56,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Q1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Qualifier"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE, METHOD, PARAMETER, FIELD })"));
@@ -79,7 +68,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Q2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Qualifier"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE, METHOD, PARAMETER, FIELD })"));
@@ -94,7 +83,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Scope1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@NormalScope"));
assertFalse(code.contains("@Scope"));
assertFalse(code.contains("passivating"));
@@ -108,7 +97,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Scope2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@NormalScope(passivating = true)"));
assertFalse(code.contains("@Scope"));
assertTrue(code.contains("@Retention(RUNTIME)"));
@@ -121,7 +110,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Scope3.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Scope"));
assertFalse(code.contains("@NormalScope"));
assertTrue(code.contains("@Retention(RUNTIME)"));
@@ -139,7 +128,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("B1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@InterceptorBinding"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE, METHOD })"));
@@ -151,7 +140,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("B2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@InterceptorBinding"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE })"));
@@ -163,7 +152,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("B3.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@InterceptorBinding"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE })"));
@@ -177,7 +166,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("B4.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@InterceptorBinding"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE })"));
@@ -197,7 +186,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("S1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Stereotype"));
assertTrue(code.contains("@Retention(RUNTIME)"));
assertTrue(code.contains("@Target({ TYPE, METHOD, FIELD })"));
@@ -212,7 +201,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("S2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Stereotype"));
assertTrue(code.contains("@Scope3"));
assertTrue(code.contains("@Named"));
@@ -230,7 +219,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("S3.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Stereotype"));
assertFalse(code.contains("@Scope3"));
assertFalse(code.contains("@Named"));
@@ -252,7 +241,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().editorByTitle("ComparableDecorator.java");
assertTrue(("ComparableDecorator.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Decorator"));
assertTrue(code.contains("abstract class"));
assertTrue(code.contains("@Delegate"));
@@ -268,7 +257,7 @@
ed = new SWTWorkbenchBot().editorByTitle("MapDecorator.java");
assertTrue(("MapDecorator.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@Decorator"));
assertFalse(code.contains("abstract"));
assertTrue(code.contains("@Delegate"));
@@ -287,7 +276,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().editorByTitle("I1.java");
assertTrue(("I1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@B2"));
assertTrue(code.contains("@Interceptor"));
assertTrue(code.contains("@AroundInvoke"));
@@ -301,7 +290,7 @@
ed = new SWTWorkbenchBot().editorByTitle("I2.java");
assertTrue(("I2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("@B4"));
assertTrue(code.contains("@Interceptor"));
assertTrue(code.contains("@AroundInvoke"));
@@ -332,7 +321,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Bean1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("package cdi;"));
assertTrue(code.contains("public abstract class Bean1 {"));
assertFalse(code.contains("@Named"));
@@ -345,7 +334,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Bean2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("package cdi;"));
assertTrue(code.contains("@Named"));
assertFalse(code.contains("@Named("));
@@ -359,7 +348,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Bean3.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.fine(code);
+ LOGGER.fine(code);
assertTrue(code.contains("package cdi;"));
assertTrue(code.contains("@Named(\"TestedBean\")"));
assertTrue(code.contains("@Scope2"));
@@ -377,7 +366,7 @@
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("AnnL1.java").equals(ed.getTitle()));
String code = ed.toTextEditor().getText();
- L.info(code);
+ LOGGER.info(code);
assertTrue(code.contains("package cdi;"));
assertTrue(code.contains("public final class AnnL1 extends AnnotationLiteral<Q1> implements Q1"));
assertTrue(code.contains("public static final Q1 INSTANCE = new AnnL1();"));
@@ -390,7 +379,7 @@
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("AnnL2.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
- L.info(code);
+ LOGGER.info(code);
assertTrue(code.contains("package cdi;"));
assertTrue(code.contains("abstract class AnnL2 extends AnnotationLiteral<Q2> implements Q2 {"));
assertTrue(code.contains("public static final Q2 INSTANCE = new AnnL2();"));
14 years, 4 months
JBoss Tools SVN: r37149 - in trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-12-09 05:01:34 -0500 (Fri, 09 Dec 2011)
New Revision: 37149
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBDS-1935 if Welcome screen is maximized on startup, JBoss Central can't be resized / doesn't auto-resize to fill editor pane
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-12-09 09:53:58 UTC (rev 37148)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-12-09 10:01:34 UTC (rev 37149)
@@ -32,17 +32,21 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.WorkbenchWindow;
import org.eclipse.ui.internal.browser.WebBrowserPreference;
import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
import org.eclipse.ui.menus.CommandContributionItem;
@@ -68,9 +72,7 @@
public class JBossCentralActivator extends AbstractUIPlugin {
public static final String JBOSS_DISCOVERY_DIRECTORY = "jboss.discovery.directory.url";
-
- //public static final String JBOSS_DISCOVERY_DIRECTORY_3_3_0_XML = "http://download.jboss.org/jbosstools/updates/development/indigo/jbosstool...";
-
+
public static final String ICON = "icon";
private static final String DESCRIPTION = "description";
@@ -90,7 +92,7 @@
public static final String NAME = "name";
public static final String CATEGORY = "category";
-
+
public static final String PROJECT_EXAMPLE_TYPE = "projectExample";
// The plug-in ID
@@ -99,26 +101,30 @@
public static final String SHOW_JBOSS_CENTRAL_ON_STARTUP = "showJBossCentralOnStartup";
public static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
-
+
public static final String PROFILE_ID = "profileId";
public static final String PROFILE_TIMESTAMP = "profileTimestamp";
-
+
public static final String NEW_PROJECT_EXAMPLES_WIZARD_ID = "org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard";
-
+
public static final String FORM_END_TAG = "</p></form>";
public static final String FORM_START_TAG = "<form><p>";
- public static final String CANCELED = FORM_START_TAG + "<span color=\"header\" font=\"header\">Canceled.</span>" + FORM_END_TAG;
- public static final String LOADING = FORM_START_TAG + "<span color=\"header\" font=\"header\">Loading...</span>" + FORM_END_TAG;
-
+ public static final String CANCELED = FORM_START_TAG
+ + "<span color=\"header\" font=\"header\">Canceled.</span>"
+ + FORM_END_TAG;
+ public static final String LOADING = FORM_START_TAG
+ + "<span color=\"header\" font=\"header\">Loading...</span>"
+ + FORM_END_TAG;
+
public static final String TUTORIALS_EXTENSION_ID = "org.jboss.tools.central.tutorials";
-
+
public static final String CONFIGURATORS_EXTENSION_ID = "org.jboss.tools.central.configurators";
-
+
private IJBossCentralConfigurator configurator;
-
- //public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
+ // public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
+
public static final String SEARCH_THE_COMMUNITY = "Search JBoss Community";
public static final String SEARCH_RED_HAT_CUSTOMER_PORTAL = "Search Red Hat Customer Portal ";
@@ -126,11 +132,13 @@
public Map<String, TutorialCategory> tutorialCategories;
private BundleContext bundleContext;
-
+
public static final int MAX_FEEDS = 100;
private static final Object CONFIGURATOR = "configurator";
-
+
+ private static final String ORG_ECLIPSE_UI_INTERNAL_INTROVIEW = "org.eclipse.ui.internal.introview";
+
// The shared instance
private static JBossCentralActivator plugin;
@@ -144,7 +152,10 @@
/*
* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
@@ -154,7 +165,10 @@
/*
* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
@@ -165,7 +179,7 @@
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static JBossCentralActivator getDefault() {
@@ -173,21 +187,22 @@
}
/**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path
+ *
+ * @param path
+ * the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
-
+
public IEclipsePreferences getPreferences() {
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
return prefs;
}
-
+
public void savePreferences() {
IEclipsePreferences prefs = getPreferences();
try {
@@ -196,37 +211,39 @@
log(e);
}
}
-
+
public static void log(Exception e, String message) {
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
plugin.getLog().log(status);
}
public static void log(Throwable e) {
- IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
- .getLocalizedMessage(), e);
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID,
+ e.getLocalizedMessage(), e);
plugin.getLog().log(status);
}
-
+
public static void log(String message) {
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message);
plugin.getLog().log(status);
}
-
+
public static void logWarning(String message) {
IStatus status = new Status(IStatus.WARNING, PLUGIN_ID, message);
plugin.getLog().log(status);
}
public boolean showJBossCentralOnStartup() {
- IEclipsePreferences prefs = JBossCentralActivator.getDefault().getPreferences();
- return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP, SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
+ IEclipsePreferences prefs = JBossCentralActivator.getDefault()
+ .getPreferences();
+ return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP,
+ SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
}
-
+
public static void openUrl(String location, Shell shell) {
openUrl(location, shell, false);
}
-
+
public static void openUrl(String location, Shell shell, boolean asExternal) {
URL url = null;
try {
@@ -234,14 +251,16 @@
url = new URL(location);
}
- if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL || asExternal) {
+ if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL
+ || asExternal) {
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
.getBrowserSupport();
support.getExternalBrowser().openURL(url);
} else {
IWebBrowser browser = null;
int flags;
- if (WorkbenchBrowserSupport.getInstance().isInternalWebBrowserAvailable()) {
+ if (WorkbenchBrowserSupport.getInstance()
+ .isInternalWebBrowserAvailable()) {
flags = IWorkbenchBrowserSupport.AS_EDITOR
| IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.NAVIGATION_BAR;
@@ -251,8 +270,10 @@
| IWorkbenchBrowserSupport.NAVIGATION_BAR;
}
- String generatedId = JBossCentralActivator.PLUGIN_ID + System.currentTimeMillis();
- browser = WorkbenchBrowserSupport.getInstance().createBrowser(flags, generatedId, null, null);
+ String generatedId = JBossCentralActivator.PLUGIN_ID
+ + System.currentTimeMillis();
+ browser = WorkbenchBrowserSupport.getInstance().createBrowser(
+ flags, generatedId, null, null);
browser.openURL(url);
}
} catch (PartInitException e) {
@@ -260,17 +281,17 @@
JBossCentralActivator.PLUGIN_ID,
"Browser initialization failed");
JBossCentralActivator.getDefault().getLog().log(status);
- MessageDialog.openError(shell, "Open Location",
- status.getMessage());
+ MessageDialog
+ .openError(shell, "Open Location", status.getMessage());
} catch (MalformedURLException e) {
Status status = new Status(IStatus.ERROR,
JBossCentralActivator.PLUGIN_ID, "Invalid URL");
JBossCentralActivator.getDefault().getLog().log(status);
- MessageDialog.openError(shell, "Open Location",
- status.getMessage());
+ MessageDialog
+ .openError(shell, "Open Location", status.getMessage());
}
}
-
+
public Image getImage(ImageDescriptor imageDescriptor) {
ImageRegistry imageRegistry = getImageRegistry();
String id = getImageId(imageDescriptor);
@@ -285,16 +306,54 @@
private String getImageId(ImageDescriptor imageDescriptor) {
return PLUGIN_ID + "/" + imageDescriptor.hashCode();
}
-
- public static CommandContributionItem createContributionItem(IServiceLocator serviceLocator, String commandId) {
+
+ public static CommandContributionItem createContributionItem(
+ IServiceLocator serviceLocator, String commandId) {
CommandContributionItemParameter parameter = new CommandContributionItemParameter(
serviceLocator, commandId, commandId,
CommandContributionItem.STYLE_PUSH);
return new CommandContributionItem(parameter);
}
-
+
public static JBossCentralEditor getJBossCentralEditor() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ final WorkbenchWindow window = (WorkbenchWindow) PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow();
+ final IWorkbenchPage page = window.getActivePage();
+ if (page.findView(ORG_ECLIPSE_UI_INTERNAL_INTROVIEW) != null
+ && !window.getCoolBarVisible()
+ && !window.getPerspectiveBarVisible()) {
+ IViewReference viewRef = page
+ .findViewReference(ORG_ECLIPSE_UI_INTERNAL_INTROVIEW);
+ if (page.getPartState(viewRef) == IWorkbenchPage.STATE_MAXIMIZED) {
+ window.addPropertyChangeListener(new IPropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if (WorkbenchWindow.PROP_COOLBAR_VISIBLE
+ .equals(property)
+ || WorkbenchWindow.PROP_COOLBAR_VISIBLE
+ .equals(property)) {
+ Object newValue = event.getNewValue();
+ if (newValue instanceof Boolean
+ && ((Boolean) newValue).booleanValue()) {
+ openJBossCentralEditor(page);
+ window.removePropertyChangeListener(this);
+ }
+ }
+ }
+ });
+ } else {
+ return openJBossCentralEditor(page);
+ }
+ } else {
+ return openJBossCentralEditor(page);
+ }
+ return null;
+ }
+
+ protected static JBossCentralEditor openJBossCentralEditor(
+ IWorkbenchPage page) {
IEditorInput input = JBossCentralEditorInput.INSTANCE;
try {
IEditorPart editor = page.openEditor(input, JBossCentralEditor.ID);
@@ -306,7 +365,7 @@
}
return null;
}
-
+
public IJBossCentralConfigurator getConfigurator() {
if (configurator == null) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
@@ -321,7 +380,8 @@
IConfigurationElement configurationElement = configurationElements[j];
if (CONFIGURATOR.equals(configurationElement.getName())) {
try {
- configurator = (IJBossCentralConfigurator) configurationElement.createExecutableExtension("class");
+ configurator = (IJBossCentralConfigurator) configurationElement
+ .createExecutableExtension("class");
} catch (CoreException e) {
JBossCentralActivator.log(e);
continue;
@@ -329,7 +389,7 @@
break;
}
}
-
+
}
if (configurator == null) {
configurator = new DefaultJBossCentralConfigurator();
@@ -337,7 +397,7 @@
}
return configurator;
}
-
+
public Map<String, TutorialCategory> getTutorialCategories() {
if (tutorialCategories == null) {
tutorialCategories = new HashMap<String, TutorialCategory>();
@@ -354,8 +414,10 @@
if (CATEGORY.equals(configurationElement.getName())) {
String name = configurationElement.getAttribute(NAME);
String id = configurationElement.getAttribute(ID);
- String description = configurationElement.getAttribute(DESCRIPTION);
- String priorityString = configurationElement.getAttribute(PRIORITY);
+ String description = configurationElement
+ .getAttribute(DESCRIPTION);
+ String priorityString = configurationElement
+ .getAttribute(PRIORITY);
int priority = Integer.MAX_VALUE;
if (priorityString != null) {
try {
@@ -365,7 +427,8 @@
log(e);
}
}
- TutorialCategory category = new TutorialCategory(id, name, priority, description);
+ TutorialCategory category = new TutorialCategory(id,
+ name, priority, description);
tutorialCategories.put(id, category);
}
}
@@ -375,10 +438,14 @@
String name = configurationElement.getAttribute(NAME);
String id = configurationElement.getAttribute(ID);
String type = configurationElement.getAttribute(TYPE);
- String reference = configurationElement.getAttribute(REFERENCE);
- String priorityString = configurationElement.getAttribute(PRIORITY);
- String description = configurationElement.getAttribute(DESCRIPTION);
- String iconPath = configurationElement.getAttribute(ICON);
+ String reference = configurationElement
+ .getAttribute(REFERENCE);
+ String priorityString = configurationElement
+ .getAttribute(PRIORITY);
+ String description = configurationElement
+ .getAttribute(DESCRIPTION);
+ String iconPath = configurationElement
+ .getAttribute(ICON);
int priority = Integer.MAX_VALUE;
if (priorityString != null) {
try {
@@ -388,28 +455,32 @@
log(e);
}
}
- String categoryId = configurationElement.getAttribute(CATEGORY_ID);
- TutorialCategory category = tutorialCategories.get(categoryId);
+ String categoryId = configurationElement
+ .getAttribute(CATEGORY_ID);
+ TutorialCategory category = tutorialCategories
+ .get(categoryId);
if (category == null) {
log("Invalid tutorial: id=" + id);
continue;
}
- Tutorial tutorial = new Tutorial(id, name, type, reference, priority, category, description, iconPath);
+ Tutorial tutorial = new Tutorial(id, name, type,
+ reference, priority, category, description,
+ iconPath);
category.getTutorials().add(tutorial);
}
}
}
List<TutorialCategory> emptyCategories = new ArrayList<TutorialCategory>();
- for (TutorialCategory category:tutorialCategories.values()) {
+ for (TutorialCategory category : tutorialCategories.values()) {
if (category.getTutorials().size() == 0) {
emptyCategories.add(category);
}
}
- for (TutorialCategory category:emptyCategories) {
+ for (TutorialCategory category : emptyCategories) {
tutorialCategories.remove(category.getId());
}
}
-
+
return tutorialCategories;
}
@@ -429,7 +500,7 @@
Map<String, TutorialCategory> tutorialCategories) {
this.tutorialCategories = tutorialCategories;
}
-
+
public String getDescription(Tutorial tutorial) {
String description = tutorial.getDescription();
Project project = tutorial.getProjectExamples();
@@ -442,22 +513,26 @@
buffer.append("Size: ");
buffer.append(project.getSizeAsText());
if (project.getUnsatisfiedFixes().size() > 0) {
- buffer.append("\n\n");
+ buffer.append("\n\n");
}
return buffer.toString();
}
-
+
public static Dictionary<Object, Object> getEnvironment() {
- Dictionary<Object, Object> environment = new Hashtable<Object, Object>(System.getProperties());
+ Dictionary<Object, Object> environment = new Hashtable<Object, Object>(
+ System.getProperties());
Bundle bundle = Platform.getBundle("org.jboss.tools.central"); //$NON-NLS-1$
Version version = bundle.getVersion();
environment.put("org.jboss.tools.central.version", version.toString()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.major", version.getMajor()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.minor", version.getMinor()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
+ environment.put(
+ "org.jboss.tools.central.version.major", version.getMajor()); //$NON-NLS-1$
+ environment.put(
+ "org.jboss.tools.central.version.minor", version.getMinor()); //$NON-NLS-1$
+ environment.put(
+ "org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
return environment;
}
-
+
public Object getService(String name) {
if (bundleContext == null)
return null;
@@ -472,7 +547,7 @@
public BundleContext getBundleContext() {
return bundleContext;
}
-
+
public static boolean isInternalWebBrowserAvailable() {
if (isInternalWebBrowserAvailable != null) {
return isInternalWebBrowserAvailable.booleanValue();
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-12-09 09:53:58 UTC (rev 37148)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-12-09 10:01:34 UTC (rev 37149)
@@ -101,6 +101,9 @@
}
protected void setBusyIndicator(Composite composite, boolean busy) {
+ if (composite == null || composite.isDisposed()) {
+ return;
+ }
Control[] children = composite.getChildren();
for (Control child:children) {
if (child instanceof RefreshIndicator) {
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-12-09 09:53:58 UTC (rev 37148)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-12-09 10:01:34 UTC (rev 37149)
@@ -1223,6 +1223,9 @@
@Override
public void run() {
+ if (blogsLoadingComposite == null || blogsLoadingComposite.isDisposed()) {
+ return;
+ }
setBusyIndicator(blogsLoadingComposite, false);
refreshBlogs();
setItemVisible(blogsToolBarManager, BLOGS_WARNING_ID, false);
@@ -1276,6 +1279,9 @@
@Override
public void run() {
+ if (tutorialsLoadingComposite == null || tutorialsLoadingComposite.isDisposed()) {
+ return;
+ }
setBusyIndicator(tutorialsLoadingComposite, false);
refreshTutorials();
@@ -1327,6 +1333,9 @@
@Override
public void run() {
+ if (newsLoadingComposite == null || newsLoadingComposite.isDisposed()) {
+ return;
+ }
setBusyIndicator(newsLoadingComposite, false);
refreshNews();
setItemVisible(newsToolBarManager, NEWS_WARNING_ID, false);
14 years, 4 months
JBoss Tools SVN: r37148 - in branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-12-09 04:53:58 -0500 (Fri, 09 Dec 2011)
New Revision: 37148
Modified:
branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBDS-1935 if Welcome screen is maximized on startup, JBoss Central can't be resized / doesn't auto-resize to fill editor pane
Modified: branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-12-09 09:48:23 UTC (rev 37147)
+++ branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-12-09 09:53:58 UTC (rev 37148)
@@ -32,17 +32,21 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.WorkbenchWindow;
import org.eclipse.ui.internal.browser.WebBrowserPreference;
import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
import org.eclipse.ui.menus.CommandContributionItem;
@@ -68,7 +72,7 @@
public class JBossCentralActivator extends AbstractUIPlugin {
public static final String JBOSS_DISCOVERY_DIRECTORY = "jboss.discovery.directory.url";
-
+
public static final String ICON = "icon";
private static final String DESCRIPTION = "description";
@@ -88,7 +92,7 @@
public static final String NAME = "name";
public static final String CATEGORY = "category";
-
+
public static final String PROJECT_EXAMPLE_TYPE = "projectExample";
// The plug-in ID
@@ -97,26 +101,30 @@
public static final String SHOW_JBOSS_CENTRAL_ON_STARTUP = "showJBossCentralOnStartup";
public static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
-
+
public static final String PROFILE_ID = "profileId";
public static final String PROFILE_TIMESTAMP = "profileTimestamp";
-
+
public static final String NEW_PROJECT_EXAMPLES_WIZARD_ID = "org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard";
-
+
public static final String FORM_END_TAG = "</p></form>";
public static final String FORM_START_TAG = "<form><p>";
- public static final String CANCELED = FORM_START_TAG + "<span color=\"header\" font=\"header\">Canceled.</span>" + FORM_END_TAG;
- public static final String LOADING = FORM_START_TAG + "<span color=\"header\" font=\"header\">Loading...</span>" + FORM_END_TAG;
-
+ public static final String CANCELED = FORM_START_TAG
+ + "<span color=\"header\" font=\"header\">Canceled.</span>"
+ + FORM_END_TAG;
+ public static final String LOADING = FORM_START_TAG
+ + "<span color=\"header\" font=\"header\">Loading...</span>"
+ + FORM_END_TAG;
+
public static final String TUTORIALS_EXTENSION_ID = "org.jboss.tools.central.tutorials";
-
+
public static final String CONFIGURATORS_EXTENSION_ID = "org.jboss.tools.central.configurators";
-
+
private IJBossCentralConfigurator configurator;
-
- //public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
+ // public static final String SEARCH_PROJECT_PAGES = "Search Project Pages";
+
public static final String SEARCH_THE_COMMUNITY = "Search JBoss Community";
public static final String SEARCH_RED_HAT_CUSTOMER_PORTAL = "Search Red Hat Customer Portal ";
@@ -124,11 +132,13 @@
public Map<String, TutorialCategory> tutorialCategories;
private BundleContext bundleContext;
-
+
public static final int MAX_FEEDS = 100;
private static final Object CONFIGURATOR = "configurator";
-
+
+ private static final String ORG_ECLIPSE_UI_INTERNAL_INTROVIEW = "org.eclipse.ui.internal.introview";
+
// The shared instance
private static JBossCentralActivator plugin;
@@ -142,7 +152,10 @@
/*
* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
@@ -152,7 +165,10 @@
/*
* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
@@ -163,7 +179,7 @@
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static JBossCentralActivator getDefault() {
@@ -171,21 +187,22 @@
}
/**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path
+ *
+ * @param path
+ * the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
-
+
public IEclipsePreferences getPreferences() {
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
return prefs;
}
-
+
public void savePreferences() {
IEclipsePreferences prefs = getPreferences();
try {
@@ -194,37 +211,39 @@
log(e);
}
}
-
+
public static void log(Exception e, String message) {
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
plugin.getLog().log(status);
}
public static void log(Throwable e) {
- IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
- .getLocalizedMessage(), e);
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID,
+ e.getLocalizedMessage(), e);
plugin.getLog().log(status);
}
-
+
public static void log(String message) {
IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message);
plugin.getLog().log(status);
}
-
+
public static void logWarning(String message) {
IStatus status = new Status(IStatus.WARNING, PLUGIN_ID, message);
plugin.getLog().log(status);
}
public boolean showJBossCentralOnStartup() {
- IEclipsePreferences prefs = JBossCentralActivator.getDefault().getPreferences();
- return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP, SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
+ IEclipsePreferences prefs = JBossCentralActivator.getDefault()
+ .getPreferences();
+ return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP,
+ SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
}
-
+
public static void openUrl(String location, Shell shell) {
openUrl(location, shell, false);
}
-
+
public static void openUrl(String location, Shell shell, boolean asExternal) {
URL url = null;
try {
@@ -232,14 +251,16 @@
url = new URL(location);
}
- if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL || asExternal) {
+ if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL
+ || asExternal) {
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
.getBrowserSupport();
support.getExternalBrowser().openURL(url);
} else {
IWebBrowser browser = null;
int flags;
- if (WorkbenchBrowserSupport.getInstance().isInternalWebBrowserAvailable()) {
+ if (WorkbenchBrowserSupport.getInstance()
+ .isInternalWebBrowserAvailable()) {
flags = IWorkbenchBrowserSupport.AS_EDITOR
| IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.NAVIGATION_BAR;
@@ -249,8 +270,10 @@
| IWorkbenchBrowserSupport.NAVIGATION_BAR;
}
- String generatedId = JBossCentralActivator.PLUGIN_ID + System.currentTimeMillis();
- browser = WorkbenchBrowserSupport.getInstance().createBrowser(flags, generatedId, null, null);
+ String generatedId = JBossCentralActivator.PLUGIN_ID
+ + System.currentTimeMillis();
+ browser = WorkbenchBrowserSupport.getInstance().createBrowser(
+ flags, generatedId, null, null);
browser.openURL(url);
}
} catch (PartInitException e) {
@@ -258,17 +281,17 @@
JBossCentralActivator.PLUGIN_ID,
"Browser initialization failed");
JBossCentralActivator.getDefault().getLog().log(status);
- MessageDialog.openError(shell, "Open Location",
- status.getMessage());
+ MessageDialog
+ .openError(shell, "Open Location", status.getMessage());
} catch (MalformedURLException e) {
Status status = new Status(IStatus.ERROR,
JBossCentralActivator.PLUGIN_ID, "Invalid URL");
JBossCentralActivator.getDefault().getLog().log(status);
- MessageDialog.openError(shell, "Open Location",
- status.getMessage());
+ MessageDialog
+ .openError(shell, "Open Location", status.getMessage());
}
}
-
+
public Image getImage(ImageDescriptor imageDescriptor) {
ImageRegistry imageRegistry = getImageRegistry();
String id = getImageId(imageDescriptor);
@@ -283,16 +306,54 @@
private String getImageId(ImageDescriptor imageDescriptor) {
return PLUGIN_ID + "/" + imageDescriptor.hashCode();
}
-
- public static CommandContributionItem createContributionItem(IServiceLocator serviceLocator, String commandId) {
+
+ public static CommandContributionItem createContributionItem(
+ IServiceLocator serviceLocator, String commandId) {
CommandContributionItemParameter parameter = new CommandContributionItemParameter(
serviceLocator, commandId, commandId,
CommandContributionItem.STYLE_PUSH);
return new CommandContributionItem(parameter);
}
-
+
public static JBossCentralEditor getJBossCentralEditor() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ final WorkbenchWindow window = (WorkbenchWindow) PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow();
+ final IWorkbenchPage page = window.getActivePage();
+ if (page.findView(ORG_ECLIPSE_UI_INTERNAL_INTROVIEW) != null
+ && !window.getCoolBarVisible()
+ && !window.getPerspectiveBarVisible()) {
+ IViewReference viewRef = page
+ .findViewReference(ORG_ECLIPSE_UI_INTERNAL_INTROVIEW);
+ if (page.getPartState(viewRef) == IWorkbenchPage.STATE_MAXIMIZED) {
+ window.addPropertyChangeListener(new IPropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if (WorkbenchWindow.PROP_COOLBAR_VISIBLE
+ .equals(property)
+ || WorkbenchWindow.PROP_COOLBAR_VISIBLE
+ .equals(property)) {
+ Object newValue = event.getNewValue();
+ if (newValue instanceof Boolean
+ && ((Boolean) newValue).booleanValue()) {
+ openJBossCentralEditor(page);
+ window.removePropertyChangeListener(this);
+ }
+ }
+ }
+ });
+ } else {
+ return openJBossCentralEditor(page);
+ }
+ } else {
+ return openJBossCentralEditor(page);
+ }
+ return null;
+ }
+
+ protected static JBossCentralEditor openJBossCentralEditor(
+ IWorkbenchPage page) {
IEditorInput input = JBossCentralEditorInput.INSTANCE;
try {
IEditorPart editor = page.openEditor(input, JBossCentralEditor.ID);
@@ -304,7 +365,7 @@
}
return null;
}
-
+
public IJBossCentralConfigurator getConfigurator() {
if (configurator == null) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
@@ -319,7 +380,8 @@
IConfigurationElement configurationElement = configurationElements[j];
if (CONFIGURATOR.equals(configurationElement.getName())) {
try {
- configurator = (IJBossCentralConfigurator) configurationElement.createExecutableExtension("class");
+ configurator = (IJBossCentralConfigurator) configurationElement
+ .createExecutableExtension("class");
} catch (CoreException e) {
JBossCentralActivator.log(e);
continue;
@@ -327,7 +389,7 @@
break;
}
}
-
+
}
if (configurator == null) {
configurator = new DefaultJBossCentralConfigurator();
@@ -335,7 +397,7 @@
}
return configurator;
}
-
+
public Map<String, TutorialCategory> getTutorialCategories() {
if (tutorialCategories == null) {
tutorialCategories = new HashMap<String, TutorialCategory>();
@@ -352,8 +414,10 @@
if (CATEGORY.equals(configurationElement.getName())) {
String name = configurationElement.getAttribute(NAME);
String id = configurationElement.getAttribute(ID);
- String description = configurationElement.getAttribute(DESCRIPTION);
- String priorityString = configurationElement.getAttribute(PRIORITY);
+ String description = configurationElement
+ .getAttribute(DESCRIPTION);
+ String priorityString = configurationElement
+ .getAttribute(PRIORITY);
int priority = Integer.MAX_VALUE;
if (priorityString != null) {
try {
@@ -363,7 +427,8 @@
log(e);
}
}
- TutorialCategory category = new TutorialCategory(id, name, priority, description);
+ TutorialCategory category = new TutorialCategory(id,
+ name, priority, description);
tutorialCategories.put(id, category);
}
}
@@ -373,10 +438,14 @@
String name = configurationElement.getAttribute(NAME);
String id = configurationElement.getAttribute(ID);
String type = configurationElement.getAttribute(TYPE);
- String reference = configurationElement.getAttribute(REFERENCE);
- String priorityString = configurationElement.getAttribute(PRIORITY);
- String description = configurationElement.getAttribute(DESCRIPTION);
- String iconPath = configurationElement.getAttribute(ICON);
+ String reference = configurationElement
+ .getAttribute(REFERENCE);
+ String priorityString = configurationElement
+ .getAttribute(PRIORITY);
+ String description = configurationElement
+ .getAttribute(DESCRIPTION);
+ String iconPath = configurationElement
+ .getAttribute(ICON);
int priority = Integer.MAX_VALUE;
if (priorityString != null) {
try {
@@ -386,28 +455,32 @@
log(e);
}
}
- String categoryId = configurationElement.getAttribute(CATEGORY_ID);
- TutorialCategory category = tutorialCategories.get(categoryId);
+ String categoryId = configurationElement
+ .getAttribute(CATEGORY_ID);
+ TutorialCategory category = tutorialCategories
+ .get(categoryId);
if (category == null) {
log("Invalid tutorial: id=" + id);
continue;
}
- Tutorial tutorial = new Tutorial(id, name, type, reference, priority, category, description, iconPath);
+ Tutorial tutorial = new Tutorial(id, name, type,
+ reference, priority, category, description,
+ iconPath);
category.getTutorials().add(tutorial);
}
}
}
List<TutorialCategory> emptyCategories = new ArrayList<TutorialCategory>();
- for (TutorialCategory category:tutorialCategories.values()) {
+ for (TutorialCategory category : tutorialCategories.values()) {
if (category.getTutorials().size() == 0) {
emptyCategories.add(category);
}
}
- for (TutorialCategory category:emptyCategories) {
+ for (TutorialCategory category : emptyCategories) {
tutorialCategories.remove(category.getId());
}
}
-
+
return tutorialCategories;
}
@@ -427,7 +500,7 @@
Map<String, TutorialCategory> tutorialCategories) {
this.tutorialCategories = tutorialCategories;
}
-
+
public String getDescription(Tutorial tutorial) {
String description = tutorial.getDescription();
Project project = tutorial.getProjectExamples();
@@ -440,22 +513,26 @@
buffer.append("Size: ");
buffer.append(project.getSizeAsText());
if (project.getUnsatisfiedFixes().size() > 0) {
- buffer.append("\n\n");
+ buffer.append("\n\n");
}
return buffer.toString();
}
-
+
public static Dictionary<Object, Object> getEnvironment() {
- Dictionary<Object, Object> environment = new Hashtable<Object, Object>(System.getProperties());
+ Dictionary<Object, Object> environment = new Hashtable<Object, Object>(
+ System.getProperties());
Bundle bundle = Platform.getBundle("org.jboss.tools.central"); //$NON-NLS-1$
Version version = bundle.getVersion();
environment.put("org.jboss.tools.central.version", version.toString()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.major", version.getMajor()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.minor", version.getMinor()); //$NON-NLS-1$
- environment.put("org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
+ environment.put(
+ "org.jboss.tools.central.version.major", version.getMajor()); //$NON-NLS-1$
+ environment.put(
+ "org.jboss.tools.central.version.minor", version.getMinor()); //$NON-NLS-1$
+ environment.put(
+ "org.jboss.tools.central.version.micro", version.getMicro()); //$NON-NLS-1$
return environment;
}
-
+
public Object getService(String name) {
if (bundleContext == null)
return null;
@@ -470,7 +547,7 @@
public BundleContext getBundleContext() {
return bundleContext;
}
-
+
public static boolean isInternalWebBrowserAvailable() {
if (isInternalWebBrowserAvailable != null) {
return isInternalWebBrowserAvailable.booleanValue();
Modified: branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java
===================================================================
--- branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-12-09 09:48:23 UTC (rev 37147)
+++ branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/AbstractJBossCentralPage.java 2011-12-09 09:53:58 UTC (rev 37148)
@@ -101,6 +101,9 @@
}
protected void setBusyIndicator(Composite composite, boolean busy) {
+ if (composite == null || composite.isDisposed()) {
+ return;
+ }
Control[] children = composite.getChildren();
for (Control child:children) {
if (child instanceof RefreshIndicator) {
Modified: branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-12-09 09:48:23 UTC (rev 37147)
+++ branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-12-09 09:53:58 UTC (rev 37148)
@@ -1223,6 +1223,9 @@
@Override
public void run() {
+ if (blogsLoadingComposite == null || blogsLoadingComposite.isDisposed()) {
+ return;
+ }
setBusyIndicator(blogsLoadingComposite, false);
refreshBlogs();
setItemVisible(blogsToolBarManager, BLOGS_WARNING_ID, false);
@@ -1276,6 +1279,9 @@
@Override
public void run() {
+ if (tutorialsLoadingComposite == null || tutorialsLoadingComposite.isDisposed()) {
+ return;
+ }
setBusyIndicator(tutorialsLoadingComposite, false);
refreshTutorials();
@@ -1327,6 +1333,9 @@
@Override
public void run() {
+ if (newsLoadingComposite == null || newsLoadingComposite.isDisposed()) {
+ return;
+ }
setBusyIndicator(newsLoadingComposite, false);
refreshNews();
setItemVisible(newsToolBarManager, NEWS_WARNING_ID, false);
14 years, 4 months
JBoss Tools SVN: r37147 - in trunk/ws/plugins: org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-09 04:48:23 -0500 (Fri, 09 Dec 2011)
New Revision: 37147
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedEvent.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedProcessor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/ConstantUtils.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/CompilationUnitsRepository.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java
Log:
OPEN - issue JBIDE-413 - JAX-RS REST Web Services endpoints out of sync with Java
https://issues.jboss.org/browse/JBIDE-413
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessor.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessor.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -53,7 +53,8 @@
IProgressMonitor progressMonitor) {
final List<JaxrsElementChangedEvent> impacts = new ArrayList<JaxrsElementChangedEvent>();
try {
- progressMonitor.beginTask("Processing Java changes...", events.size());
+ progressMonitor.beginTask("Processing {} Java change(s)...", events.size());
+ Logger.debug("Processing {} Java change(s)...", events.size());
for (JavaElementChangedEvent event : events) {
impacts.addAll(processEvent(event, progressMonitor));
progressMonitor.worked(1);
@@ -63,6 +64,8 @@
impacts.clear();
} finally {
progressMonitor.done();
+ Logger.debug("Done processing Java changes.");
+
}
return impacts;
}
@@ -146,23 +149,26 @@
private List<JaxrsElementChangedEvent> processAddition(final IJavaElement scope, final JaxrsMetamodel metamodel,
final IProgressMonitor progressMonitor) throws CoreException {
final List<JaxrsElementChangedEvent> impacts = new ArrayList<JaxrsElementChangedEvent>();
- // let's see if the given project contains JAX-RS HTTP Methods
- final List<IType> matchingHttpMethodTypes = JaxrsAnnotationsScanner.findHTTPMethodTypes(scope, progressMonitor);
- for (IType type : matchingHttpMethodTypes) {
- final CompilationUnit ast = JdtUtils.parse(type, progressMonitor);
- final Annotation annotation = JdtUtils.resolveAnnotation(type, ast, HttpMethod.class);
- final JaxrsHttpMethod httpMethod = factory.createHttpMethod(annotation, ast, metamodel);
- if (httpMethod != null) {
- impacts.add(new JaxrsElementChangedEvent(httpMethod, ADDED));
+ if(metamodel.getElement(scope) == null) {
+ // process this type as it is not already known from the metamodel
+ // let's see if the given project contains JAX-RS HTTP Methods
+ final List<IType> matchingHttpMethodTypes = JaxrsAnnotationsScanner.findHTTPMethodTypes(scope, progressMonitor);
+ for (IType type : matchingHttpMethodTypes) {
+ final CompilationUnit ast = JdtUtils.parse(type, progressMonitor);
+ final Annotation annotation = JdtUtils.resolveAnnotation(type, ast, HttpMethod.class);
+ final JaxrsHttpMethod httpMethod = factory.createHttpMethod(annotation, ast, metamodel);
+ if (httpMethod != null) {
+ impacts.add(new JaxrsElementChangedEvent(httpMethod, ADDED));
+ }
}
- }
- // let's see if the given project contains JAX-RS HTTP Resources
- final List<IType> matchingResourceTypes = JaxrsAnnotationsScanner.findResources(scope, progressMonitor);
- for (IType type : matchingResourceTypes) {
- final CompilationUnit ast = JdtUtils.parse(type, progressMonitor);
- final JaxrsResource resource = factory.createResource(type, ast, metamodel);
- if (resource != null) {
- impacts.add(new JaxrsElementChangedEvent(resource, ADDED));
+ // let's see if the given project contains JAX-RS HTTP Resources
+ final List<IType> matchingResourceTypes = JaxrsAnnotationsScanner.findResources(scope, progressMonitor);
+ for (IType type : matchingResourceTypes) {
+ final CompilationUnit ast = JdtUtils.parse(type, progressMonitor);
+ final JaxrsResource resource = factory.createResource(type, ast, metamodel);
+ if (resource != null) {
+ impacts.add(new JaxrsElementChangedEvent(resource, ADDED));
+ }
}
}
@@ -328,6 +334,7 @@
final List<IJaxrsElement<?>> elements = metamodel.getElements(compilationUnit);
for (IJaxrsElement<?> element : elements) {
metamodel.remove(element);
+ CompilationUnitsRepository.getInstance().removeAST(compilationUnit);
impacts.add(new JaxrsElementChangedEvent(element, REMOVED));
}
return impacts;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedEvent.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedEvent.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedEvent.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -90,7 +90,9 @@
@Override
public String toString() {
StringBuilder s = new StringBuilder();
- s.append("JaxrsElementChange: [").append(ConstantUtils.getStaticFieldName(IJavaElementDelta.class, deltaKind))
+ s.append("JaxrsElementChange: [")
+ .append(ConstantUtils.toCamelCase(element.getElementKind().toString()))
+ .append(" ").append(ConstantUtils.getStaticFieldName(IJavaElementDelta.class, deltaKind))
.append("] ").append(element.getJavaElement().getElementName());
try {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedProcessor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedProcessor.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsElementChangedProcessor.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -38,6 +38,7 @@
IProgressMonitor progressMonitor) {
final List<JaxrsEndpointChangedEvent> changes = new ArrayList<JaxrsEndpointChangedEvent>();
try {
+ Logger.debug("Processing {} Jaxrs change(s)...", jaxrsElementChanges.size());
for (JaxrsElementChangedEvent jaxrsElementChange : jaxrsElementChanges) {
Logger.debug("Processing {}", jaxrsElementChange);
final List<JaxrsEndpointChangedEvent> endpointChanges = processEvent(jaxrsElementChange);
@@ -46,15 +47,15 @@
}
changes.addAll(endpointChanges);
}
- Logger.debug("Done processing JAX-RS change(s).");
} catch (CoreException e) {
Logger.error("Failed to process JAX-RS element changes", e);
+ } finally {
+ Logger.debug("Done processing JAX-RS change(s).");
}
return changes;
}
private List<JaxrsEndpointChangedEvent> processEvent(final JaxrsElementChangedEvent event) throws CoreException {
- Logger.debug("Processing JAX-RS change {}", event);
final IJaxrsElement<?> element = event.getElement();
final EnumElementKind elementKind = element.getElementKind();
final int flags = event.getFlags();
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -3,6 +3,7 @@
*/
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IProject;
@@ -19,8 +20,11 @@
import org.eclipse.jdt.internal.core.JavaElementDelta;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel;
import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsEndpoint;
import org.jboss.tools.ws.jaxrs.core.pubsub.EventService;
+import static org.eclipse.jdt.core.IJavaElementDelta.REMOVED;
+
/** @author xcoulon */
@SuppressWarnings("restriction")
public class JaxrsMetamodelBuildJob extends Job {
@@ -43,7 +47,16 @@
if (metamodel == null) {
JaxrsMetamodel.create(javaProject);
} else if (requiresReset) {
+ // copying the references to the endpoints into a new list before it is reset
+ final List<IJaxrsEndpoint> allEndpoints = new ArrayList<IJaxrsEndpoint>(metamodel.getAllEndpoints());
metamodel.reset();
+ // now, notifying of the actual removals to the UI
+ for (IJaxrsEndpoint endpoint : allEndpoints) {
+ JaxrsEndpointChangedEvent change = new JaxrsEndpointChangedEvent(endpoint, REMOVED);
+ Logger.debug(change.toString());
+ EventService.getInstance().publish(change);
+ }
+
}
}
@@ -60,8 +73,9 @@
@Override
protected IStatus run(IProgressMonitor progressMonitor) {
try {
- progressMonitor.beginTask("Build JAX-RS Metamodel", 8 * SCALE);
+ progressMonitor.beginTask("Building JAX-RS Metamodel", 8 * SCALE);
progressMonitor.worked(SCALE);
+ Logger.debug("Building JAX-RS Metamodel after {}", event);
// create fake event at the JavaProject level:
// scan and filter delta, retrieve a list of java changes
final List<JavaElementChangedEvent> events = new ElementChangedEventScanner().scanAndFilterEvent(event,
@@ -74,14 +88,14 @@
events, progressMonitor);
final List<JaxrsEndpointChangedEvent> jaxrsEndpointChanges = jaxrsElementChangedProcessor.processEvents(
jaxrsElementChanges, progressMonitor);
- if(jaxrsEndpointChanges == null || jaxrsEndpointChanges.isEmpty()) {
+ if (jaxrsEndpointChanges == null || jaxrsEndpointChanges.isEmpty()) {
Logger.debug("No JAX-RS change to publish to the UI");
} else {
- for (JaxrsEndpointChangedEvent change : jaxrsEndpointChanges) {
- Logger.debug(change.toString());
- EventService.getInstance().publish(change);
+ for (JaxrsEndpointChangedEvent change : jaxrsEndpointChanges) {
+ Logger.debug(change.toString());
+ EventService.getInstance().publish(change);
+ }
}
- }
} catch (Throwable e) {
Logger.error("Failed to build or refresh the JAX-RS metamodel", e);
} finally {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsElementFactory.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -220,7 +220,7 @@
}
}
if (httpMethod == null && pathAnnotation == null) {
- Logger.debug("Cannot create ResourceMethod: no Path annotation nor HttpMethod found on that method !");
+ Logger.debug("Cannot create ResourceMethod: no Path annotation nor HttpMethod found on method {}.{}()", javaMethod.getParent().getElementName(), javaMethod.getElementName());
} else {
final Annotation producesAnnotation = annotations.get(Produces.class.getName());
final Annotation consumesAnnotation = annotations.get(Consumes.class.getName());
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsMetamodel.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -246,6 +246,13 @@
/** @param jaxrsElement */
protected void unindexElement(final IJaxrsElement<?> jaxrsElement) {
+ // if the given element is a JAX-RS Resource, also unindex its children ResourceMethod
+ if(jaxrsElement.getElementKind() == EnumElementKind.RESOURCE) {
+ for(IJaxrsResourceMethod resourceMethod : ((IJaxrsResource)jaxrsElement).getAllMethods()) {
+ unindexElement(resourceMethod);
+ }
+ }
+ // unindex the given element, whatever its kind
for (Iterator<Entry<String, Set<IJaxrsElement<?>>>> iterator = elementsIndex.entrySet().iterator(); iterator
.hasNext();) {
final Entry<String, Set<IJaxrsElement<?>>> entry = iterator.next();
@@ -385,6 +392,7 @@
this.providers.clear();
this.resources.clear();
this.elementsIndex.clear();
+ this.endpoints.clear();
}
/**
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/ConstantUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/ConstantUtils.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/ConstantUtils.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -52,7 +52,7 @@
return result;
}
- static String toCamelCase(String s) {
+ public static String toCamelCase(String s) {
String[] parts = s.split("_");
String camelCaseString = "";
for (String part : parts) {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -119,10 +119,7 @@
* the message to trace.
*/
public static void debug(final String message) {
- String debugOption = Platform.getDebugOption(DEBUG);
- if (JBossJaxrsCorePlugin.getDefault().isDebugging() && "true".equalsIgnoreCase(debugOption)) {
- System.out.println("[" + Thread.currentThread().getName() + "] " + message);
- }
+ debug(message, (Object[])null);
}
@@ -139,10 +136,11 @@
String valuedMessage = message;
if (JBossJaxrsCorePlugin.getDefault() != null && JBossJaxrsCorePlugin.getDefault().isDebugging()
&& "true".equalsIgnoreCase(debugOption)) {
- for (Object item : items) {
- valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString() : "null"));
+ if (items != null) {
+ for (Object item : items) {
+ valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString() : "null"));
+ }
}
-
System.out.println(dateFormatter.get().format(new Date()) + " [" + Thread.currentThread().getName() + "] "
+ valuedMessage);
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/CompilationUnitsRepository.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/CompilationUnitsRepository.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/CompilationUnitsRepository.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -7,6 +7,7 @@
import java.util.Map.Entry;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.ICompilationUnit;
@@ -16,6 +17,7 @@
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.jboss.tools.ws.jaxrs.core.internal.utils.CollectionUtils;
+import org.jboss.tools.ws.jaxrs.core.internal.utils.Logger;
public class CompilationUnitsRepository {
@@ -23,7 +25,7 @@
private final Map<ICompilationUnit, List<JavaMethodSignature>> methodDeclarationsMap = new HashMap<ICompilationUnit, List<JavaMethodSignature>>();
- private final Map<IResource, CompilationUnit> astMap = new HashMap<IResource, CompilationUnit>();
+ private final Map<IPath, CompilationUnit> astMap = new HashMap<IPath, CompilationUnit>();
private final Map<ICompilationUnit, Map<Integer, Problem>> problemsMap = new HashMap<ICompilationUnit, Map<Integer, Problem>>();
@@ -47,16 +49,20 @@
* @return
* @throws JavaModelException */
public CompilationUnit getAST(final ICompilationUnit compilationUnit) throws JavaModelException {
- if(compilationUnit == null) {
+ if(compilationUnit == null || compilationUnit.getResource() == null) {
return null;
}
final IResource resource = compilationUnit.getResource();
- if (!astMap.containsKey(resource)) {
+ final IPath resourcePath = resource.getFullPath();
+ if (!astMap.containsKey(resourcePath)) {
+ Logger.debug("Adding {}'s AST in CompilationUnitsRepository cache.", compilationUnit.getElementName());
recordUnit(compilationUnit);
+ } else {
+ Logger.debug("CompilationUnitsRepository cache contains {}'s AST.", compilationUnit.getElementName());
}
+
+ return astMap.get(resourcePath);
- return astMap.get(resource);
-
}
/** @param compilationUnit
@@ -77,7 +83,7 @@
return null;
}
CompilationUnit compilationUnitAST = JdtUtils.parse(compilationUnit, new NullProgressMonitor());
- astMap.put(compilationUnit.getResource(), compilationUnitAST);
+ astMap.put(compilationUnit.getResource().getFullPath(), compilationUnitAST);
JavaMethodSignaturesVisitor methodsVisitor = new JavaMethodSignaturesVisitor(compilationUnit);
compilationUnitAST.accept(methodsVisitor);
methodDeclarationsMap.put(compilationUnit, methodsVisitor.getMethodSignatures());
@@ -97,7 +103,7 @@
diffs = new ArrayList<JavaMethodSignature>();
}
// replace old values in "cache"
- astMap.put(compilationUnit.getResource(), compilationUnitAST);
+ astMap.put(compilationUnit.getResource().getFullPath(), compilationUnitAST);
// TODO : improve performances here : do not override all method
// declaration, but only those that changed, because reparsing method
// signatures (annotated parameters, etc.) may be expensive.
@@ -119,8 +125,10 @@
}
public void removeAST(final ICompilationUnit compilationUnit) {
+ final IPath fullPath = compilationUnit.getResource().getFullPath();
+ Logger.debug("Removing {}'s AST from CompilationUnitsRepository (path={})", compilationUnit, fullPath);
methodDeclarationsMap.remove(compilationUnit);
- astMap.remove(compilationUnit);
+ astMap.remove(fullPath);
problemsMap.remove(compilationUnit);
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java 2011-12-09 09:17:16 UTC (rev 37146)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java 2011-12-09 09:48:23 UTC (rev 37147)
@@ -11,6 +11,10 @@
package org.jboss.tools.ws.jaxrs.ui.internal.utils;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.jboss.tools.ws.jaxrs.ui.JBossJaxrsUIPlugin;
@@ -26,6 +30,13 @@
/** The debug name, matching the .options file. */
private static final String DEBUG = JBossJaxrsUIPlugin.PLUGIN_ID + "/debug";
+ private static final ThreadLocal<DateFormat> dateFormatter = new ThreadLocal<DateFormat>() {
+ @Override
+ protected DateFormat initialValue() {
+ return new SimpleDateFormat("HH:mm:ss.SSS");
+ }
+ };
+
/**
* The private constructor of the static class.
*/
@@ -85,9 +96,30 @@
* the message to trace.
*/
public static void debug(final String message) {
+ debug(message, (Object[])null);
+
+ }
+
+ /**
+ * Outputs a debug message in the trace file (not the error view of the
+ * runtime workbench). Traces must be activated for this plugin in order to
+ * see the output messages.
+ *
+ * @param message
+ * the message to trace.
+ */
+ public static void debug(final String message, Object... items) {
String debugOption = Platform.getDebugOption(DEBUG);
- if (JBossJaxrsUIPlugin.getDefault().isDebugging() && "true".equalsIgnoreCase(debugOption)) {
- System.out.println("[" + Thread.currentThread().getName() + "] " + message);
+ String valuedMessage = message;
+ if (JBossJaxrsUIPlugin.getDefault() != null && JBossJaxrsUIPlugin.getDefault().isDebugging()
+ && "true".equalsIgnoreCase(debugOption)) {
+ if (items != null) {
+ for (Object item : items) {
+ valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString() : "null"));
+ }
+ }
+ System.out.println(dateFormatter.get().format(new Date()) + " [" + Thread.currentThread().getName() + "] "
+ + valuedMessage);
}
}
14 years, 4 months
JBoss Tools SVN: r37146 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-12-09 04:17:16 -0500 (Fri, 09 Dec 2011)
New Revision: 37146
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-10347 - explore action being loaded before the critical wtp's action provider
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-12-09 06:34:31 UTC (rev 37145)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2011-12-09 09:17:16 UTC (rev 37146)
@@ -338,7 +338,7 @@
<actionProvider
class="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathActionProvider"
id="org.jboss.ide.eclipse.as.ui.extensions.xml.actions"
- priority="highest">
+ priority="higher">
</actionProvider>
</navigatorContent>
<actionProvider
@@ -353,7 +353,7 @@
<actionProvider
class="org.jboss.tools.as.wst.server.ui.xpl.ExploreActionProvider"
id="org.jboss.tools.as.wst.server.ui.ServersView.ExploreActionProvider"
- priority="highest">
+ priority="higher">
<enablement>
<or>
<instanceof
14 years, 4 months
JBoss Tools SVN: r37145 - trunk/central/plugins/org.jboss.tools.central.discovery.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-12-09 01:34:31 -0500 (Fri, 09 Dec 2011)
New Revision: 37145
Modified:
trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml
Log:
https://issues.jboss.org/browse/JBDS-1945 simplify license wording for display on smaller screens
Modified: trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml 2011-12-09 06:32:47 UTC (rev 37144)
+++ trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml 2011-12-09 06:34:31 UTC (rev 37145)
@@ -338,7 +338,7 @@
description="Tool support for the Spring Framework"
id="org.springframework.ide.eclipse.feature"
kind="task"
- license="Free, Spring IDE Project Software User Agreement, EPL"
+ license="Free, EPL, Other"
name="Spring IDE Core"
provider="Spring IDE Developers"
siteUrl="http://download.jboss.org/jbosstools/updates/indigo/extras/">
14 years, 4 months
JBoss Tools SVN: r37144 - branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central.discovery.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-12-09 01:32:47 -0500 (Fri, 09 Dec 2011)
New Revision: 37144
Modified:
branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central.discovery/plugin.xml
Log:
https://issues.jboss.org/browse/JBDS-1945 simplify license wording for display on smaller screens
Modified: branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central.discovery/plugin.xml
===================================================================
--- branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central.discovery/plugin.xml 2011-12-09 02:50:10 UTC (rev 37143)
+++ branches/jbosstools-3.3.0.M5/central/plugins/org.jboss.tools.central.discovery/plugin.xml 2011-12-09 06:32:47 UTC (rev 37144)
@@ -338,7 +338,7 @@
description="Tool support for the Spring Framework"
id="org.springframework.ide.eclipse.feature"
kind="task"
- license="Free, Spring IDE Project Software User Agreement, EPL"
+ license="Free, EPL, Other"
name="Spring IDE Core"
provider="Spring IDE Developers"
siteUrl="http://download.jboss.org/jbosstools/updates/indigo/extras/">
14 years, 4 months
JBoss Tools SVN: r37143 - trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-12-08 21:50:10 -0500 (Thu, 08 Dec 2011)
New Revision: 37143
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
Log:
with junit4, tests run clean. so... switch to junit4 [JBIDE-10350]
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2011-12-09 01:10:58 UTC (rev 37142)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2011-12-09 02:50:10 UTC (rev 37143)
@@ -5,7 +5,7 @@
Bundle-Version: 1.2.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.jboss.tools.jbpm.convert,
- org.junit,
+ org.junit4,
org.eclipse.core.runtime;bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %BundleProvider
14 years, 4 months
JBoss Tools SVN: r37142 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-08 20:10:58 -0500 (Thu, 08 Dec 2011)
New Revision: 37142
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ApplicationConfigForm.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ListEntries.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/LocaleConfigForm.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ManagedBeanPropertyForm.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/MapEntries.java
Log:
JBIDE-10220
https://issues.jboss.org/browse/JBIDE-10220
Static instance for WhiteSettings is declared.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ApplicationConfigForm.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ApplicationConfigForm.java 2011-12-09 01:10:26 UTC (rev 37141)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ApplicationConfigForm.java 2011-12-09 01:10:58 UTC (rev 37142)
@@ -43,7 +43,7 @@
private ChildTable messageBundleTable;
private ChildTable resourceBundleTable;
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
public ApplicationConfigForm() {
support = new XAttributeSupport(settings);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ListEntries.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ListEntries.java 2011-12-09 01:10:26 UTC (rev 37141)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ListEntries.java 2011-12-09 01:10:58 UTC (rev 37142)
@@ -44,7 +44,7 @@
private TableStructuredEditor tableEditor;
private XChildrenTableStructuredAdapter tableAdapter;
private IPropertyEditor valueClass;
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
public ListEntries() {
support = new XAttributeSupport(settings);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/LocaleConfigForm.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/LocaleConfigForm.java 2011-12-09 01:10:26 UTC (rev 37141)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/LocaleConfigForm.java 2011-12-09 01:10:58 UTC (rev 37142)
@@ -44,7 +44,7 @@
private IPropertyEditor defaultLocale;
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
public LocaleConfigForm() {
support = new XAttributeSupport(settings);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ManagedBeanPropertyForm.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ManagedBeanPropertyForm.java 2011-12-09 01:10:26 UTC (rev 37141)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/ManagedBeanPropertyForm.java 2011-12-09 01:10:58 UTC (rev 37142)
@@ -50,7 +50,7 @@
private XAttributeSupport support;
private XModelObject xmo;
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
private Composite switchComposite;
private Control anyLabel;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/MapEntries.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/MapEntries.java 2011-12-09 01:10:26 UTC (rev 37141)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/form/MapEntries.java 2011-12-09 01:10:58 UTC (rev 37142)
@@ -51,7 +51,7 @@
private IPropertyEditor valueClass;
private IPropertyEditor keyClass;
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
public MapEntries() {
support = new XAttributeSupport(settings);
14 years, 4 months
JBoss Tools SVN: r37141 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: model/ui/forms and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-08 20:10:26 -0500 (Thu, 08 Dec 2011)
New Revision: 37141
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SampleChildForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SamplePropertyForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/DefaultFormPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/WhiteSettings.java
Log:
JBIDE-10220
https://issues.jboss.org/browse/JBIDE-10220
Static instance for WhiteSettings is declared.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SampleChildForm.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SampleChildForm.java 2011-12-09 01:05:42 UTC (rev 37140)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SampleChildForm.java 2011-12-09 01:10:26 UTC (rev 37141)
@@ -30,7 +30,7 @@
private XModelObject xmo;
// private XModel model;
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
private TableStructuredEditor tableEditor;
private XChildrenTableStructuredAdapter tableAdapter;
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SamplePropertyForm.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SamplePropertyForm.java 2011-12-09 01:05:42 UTC (rev 37140)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/form/SamplePropertyForm.java 2011-12-09 01:10:26 UTC (rev 37141)
@@ -40,7 +40,7 @@
private boolean isGreedy = false;
public SamplePropertyForm() {
- settings = new WhiteSettings();
+ settings = WhiteSettings.getWhite();
support = new SampleXAttributeSupport(settings);
support.addPropertyChangeListener(this);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2011-12-09 01:05:42 UTC (rev 37140)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2011-12-09 01:10:26 UTC (rev 37141)
@@ -46,7 +46,7 @@
private XTable tableEditor = new XTable();
TableProviderImpl tableProvider = new TableProviderImpl();
CommandBar bar = new CommandBar();
- private IWidgetSettings settings = new WhiteSettings();
+ private IWidgetSettings settings = WhiteSettings.getWhite();
public AnyElementForm() {
this.setCollapsable(Boolean.TRUE.booleanValue());
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/DefaultFormPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/DefaultFormPage.java 2011-12-09 01:05:42 UTC (rev 37140)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/DefaultFormPage.java 2011-12-09 01:10:26 UTC (rev 37141)
@@ -97,7 +97,7 @@
}
public Control createControl(Composite parent) {
- settings = new WhiteSettings();
+ settings = WhiteSettings.getWhite();
titleFont = settings.getFont("Label.Font.Title"); //$NON-NLS-1$
Composite composite = new Composite(parent, SWT.NONE);
settings.setupControl(composite);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java 2011-12-09 01:05:42 UTC (rev 37140)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java 2011-12-09 01:10:26 UTC (rev 37141)
@@ -60,7 +60,7 @@
* @param actions
*/
public FormData(String header, String description, String entityName, IFormAttributeData[] attributes, String[] entities, IFormActionData[] actions) {
- this(header, description, entityName, attributes, entities, actions, null, new WhiteSettings());
+ this(header, description, entityName, attributes, entities, actions, null, WhiteSettings.getWhite());
}
/**
@@ -72,7 +72,7 @@
* @param actions
*/
public FormData(String header, String description, IFormAttributeData[] attributes, String[] entities, IFormActionData[] actions) {
- this(header, description, null, attributes, entities, actions, null, new WhiteSettings());
+ this(header, description, null, attributes, entities, actions, null, WhiteSettings.getWhite());
}
/**
@@ -82,7 +82,7 @@
* @param forms
*/
public FormData(String entityName, String[] entities, IFormData[] forms) {
- this(null, null, entityName, null, entities, null, forms, new WhiteSettings());
+ this(null, null, entityName, null, entities, null, forms, WhiteSettings.getWhite());
}
/**
@@ -93,7 +93,7 @@
* @param attributes
*/
public FormData(String header, String description, String entityName, IFormAttributeData[] attributes) {
- this(header, description, entityName, attributes, null, null, null, new WhiteSettings());
+ this(header, description, entityName, attributes, null, null, null, WhiteSettings.getWhite());
}
/**
@@ -103,7 +103,7 @@
* @param attributes
*/
public FormData(String header, String description, IFormAttributeData[] attributes) {
- this(header, description, null, attributes, null, null, null, new WhiteSettings());
+ this(header, description, null, attributes, null, null, null, WhiteSettings.getWhite());
}
/**
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/WhiteSettings.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/WhiteSettings.java 2011-12-09 01:05:42 UTC (rev 37140)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/WhiteSettings.java 2011-12-09 01:10:26 UTC (rev 37141)
@@ -12,7 +12,6 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -22,6 +21,15 @@
public class WhiteSettings extends DefaultSettings {
+ private static WhiteSettings whiteSettings;
+
+ public static IWidgetSettings getWhite() {
+ if(whiteSettings == null) {
+ whiteSettings = new WhiteSettings();
+ }
+ return whiteSettings;
+ }
+
private Color listBorderColor;
private Color separatorColor;
@@ -31,7 +39,7 @@
private FormToolkit toolkit = null;
- public WhiteSettings() {
+ private WhiteSettings() {
super();
}
14 years, 4 months