JBoss Tools SVN: r21964 - branches/jbosstools-3.1.x/birt/features/org.jboss.tools.birt.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-05-07 17:22:31 -0400 (Fri, 07 May 2010)
New Revision: 21964
Modified:
branches/jbosstools-3.1.x/birt/features/org.jboss.tools.birt.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-6139 Project facet group group.birt.chart.runtime not found
Modified: branches/jbosstools-3.1.x/birt/features/org.jboss.tools.birt.feature/feature.xml
===================================================================
--- branches/jbosstools-3.1.x/birt/features/org.jboss.tools.birt.feature/feature.xml 2010-05-07 21:17:51 UTC (rev 21963)
+++ branches/jbosstools-3.1.x/birt/features/org.jboss.tools.birt.feature/feature.xml 2010-05-07 21:22:31 UTC (rev 21964)
@@ -1,47 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.birt.feature"
- label="%featureName"
- version="1.0.0"
- provider-name="%providerName"
- plugin="org.jboss.tools.birt.oda.ui">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.birt" version="2.5.0" match="greaterOrEqual"/>
- <import feature="org.eclipse.birt.integration.wtp" version="2.5.0" match="greaterOrEqual"/>
- </requires>
-
- <plugin
- id="org.jboss.tools.birt.oda"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.birt.oda.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.birt.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.birt.feature"
+ label="%featureName"
+ version="1.0.0"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.birt.oda.ui">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.birt" version="2.5.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.birt.integration.wtp" version="2.5.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.birt.chart" version="2.5.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.birt.chart.integration.wtp" version="2.5.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.birt.oda"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.birt.oda.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.birt.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
15 years, 11 months
JBoss Tools SVN: r21963 - trunk/birt/features/org.jboss.tools.birt.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-05-07 17:17:51 -0400 (Fri, 07 May 2010)
New Revision: 21963
Modified:
trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-6139 Project facet group group.birt.chart.runtime not found
Modified: trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2010-05-07 18:00:46 UTC (rev 21962)
+++ trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2010-05-07 21:17:51 UTC (rev 21963)
@@ -1,47 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.birt.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.jboss.tools.birt.oda.ui">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.birt" version="2.5.0" match="greaterOrEqual"/>
- <import feature="org.eclipse.birt.integration.wtp" version="2.5.0" match="greaterOrEqual"/>
- </requires>
-
- <plugin
- id="org.jboss.tools.birt.oda"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.birt.oda.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.birt.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.birt.feature"
+ label="%featureName"
+ version="1.1.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.birt.oda.ui">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.birt" version="2.5.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.birt.integration.wtp" version="2.5.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.birt.chart" version="2.5.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.birt.chart.integration.wtp" version="2.5.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.birt.oda"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.birt.oda.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.birt.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
15 years, 11 months
JBoss Tools SVN: r21962 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-05-07 14:00:46 -0400 (Fri, 07 May 2010)
New Revision: 21962
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java
Log:
JBIDE-6213: Text hover calculations failed
Issue is fixed
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java 2010-05-07 16:35:24 UTC (rev 21961)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/XMLRecognizerContext.java 2010-05-07 18:00:46 UTC (rev 21962)
@@ -91,6 +91,9 @@
}
Reader xml = new StringReader(docTypeString + "<root></root>"); //$NON-NLS-1$
DocumentBuilder db = SafeDocumentBuilderFactory.createDocumentBuilder(false);
+ if (db == null)
+ return NULL_INFO;
+
try {
db.setErrorHandler(new ErrorHandler() {
public void warning(SAXParseException exception)
15 years, 11 months
JBoss Tools SVN: r21961 - in trunk: cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-05-07 12:35:24 -0400 (Fri, 07 May 2010)
New Revision: 21961
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/AnotherScope.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FishStereotype.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new CDI validation rule: Producer field with a parameterized type with a type variable declares any scope other than @Dependent
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-07 16:26:53 UTC (rev 21960)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -544,6 +544,32 @@
}
}
}
+
+ /**
+ * 3.3. Producer methods
+ * - producer method with a parameterized return type with a type variable declares any scope other than @Dependent
+ *
+ * 3.4. Producer fields
+ * - producer field with a parameterized type with a type variable declares any scope other than @Dependent
+ */
+ if(paramTypes.length>0) {
+ IScope scope = producer.getScope();
+ if(!CDIConstants.DEPENDENT_ANNOTATION_TYPE_NAME.equals(scope.getSourceType().getFullyQualifiedName())) {
+ ITextSourceReference declaration = typeDeclaration;
+ Set<IScopeDeclaration> decls = producer.getScopeDeclarations();
+ for (IScopeDeclaration decl : decls) {
+ if(decl.getParentMember().getResource().equals(producer.getResource())) {
+ declaration = decl;
+ break;
+ }
+ }
+ boolean field = producer instanceof IProducerField;
+ addError(
+ field?CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD:CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
+ field?CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD:CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD,
+ declaration, producer.getResource());
+ }
+ }
}
String[] typeVariables = producer.getBeanClass().getTypeParameterSignatures();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-05-07 16:26:53 UTC (rev 21960)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -64,8 +64,8 @@
{CDIPreferences.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_stereotypeDeclaresMoreThanOneScope_label},
// {CDIPreferences.ILLEGAL_SCOPE_FOR_MANAGED_BEAN, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForManagedBean_label},
// {CDIPreferences.ILLEGAL_SCOPE_FOR_SESSION_BEAN, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForSessionBean_label},
-// {CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForProducerMethod_label},
-// {CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForProducerField_label},
+ {CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForProducerMethod_label},
+ {CDIPreferences.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForProducerField_label},
// {CDIPreferences.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeWhenTypeInjectionPointIsInjected_label},
// {CDIPreferences.ILLEGAL_SCOPE_FOR_INTERCEPTOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForInterceptor_label},
// {CDIPreferences.ILLEGAL_SCOPE_FOR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalScopeForDecorator_label},
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/AnotherScope.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/AnotherScope.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/AnotherScope.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.producers;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.NormalScope;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@NormalScope
+@interface AnotherScope {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/AnotherScope.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FishStereotype.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FishStereotype.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FishStereotype.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.producers;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@ApplicationScoped
+@Named
+@interface FishStereotype {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FishStereotype.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -0,0 +1,44 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.producers;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+public class ParameterizedTypeWithWrongScope_Broken {
+
+ @Produces public FunnelWeaver<String> getAnotherFunnelWeaver;
+
+ @AnotherScope
+ @Produces public FunnelWeaver<String> getAnotherFunnelWeaver2;
+
+ @Dependent @Produces public FunnelWeaver<String> getAnotherFunnelWeaver3;
+
+ @AnotherScope @Produces public String getAnotherFunnelWeaver4;
+
+ @FishStereotype
+ @Produces public FunnelWeaver<String> getAnotherFunnelWeaver5;
+
+ @Produces public FunnelWeaver<String> create(InjectionPoint point) {
+ return null;
+ }
+
+ @AnotherScope
+ @Produces
+ public FunnelWeaver<String> create2(InjectionPoint point) {
+ return null;
+ }
+
+ @Dependent @Produces public FunnelWeaver<String> create3(InjectionPoint point) {
+ return null;
+ }
+
+ @AnotherScope @Produces public String create4(InjectionPoint point) {
+ return null;
+ }
+
+ @FishStereotype
+ @Produces
+ public FunnelWeaver<String> create5(InjectionPoint point) {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-07 16:26:53 UTC (rev 21960)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -308,23 +308,38 @@
*
* @throws Exception
*/
- public void testVariableType() throws Exception {
+ public void testTypeVariable() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
}
/**
+ * 3.3. Producer methods
+ * - producer method with a parameterized return type with a type variable declares any scope other than @Dependent
+ *
+ * @throws Exception
+ */
+ public void testParameterizedReturnTypeWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25, 41);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 21);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 32);
+ }
+
+ /**
* 3.4. Producer fields
* - producer field with a parameterized type with a type variable declares any scope other than @Dependent
- * // TODO
*
* @throws Exception
*/
-// public void testParameterizedReturnTypeWithTypeVariable() throws Exception {
-// IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
-// AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 23, 1008, 1033);
-// AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 24, 10011, 1036);
-// }
+ public void testParameterizedTypeWithWrongScope() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 11, 19);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 9);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 14);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 16);
+ }
/**
* 3.9.1. Declaring an initializer method
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-05-07 16:26:53 UTC (rev 21960)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-05-07 16:35:24 UTC (rev 21961)
@@ -149,9 +149,9 @@
}
public static void assertMarkerIsNotCreated(IResource resource, String type, String pattern, int expectedLine) throws CoreException {
- int line = findMarkerLine(resource, type, pattern);
+ List<Integer> lines = findMarkerLines(resource, type, pattern);
- assertFalse("Marker matches the '" + pattern + "' pattern was found", line != -1); //$NON-NLS-1$ //$NON-NLS-2$
+ assertFalse("Marker matches the '" + pattern + "' pattern was found", lines.contains(expectedLine)); //$NON-NLS-1$ //$NON-NLS-2$
}
public static void assertMarkerIsCreated(IResource resource, String type, String pattern) throws CoreException {
15 years, 11 months
JBoss Tools SVN: r21960 - in trunk/esb/tests/org.jboss.tools.esb.core.test: src/org/jboss/tools/esb/core/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-07 12:26:53 -0400 (Fri, 07 May 2010)
New Revision: 21960
Modified:
trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6164
Modified: trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml 2010-05-07 15:59:20 UTC (rev 21959)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml 2010-05-07 16:26:53 UTC (rev 21960)
@@ -21,6 +21,12 @@
<target class="NotifyQueues">
<queue jndiName="queue/MincomJMS_reply"/>
</target>
+ <target auth="true" ccTo="person(a)somewhereelse.com"
+ class="NotifyEmail" from="person(a)somewhere.com" host="localhost"
+ msgAttachmentName="attachment" password="smtpPassword"
+ port="8801" sendTo="person(a)elsewhere.com" subject="theSubject" username="smtpUsername">
+ <attachment>attachThisFile.txt</attachment>
+ </target>
</NotificationList>
</property>
</action>
Modified: trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2010-05-07 15:59:20 UTC (rev 21959)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2010-05-07 16:26:53 UTC (rev 21960)
@@ -273,6 +273,36 @@
assertTrue(errorList.toString(), errorList.length() == 0);
}
+ public void testNotifyEmail() {
+ XModelObject object = getFileObject("esb-1.2", "jboss-esb-notifiers.xml", ESBConstants.ENT_ESB_FILE_120);
+
+ StringBuffer errorList = new StringBuffer();
+
+ String notifyEmailPath = "Services/s/Actions/SendResponseNotifier/ok/NotifyEmail";
+
+ String[][] notifyEmailAttrValues = {
+ {"from", "person(a)somewhere.com"},
+ {"send to", "person(a)elsewhere.com"},
+ {"subject", "theSubject"},
+ {"host", "localhost"},
+ {"port", "8801"},
+ {"username", "smtpUsername"},
+ {"password", "smtpPassword"},
+ {"auth", "true"},
+ {"copy to", "person(a)somewhereelse.com"},
+ {"attachment name", "attachment"},
+ };
+ checkAttributes(object, notifyEmailPath, notifyEmailAttrValues, errorList);
+
+ String attachmentPath = notifyEmailPath + "/attachThisFile.txt";
+ String[][] attachmentAttrValues = {
+ {"file", "attachThisFile.txt"},
+ };
+ checkAttributes(object, attachmentPath, attachmentAttrValues, errorList);
+
+ assertTrue(errorList.toString(), errorList.length() == 0);
+ }
+
XModelObject getFileObject(String parentPath, String xmlname) {
return getFileObject(parentPath, xmlname, ESBConstants.ENT_ESB_FILE_101);
}
15 years, 11 months
JBoss Tools SVN: r21959 - branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-07 11:59:20 -0400 (Fri, 07 May 2010)
New Revision: 21959
Modified:
branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-6164
Modified: branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta
===================================================================
--- branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta 2010-05-07 15:55:56 UTC (rev 21958)
+++ branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta 2010-05-07 15:59:20 UTC (rev 21959)
@@ -398,6 +398,11 @@
<XModelAttribute PROPERTIES="category=general" name="send to" xmlname="sendTo"/>
<XModelAttribute PROPERTIES="category=advanced" name="copy to" xmlname="ccTo"/>
<XModelAttribute PROPERTIES="category=general" name="subject" xmlname="subject"/>
+ <XModelAttribute PROPERTIES="category=general" name="host" xmlname="host"/>
+ <XModelAttribute PROPERTIES="category=general" name="port" xmlname="port"/>
+ <XModelAttribute PROPERTIES="category=general" name="username" xmlname="username"/>
+ <XModelAttribute PROPERTIES="category=general" name="password" xmlname="password"/>
+ <XModelAttribute PROPERTIES="category=general" name="auth" xmlname="auth"/>
<XModelAttribute PROPERTIES="category=advanced" name="message" xmlname="message"/>
<XModelAttribute PROPERTIES="category=advanced"
name="attachment name" xmlname="msgAttachmentName"/>
15 years, 11 months
JBoss Tools SVN: r21958 - trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-07 11:55:56 -0400 (Fri, 07 May 2010)
New Revision: 21958
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-6164
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta 2010-05-07 15:54:55 UTC (rev 21957)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta 2010-05-07 15:55:56 UTC (rev 21958)
@@ -398,6 +398,11 @@
<XModelAttribute PROPERTIES="category=general" name="send to" xmlname="sendTo"/>
<XModelAttribute PROPERTIES="category=advanced" name="copy to" xmlname="ccTo"/>
<XModelAttribute PROPERTIES="category=general" name="subject" xmlname="subject"/>
+ <XModelAttribute PROPERTIES="category=general" name="host" xmlname="host"/>
+ <XModelAttribute PROPERTIES="category=general" name="port" xmlname="port"/>
+ <XModelAttribute PROPERTIES="category=general" name="username" xmlname="username"/>
+ <XModelAttribute PROPERTIES="category=general" name="password" xmlname="password"/>
+ <XModelAttribute PROPERTIES="category=general" name="auth" xmlname="auth"/>
<XModelAttribute PROPERTIES="category=advanced" name="message" xmlname="message"/>
<XModelAttribute PROPERTIES="category=advanced"
name="attachment name" xmlname="msgAttachmentName"/>
15 years, 11 months
JBoss Tools SVN: r21957 - in branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test: src/org/jboss/tools/esb/core/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-05-07 11:54:55 -0400 (Fri, 07 May 2010)
New Revision: 21957
Modified:
branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml
branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6164
Modified: branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml
===================================================================
--- branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml 2010-05-07 14:52:45 UTC (rev 21956)
+++ branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/projects/Test/esb-1.2/jboss-esb-notifiers.xml 2010-05-07 15:54:55 UTC (rev 21957)
@@ -21,6 +21,12 @@
<target class="NotifyQueues">
<queue jndiName="queue/MincomJMS_reply"/>
</target>
+ <target auth="true" ccTo="person(a)somewhereelse.com"
+ class="NotifyEmail" from="person(a)somewhere.com" host="localhost"
+ msgAttachmentName="attachment" password="smtpPassword"
+ port="8801" sendTo="person(a)elsewhere.com" subject="theSubject" username="smtpUsername">
+ <attachment>attachThisFile.txt</attachment>
+ </target>
</NotificationList>
</property>
</action>
Modified: branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
===================================================================
--- branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2010-05-07 14:52:45 UTC (rev 21956)
+++ branches/jbosstools-3.1.x/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2010-05-07 15:54:55 UTC (rev 21957)
@@ -273,6 +273,36 @@
assertTrue(errorList.toString(), errorList.length() == 0);
}
+ public void testNotifyEmail() {
+ XModelObject object = getFileObject("esb-1.2", "jboss-esb-notifiers.xml", ESBConstants.ENT_ESB_FILE_120);
+
+ StringBuffer errorList = new StringBuffer();
+
+ String notifyEmailPath = "Services/s/Actions/SendResponseNotifier/ok/NotifyEmail";
+
+ String[][] notifyEmailAttrValues = {
+ {"from", "person(a)somewhere.com"},
+ {"send to", "person(a)elsewhere.com"},
+ {"subject", "theSubject"},
+ {"host", "localhost"},
+ {"port", "8801"},
+ {"username", "smtpUsername"},
+ {"password", "smtpPassword"},
+ {"auth", "true"},
+ {"copy to", "person(a)somewhereelse.com"},
+ {"attachment name", "attachment"},
+ };
+ checkAttributes(object, notifyEmailPath, notifyEmailAttrValues, errorList);
+
+ String attachmentPath = notifyEmailPath + "/attachThisFile.txt";
+ String[][] attachmentAttrValues = {
+ {"file", "attachThisFile.txt"},
+ };
+ checkAttributes(object, attachmentPath, attachmentAttrValues, errorList);
+
+ assertTrue(errorList.toString(), errorList.length() == 0);
+ }
+
XModelObject getFileObject(String parentPath, String xmlname) {
return getFileObject(parentPath, xmlname, ESBConstants.ENT_ESB_FILE_101);
}
15 years, 11 months
JBoss Tools SVN: r21956 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-05-07 10:52:45 -0400 (Fri, 07 May 2010)
New Revision: 21956
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FunnelWeaver.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new CDI validation rule: producer field type is a type variable
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2010-05-07 14:15:34 UTC (rev 21955)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2010-05-07 14:52:45 UTC (rev 21956)
@@ -21,7 +21,7 @@
public interface IParametedType {
/**
- * Returns the corresponding IType of the declaration.
+ * Returns the corresponding IType of the declaration. May be null.
*
* @return the corresponding IType of the declaration.
*/
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-07 14:15:34 UTC (rev 21955)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-05-07 14:52:45 UTC (rev 21956)
@@ -31,6 +31,7 @@
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.wst.validation.internal.core.ValidationException;
@@ -74,6 +75,9 @@
import org.jboss.tools.jst.web.kb.validation.IValidator;
import org.jboss.tools.jst.web.kb.validation.ValidationUtil;
+/**
+ * @author Alexey Kazakov
+ */
public class CDICoreValidator extends CDIValidationErrorManager implements IValidator {
public static final String ID = "org.jboss.tools.cdi.core.CoreValidator";
@@ -472,6 +476,9 @@
boolean businessMethod = false;
for (IParametedType type : types) {
IType sourceType = type.getType();
+ if(sourceType==null) {
+ continue;
+ }
IAnnotation annotation = sourceType.getAnnotation(CDIConstants.LOCAL_ANNOTATION_TYPE_NAME);
if(annotation==null) {
annotation = sourceType.getAnnotation("Local"); //$NON-NLS-N1
@@ -503,73 +510,162 @@
private static final String[] RESOURCE_ANNOTATIONS = {CDIConstants.RESOURCE_ANNOTATION_TYPE_NAME, CDIConstants.WEB_SERVICE_REF_ANNOTATION_TYPE_NAME, CDIConstants.EJB_ANNOTATION_TYPE_NAME, CDIConstants.PERSISTENCE_CONTEXT_ANNOTATION_TYPE_NAME, CDIConstants.PERSISTENCE_UNIT_ANNOTATION_TYPE_NAME};
private void validateProducer(IProducer producer) {
- if(producer instanceof IProducerField) {
- /*
- * 3.5.1. Declaring a resource
- * - producer field declaration specifies an EL name (together with one of @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
- */
- IProducerField producerField = (IProducerField)producer;
- if(producerField.getName()!=null) {
- IAnnotationDeclaration declaration;
- for (String annotationType : RESOURCE_ANNOTATIONS) {
- declaration = producerField.getAnnotation(annotationType);
- if(declaration!=null) {
- IAnnotationDeclaration nameDeclaration = producerField.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
- if(nameDeclaration!=null) {
- declaration = nameDeclaration;
+ try {
+ Set<ITypeDeclaration> typeDeclarations = producer
+ .getAllTypeDeclarations();
+ ITypeDeclaration typeDeclaration = null;
+ if (!typeDeclarations.isEmpty()) {
+ /*
+ * 3.3. Producer methods
+ * - producer method return type contains a wildcard type parameter
+ *
+ * 2.2.1 Legal bean types
+ * - a parameterized type that contains a wildcard type parameter is not a legal bean type.
+ *
+ * 3.4. Producer fields
+ * - producer field type contains a wildcard type parameter
+ */
+ typeDeclaration = typeDeclarations.iterator()
+ .next();
+ String[] paramTypes = Signature
+ .getTypeArguments(typeDeclaration.getSignature());
+ for (String paramType : paramTypes) {
+ if (Signature.getTypeSignatureKind(paramType) == Signature.WILDCARD_TYPE_SIGNATURE) {
+ if (producer instanceof IProducerField) {
+ addError(
+ CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD,
+ CDIPreferences.PRODUCER_FIELD_TYPE_HAS_WILDCARD,
+ typeDeclaration, producer.getResource());
+ } else {
+ addError(
+ CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD,
+ CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD,
+ typeDeclaration, producer.getResource());
}
- addError(CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, CDIPreferences.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, declaration, producer.getResource());
}
}
}
- /*
- * 3.4. Producer fields
- * - producer field type contains a wildcard type parameter
- */
- Set<ITypeDeclaration> typeDeclarations = producerField.getAllTypeDeclarations();
- if(!typeDeclarations.isEmpty()) {
- ITypeDeclaration typeDeclaration = typeDeclarations.iterator().next();
- String[] paramTypes = Signature.getTypeArguments(typeDeclaration.getSignature());
- for (String paramType : paramTypes) {
- if((paramType.length()==1 && paramType.charAt(0) == Signature.C_STAR) || paramType.charAt(0) == Signature.C_EXTENDS) {
- addError(CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, CDIPreferences.PRODUCER_FIELD_TYPE_HAS_WILDCARD, typeDeclaration, producer.getResource());
+
+ String[] typeVariables = producer.getBeanClass().getTypeParameterSignatures();
+
+ if (producer instanceof IProducerField) {
+ /*
+ * 3.5.1. Declaring a resource
+ * - producer field declaration specifies an EL name (together with one of @Resource, @PersistenceContext, @PersistenceUnit, @EJB, @WebServiceRef)
+ */
+ IProducerField producerField = (IProducerField) producer;
+ if (producerField.getName() != null) {
+ IAnnotationDeclaration declaration;
+ for (String annotationType : RESOURCE_ANNOTATIONS) {
+ declaration = producerField
+ .getAnnotation(annotationType);
+ if (declaration != null) {
+ IAnnotationDeclaration nameDeclaration = producerField
+ .getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if (nameDeclaration != null) {
+ declaration = nameDeclaration;
+ }
+ addError(
+ CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME,
+ CDIPreferences.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME,
+ declaration, producer.getResource());
+ }
}
}
- }
- } else {
- IProducerMethod producerMethod = (IProducerMethod)producer;
- List<IParameter> params = producerMethod.getParameters();
- Set<ITextSourceReference> declarations = new HashSet<ITextSourceReference>();
- declarations.add(producerMethod.getAnnotation(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME));
- for (IParameter param : params) {
/*
- * 3.3.6. Declaring a disposer method
- * - a disposer method is annotated @Produces.
- *
- * 3.3.2. Declaring a producer method
- * - a has a parameter annotated @Disposes
+ * 3.4. Producer fields
+ * - producer field type is a type variable
*/
- ITextSourceReference declaration = param.getAnnotationPosition(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
- if(declaration!=null) {
- declarations.add(declaration);
+ if(typeVariables.length>0) {
+ String typeSign = producerField.getField().getTypeSignature();
+ String typeString = Signature.toString(typeSign);
+ for (String variableSig : typeVariables) {
+ String variableName = Signature.getTypeVariable(variableSig);
+ if(typeString.equals(variableName)) {
+ addError(
+ CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE,
+ CDIPreferences.PRODUCER_FIELD_TYPE_IS_VARIABLE,
+ typeDeclaration!=null?typeDeclaration:producer, producer.getResource());
+ }
+ }
}
+ } else {
+ IProducerMethod producerMethod = (IProducerMethod) producer;
+ List<IParameter> params = producerMethod.getParameters();
+ Set<ITextSourceReference> declarations = new HashSet<ITextSourceReference>();
+ declarations
+ .add(producerMethod
+ .getAnnotation(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME));
+ for (IParameter param : params) {
+ /*
+ * 3.3.6. Declaring a disposer method
+ * - a disposer method is annotated @Produces.
+ *
+ * 3.3.2. Declaring a producer method
+ * - a has a parameter annotated @Disposes
+ */
+ ITextSourceReference declaration = param
+ .getAnnotationPosition(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
+ if (declaration != null) {
+ declarations.add(declaration);
+ }
+ /*
+ * 3.3.2. Declaring a producer method
+ * - a has a parameter annotated @Observers
+ *
+ * 10.4.2. Declaring an observer method
+ * - an observer method is annotated @Produces
+ */
+ declaration = param
+ .getAnnotationPosition(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
+ if (declaration != null) {
+ declarations.add(declaration);
+ }
+ }
+ if (declarations.size() > 1) {
+ for (ITextSourceReference declaration : declarations) {
+ addError(
+ CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED,
+ CDIPreferences.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED,
+ declaration, producer.getResource());
+ }
+ }
+
/*
- * 3.3.2. Declaring a producer method
- * - a has a parameter annotated @Observers
- *
- * 10.4.2. Declaring an observer method
- * - an observer method is annotated @Produces
+ * 3.3. Producer methods
+ * - producer method return type is a type variable
+ *
+ * 2.2.1 - Legal bean types
+ * - a type variable is not a legal bean type
*/
- declaration = param.getAnnotationPosition(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
- if(declaration!=null) {
- declarations.add(declaration);
+ String typeSign = producerMethod.getMethod().getReturnType();
+ String typeString = Signature.toString(typeSign);
+ ITypeParameter[] paramTypes = producerMethod.getMethod().getTypeParameters();
+ boolean marked = false;
+ for (ITypeParameter param : paramTypes) {
+ String variableName = param.getElementName();
+ if(variableName.equals(typeString)) {
+ addError(
+ CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
+ CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
+ typeDeclaration!=null?typeDeclaration:producer, producer.getResource());
+ marked = true;
+ }
}
- }
- if(declarations.size()>1) {
- for (ITextSourceReference declaration : declarations) {
- addError(CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED, CDIPreferences.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED, declaration, producer.getResource());
+ if(!marked && typeVariables.length>0) {
+ for (String variableSig : typeVariables) {
+ String variableName = Signature.getTypeVariable(variableSig);
+ if(typeString.equals(variableName)) {
+ addError(
+ CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
+ CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE,
+ typeDeclaration!=null?typeDeclaration:producer, producer.getResource());
+ }
+ }
}
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-05-07 14:15:34 UTC (rev 21955)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-05-07 14:52:45 UTC (rev 21956)
@@ -44,9 +44,9 @@
new String[][]{
{CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalTypeInTypedDeclaration_label},
{CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeHasWildcard_label},
-// {CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeIsVariable_label},
-// {CDIPreferences.PRODUCER_FIELD_TYPE_HAS_WILDCARD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerFieldTypeHasWildcard_label},
-// {CDIPreferences.PRODUCER_FIELD_TYPE_IS_VARIABLE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerFieldTypeIsVariable_label},
+ {CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeIsVariable_label},
+ {CDIPreferences.PRODUCER_FIELD_TYPE_HAS_WILDCARD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerFieldTypeHasWildcard_label},
+ {CDIPreferences.PRODUCER_FIELD_TYPE_IS_VARIABLE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerFieldTypeIsVariable_label},
// {CDIPreferences.PRODUCER_FIELD_TYPE_DOES_NOT_MATCH_JAVA_EE_OBJECT, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerFieldTypeDoesNotMatchJavaEeObject_label},
// {CDIPreferences.INJECTION_TYPE_IS_VARIABLE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_injectionTypeIsVariable_label},
{CDIPreferences.STEREOTYPE_IS_ANNOTATED_TYPED, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_stereotypeIsAnnotatedTyped_label},
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FunnelWeaver.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FunnelWeaver.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FunnelWeaver.java 2010-05-07 14:52:45 UTC (rev 21956)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.producers;
+
+class FunnelWeaver<T> {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/FunnelWeaver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java 2010-05-07 14:52:45 UTC (rev 21956)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.producers;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+public class SpiderProducerVariableType_Broken<T> {
+
+ @Produces public FunnelWeaver<T> getAnotherFunnelWeaver;
+
+ @Produces T getAnotherFunnelWeaver2;
+
+ @Produces
+ public T create(InjectionPoint point) {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-07 14:15:34 UTC (rev 21955)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-05-07 14:52:45 UTC (rev 21956)
@@ -261,18 +261,72 @@
}
/**
+ * 3.3. Producer methods
+ * - producer method return type contains a wildcard type parameter
+ *
+ * 2.2.1 - Legal bean types
+ * - a parameterized type that contains a wildcard type parameter is not a legal bean type.
+ *
+ * @throws Exception
+ */
+ public void testParameterizedReturnTypeWithWildcard() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/SpiderProducer.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
+ }
+
+ /**
* 3.4. Producer fields
* - producer field type contains a wildcard type parameter
*
* @throws Exception
*/
- public void testParameterizedReturnTypeWithWildcard() throws Exception {
+ public void testParameterizedTypeWithWildcard() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/parameterizedReturnTypeWithWildcard/SpiderProducerWildCardType_Broken.java");
AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1008, 1033);
AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 10011, 1036);
}
/**
+ * 3.3. Producer methods
+ * - producer method return type is a type variable
+ *
+ * 2.2.1 - Legal bean types
+ * - a type variable is not a legal bean type
+ *
+ * @throws Exception
+ */
+ public void testParameterizedType() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/TProducer.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
+ }
+
+ /**
+ * 3.4. Producer methods
+ * - producer field type is a type variable
+ *
+ * @throws Exception
+ */
+ public void testVariableType() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
+ }
+
+ /**
+ * 3.4. Producer fields
+ * - producer field with a parameterized type with a type variable declares any scope other than @Dependent
+ * // TODO
+ *
+ * @throws Exception
+ */
+// public void testParameterizedReturnTypeWithTypeVariable() throws Exception {
+// IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
+// AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 23, 1008, 1033);
+// AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 24, 10011, 1036);
+// }
+
+ /**
* 3.9.1. Declaring an initializer method
* - an initializer method has a parameter annotated @Disposes
*
15 years, 11 months
JBoss Tools SVN: r21955 - in trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: config and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2010-05-07 10:15:34 -0400 (Fri, 07 May 2010)
New Revision: 21955
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RemoveServer.java
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/ClearProjects.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopServer.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
Log:
SWTbot extensions : auto-shutdown server after all tests finished, improved @Server annotation
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -9,6 +9,7 @@
import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
import org.jboss.tools.ui.bot.ext.config.requirement.RequirementBase;
+import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
@@ -26,6 +27,9 @@
* @author lzoubek(a)redhat.com
*/
public class RequirementAwareSuite extends Suite {
+ // we have one global instance of cleanup listener
+ final static DoAfterAllTestsRunListener cleanUp = new DoAfterAllTestsRunListener();
+
class ReqAwareClassRunner extends BlockJUnit4ClassRunner {
private final List<RequirementBase> requirements;
@@ -37,14 +41,19 @@
@Override
public void run(RunNotifier notifier) {
- // adding ability to create screen shot (taken from SWTBotJunit4ClassRunner)
+ // planned test counter must know about all tests (methods) within a class
+ cleanUp.incrPlanned(getChildren().size()-1);
+ // ensure that we have exactly 1 cleanup listener registered
+ notifier.removeListener(cleanUp);
+ notifier.addListener(cleanUp);
+ // adding ability to create screen shot (taken from
+ // SWTBotJunit4ClassRunner)
RunListener failureSpy = new ScreenshotCaptureListener();
notifier.removeListener(failureSpy);
- notifier.addListener(failureSpy);
+ notifier.addListener(failureSpy);
try {
super.run(notifier);
- }
- finally {
+ } finally {
notifier.removeListener(failureSpy);
}
}
@@ -57,7 +66,7 @@
r.fulfill();
}
} catch (Exception e) {
- log.error("Fulfilling failed", e);
+ log.error("Fulfilling failed", e);
}
return super.withBeforeClasses(statement);
@@ -74,19 +83,74 @@
.getClassRequirements(klass);
if (reqs != null) {
if (!TestConfigurator.checkConfig()) {
- log.info("Skipping class '" + klass.getCanonicalName()+"' - incorrect configuration");
+ log.info("Skipping class '" + klass.getCanonicalName()
+ + "' - incorrect configuration");
return null;
}
log.info("Returning runner for test class "
+ klass.getCanonicalName());
- return new ReqAwareClassRunner(klass, reqs);
+ // ensure creating runner instance
+ Runner runner = new ReqAwareClassRunner(klass, reqs);
+ // increment number of tests planned to run by 1 (class contains at least 1 test method)
+ cleanUp.incrPlanned();
+ return runner;
}
- log.info("Skipping class '" + klass.getCanonicalName() + "' - annotations do not met configuration");
+ log.info("Skipping class '" + klass.getCanonicalName()
+ + "' - annotations do not met configuration");
return null;
}
}
+ /**
+ * listener which listens to test runs, does some cleanup after all tests
+ * have run
+ *
+ * @author lzoubek
+ *
+ */
+ static class DoAfterAllTestsRunListener extends RunListener {
+ // As we can run more suites at once, we need to count tests which are planned to run
+ // and the ones which already passed (or failed), perform cleanups when the last one finishes
+ private int testsAboutToRun = 0;
+ private int testsFinished = 0;
+
+ public void incrPlanned() {
+ testsAboutToRun += 1;
+ }
+ public void incrPlanned(int amount) {
+ testsAboutToRun += amount;
+ }
+
+ public void incrFinished() {
+ testsFinished += 1;
+ }
+
+ public int getPlanned() {
+ return testsAboutToRun;
+ }
+
+ public int getFinished() {
+ return testsFinished;
+ }
+ @Override
+ public void testFinished(Description description) throws Exception {
+ incrFinished();
+ log.info("Finished tests : "+getFinished()+"/"+getPlanned());
+ if (getFinished() >= getPlanned()) {
+ log.info("All tests finished, performing cleanup requirements ");
+ try {
+ RequirementBase.createStopServer().fulfill();
+
+ log.info("All cleanup requirements performed");
+ } catch (Exception ex) {
+ log.error("Unable to fulfill cleanup requirements", ex);
+ }
+ }
+ super.testFinished(description);
+ }
+ }
+
private final ArrayList<Runner> runners = new ArrayList<Runner>();
/**
@@ -103,7 +167,6 @@
public RequirementAwareSuite(Class<?> klass) throws Throwable {
super(klass, Collections.<Runner> emptyList());
runners.add(new Suite(klass, new RequirementAwareRunnerBuilder()));
-
}
@Override
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -571,7 +571,30 @@
}
}
+ public void removeServerRuntime(String runtimeName) {
+ log.info("Removing Server Runtime: " + runtimeName );
+ SWTBot wiz = open
+ .preferenceOpen(ActionItem.Preference.ServerRuntimeEnvironments.LABEL);
+ SWTBotTable tbRuntimeEnvironments = bot.table();
+ // first check if Environment doesn't exist
+ int numRows = tbRuntimeEnvironments.rowCount();
+ if (numRows > 0) {
+ int currentRow = 0;
+ while (currentRow < numRows) {
+ if (tbRuntimeEnvironments.cell(currentRow, 0).equalsIgnoreCase(
+ runtimeName)) {
+ tbRuntimeEnvironments.select(currentRow);
+ wiz.button(IDELabel.Button.REMOVE).click();
+ open.finish(wiz,IDELabel.Button.OK);
+ log.info("Server Runtime '" + runtimeName +"' removed.");
+ return;
+ } else {
+ currentRow++;
+ }
+ }
+ }
+ }
/**
* adds given java to Installed JRE's
*
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -65,5 +65,6 @@
public static int TIME_5S = Timing.time5S();
public static int TIME_10S = Timing.time10S();
public static int TIME_20S = Timing.time20S();
+
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -70,6 +70,11 @@
*/
boolean required() default true;
/**
+ * state (default Running)
+ * @return
+ */
+ ServerState state() default ServerState.Running;
+ /**
* server type to match (Default ALL)
* @return
*/
@@ -91,7 +96,7 @@
*
*/
@Retention(RetentionPolicy.RUNTIME)
- public @interface Seam {
+ public @interface Seam {
/**
* true if Seam is required (default)
* @return
@@ -133,6 +138,20 @@
String operator() default "=";
}
+ public enum ServerState {
+ /**
+ * server will run
+ */
+ Running,
+ /**
+ * server present, but not running
+ */
+ NotRunning,
+ /**
+ * server (and runtime) not present
+ */
+ Disabled
+ }
public enum ServerType {
/**
* EAP
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -17,6 +17,7 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
import org.jboss.tools.ui.bot.ext.config.Annotations.Seam;
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.config.Annotations.ServerType;
import org.jboss.tools.ui.bot.ext.config.requirement.RequirementBase;
@@ -123,7 +124,7 @@
private static RequirementBase getServerRequirement(Server s) {
if (!s.required()) {
return null;
- }
+ }
if (!s.type().equals(ServerType.ALL)) {
if (s.type().equals(ServerType.EAP)
&& !server.type.equals(ServerBean.ServerType.EAP)) {
@@ -134,10 +135,19 @@
return null;
}
}
-
if (!matches(server.version, s.operator(), s.version())) {
return null;
}
+ if (ServerState.Disabled.equals(s.state())) {
+ RequirementBase removeServer = RequirementBase.createRemoveServer();
+ removeServer.getDependsOn().add(RequirementBase.createStopServer());
+ return removeServer;
+ }
+ if (ServerState.NotRunning.equals(s.state())) {
+ RequirementBase stopServer = RequirementBase.createStopServer();
+ stopServer.getDependsOn().add(RequirementBase.createAddServer());
+ return stopServer;
+ }
return RequirementBase.createStartServer();
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -46,6 +46,7 @@
SWTTestExt.configuredState.getServer().name=runtimeName;
SWTTestExt.configuredState.getServer().version=TestConfigurator.server.version;
SWTTestExt.configuredState.getServer().type=TestConfigurator.server.type.toString();
+ SWTTestExt.configuredState.getServer().withJavaVersion = TestConfigurator.server.withJavaVersion;
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/ClearProjects.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/ClearProjects.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/ClearProjects.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -1,6 +1,5 @@
package org.jboss.tools.ui.bot.ext.config.requirement;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
/**
* undeploys and deletes all projects
@@ -12,13 +11,7 @@
@Override
public boolean checkFulfilled() {
try {
- SWTBotTreeItem[] items = SWTTestExt.projectExplorer.show().bot().tree().getAllItems();
- if (items.length!=0) {
- for (SWTBotTreeItem item : items) {
- log.info("Item "+item.getText());
- }
- }
- return items.length==0;
+ return SWTTestExt.projectExplorer.show().bot().tree().getAllItems().length==0;
}
catch (Exception ex) {
log.error("Unable to determine count of projects",ex);
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RemoveServer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RemoveServer.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RemoveServer.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -0,0 +1,28 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+
+/**
+ * removes server and server runtime
+ * @author lzoubek(a)redhat.com
+ *
+ */
+public class RemoveServer extends RequirementBase {
+
+ @Override
+ public boolean checkFulfilled() {
+ return !SWTTestExt.configuredState.getServer().isConfigured;
+ }
+
+ @Override
+ public void handle() {
+ SWTTestExt.servers.deleteServer(SWTTestExt.configuredState.getServer().name);
+ SWTTestExt.eclipse.removeServerRuntime(SWTTestExt.configuredState.getServer().name);
+ SWTTestExt.configuredState.getServer().isConfigured=false;
+ SWTTestExt.configuredState.getServer().name=null;
+ SWTTestExt.configuredState.getServer().version=null;
+ SWTTestExt.configuredState.getServer().type=null;
+ SWTTestExt.configuredState.getServer().withJavaVersion=null;
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RemoveServer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -148,6 +148,16 @@
return req;
}
+ public static RequirementBase createStopServer() {
+ RequirementBase req = new StopServer();
+ return req;
+ }
+
+ public static RequirementBase createRemoveServer() {
+ RequirementBase req = new RemoveServer();
+ return req;
+ }
+
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopServer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopServer.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopServer.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -2,7 +2,7 @@
import org.jboss.tools.ui.bot.ext.SWTTestExt;
/**
- * Stops server (as dependent requirement has {@link AddServer}
+ * Stops server
* @author Vladimir Pakan
*
*/
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2010-05-07 13:51:18 UTC (rev 21954)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2010-05-07 14:15:34 UTC (rev 21955)
@@ -56,24 +56,42 @@
* @param serverName
*/
public void stopServer(String serverName) {
- SWTBot bot = open.viewOpen(ServerServers.LABEL).bot();
+ SWTBot bot = show().bot();
SWTBotTree tree = bot.tree();
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.STOP, false)).click();
new SWTUtilExt(this).waitForNonIgnoredJobs();
- new SWTUtilExt(this).waitForAll(Timing.time3S());
+ new SWTUtilExt(this).waitForAll(Timing.time10S());
}
}
/**
+ * deletes server with given name
+ * @param serverName
+ */
+ public void deleteServer(String serverName) {
+ SWTBot bot = show().bot();
+ SWTBotTree tree = bot.tree();
+ SWTBotTreeItem server = findServerByName(tree,serverName);
+ if (server!=null) {
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.DELETE, false)).click();
+ SWTBotShell shell = shell("Delete Server");
+ shell.activate();
+ open.finish(shell.bot(), IDELabel.Button.OK);
+ log.info("Removed server: " + serverName);
+
+ }
+ }
+ /**
* starts application server by given name
* @param serverName
*/
public void startServer(String serverName) {
show();
- SWTBot bot = open.viewOpen(ServerServers.LABEL).bot();
+ SWTBot bot = show().bot();
SWTBotTree tree = bot.tree();
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
15 years, 11 months