JBoss Tools SVN: r42011 - branches/jbosstools-3.3.x/requirements/jbeap-6.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-17 00:47:17 -0400 (Sun, 17 Jun 2012)
New Revision: 42011
Modified:
branches/jbosstools-3.3.x/requirements/jbeap-6/build.properties
Log:
use http://download.devel.redhat.com/released/JBEAP-6/6.0.0/zip/ instead of http://download.devel.redhat.com/devel/candidates/JBEAP/JBEAP-6.0.0/
Modified: branches/jbosstools-3.3.x/requirements/jbeap-6/build.properties
===================================================================
--- branches/jbosstools-3.3.x/requirements/jbeap-6/build.properties 2012-06-16 14:39:07 UTC (rev 42010)
+++ branches/jbosstools-3.3.x/requirements/jbeap-6/build.properties 2012-06-17 04:47:17 UTC (rev 42011)
@@ -2,7 +2,8 @@
# This property used to override URI outside the build
# It is usefull to make build work on build server vithout VPN access
-jbeap60.build.uri=http://download.devel.redhat.com/devel/candidates/JBEAP/JBEAP-6.0.0/
+#jbeap60.build.uri=http://download.devel.redhat.com/devel/candidates/JBEAP/JBEAP-6.0.0/
+jbeap60.build.uri=http://download.devel.redhat.com/released/JBEAP-6/6.0.0/zip/
build.uri=${jbeap60.build.uri}
jbeap60.build.archive=jboss-eap-6.0.0.zip
build.archive=${jbeap60.build.archive}
13 years, 9 months
JBoss Tools SVN: r42010 - in trunk/maven/plugins/org.jboss.tools.maven.ui: icons and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-06-16 10:39:07 -0400 (Sat, 16 Jun 2012)
New Revision: 42010
Added:
trunk/maven/plugins/org.jboss.tools.maven.ui/icons/configure_maven_repo.gif
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
Log:
JBIDE-12180 - icon for Configure Maven Repository is too big
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/icons/configure_maven_repo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.ui/icons/configure_maven_repo.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2012-06-16 00:45:27 UTC (rev 42009)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2012-06-16 14:39:07 UTC (rev 42010)
@@ -154,7 +154,7 @@
<wizard
category="org.jboss.ide.eclipse.ui.wizards"
class="org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard"
- icon="icons/repo_wiz.gif"
+ icon="icons/configure_maven_repo.gif"
id="org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard"
name="%Configure_Maven_Repositories">
</wizard>
13 years, 10 months
JBoss Tools SVN: r42009 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-15 20:45:27 -0400 (Fri, 15 Jun 2012)
New Revision: 42009
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-11460
https://issues.jboss.org/browse/JBIDE-11460
Validation of injection with unproxyable type resolved to a bean with a normal scope is fixed.
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 2012-06-16 00:45:10 UTC (rev 42008)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-06-16 00:45:27 UTC (rev 42009)
@@ -1671,104 +1671,101 @@
addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.UNSATISFIED_OR_AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
} else if(beans.size()==1) {
IBean bean = beans.iterator().next();
- if(shouldValidateType(bean.getBeanClass())) {
- /*
- * 5.2.4. Primitive types and null values
- * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
- */
- if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
- addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
- }
- /*
- * 5.1.4. Inter-module injection
- * - a decorator can not be injected
- * - an interceptor can not be injected
- * It is not an error - container just never attempts to inject them.
- */
-
- /*
- * 5.4.1. Unproxyable bean types
- * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- if(bean.getScope()!=null && bean.getScope().isNorlmalScope() && injection.getType()!=null) {
- // - Array types cannot be proxied by the container.
- String typeSignature = injection.getType().getSignature();
- int kind = Signature.getTypeSignatureKind(typeSignature);
- if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(injection.getType().isPrimitive()) {
- // - Primitive types cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(bean instanceof IClassBean) {
- try {
- if(Flags.isFinal(bean.getBeanClass().getFlags())) {
- // - Classes which are declared final cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else {
- IMethod[] methods = bean.getBeanClass().getMethods();
- boolean hasDefaultConstructor = false;
- boolean hasConstructor = false;
- for (IMethod method : methods) {
- hasConstructor = hasConstructor || method.isConstructor();
- hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
- if(Flags.isFinal(method.getFlags())) {
- // - Classes which have final methods cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- hasDefaultConstructor = true;
- break;
- }
+ /*
+ * 5.2.4. Primitive types and null values
+ * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
+ */
+ if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
+ addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
+ }
+ /*
+ * 5.1.4. Inter-module injection
+ * - a decorator can not be injected
+ * - an interceptor can not be injected
+ * It is not an error - container just never attempts to inject them.
+ */
+ /*
+ * 5.4.1. Unproxyable bean types
+ * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ if(bean.getScope()!=null && bean.getScope().isNorlmalScope() && injection.getType()!=null) {
+ // - Array types cannot be proxied by the container.
+ String typeSignature = injection.getType().getSignature();
+ int kind = Signature.getTypeSignatureKind(typeSignature);
+ if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(injection.getType().isPrimitive()) {
+ // - Primitive types cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(injection.getType().getType().exists()){
+ try {
+ if(Flags.isFinal(injection.getType().getType().getFlags())) {
+ // - Classes which are declared final cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else {
+ IMethod[] methods = injection.getType().getType().getMethods();
+ boolean hasDefaultConstructor = false;
+ boolean hasConstructor = false;
+ for (IMethod method : methods) {
+ hasConstructor = hasConstructor || method.isConstructor();
+ hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
+ if(Flags.isFinal(method.getFlags())) {
+ // - Classes which have final methods cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ hasDefaultConstructor = true;
+ break;
}
- if(!hasDefaultConstructor && hasConstructor) {
- // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- }
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
+ if(!hasDefaultConstructor && hasConstructor) {
+ // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getElementName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ }
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
}
- if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
- try {
- IType beanClass = bean.getBeanClass();
- if(Flags.isFinal(beanClass.getFlags())) {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
- // the problem and treats it as a deployment problem.
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getElementName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- } else {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
- // the container automatically detects the problem and treats it as a deployment problem.
- IType decoratorClass = injection.getClassBean().getBeanClass();
- IMethod[] methods = decoratorClass.getMethods();
- boolean reported = false;
- if(methods!=null) {
- for (IMethod method : methods) {
- if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
- IMethod[] beanMethods = beanClass.findMethods(method);
- if(beanMethods!=null) {
- for (IMethod beanMethod : beanMethods) {
- int flags = beanMethod.getFlags();
- if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
- String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getElementName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- reported = true;
- break;
- }
- }
- if(reported) {
+ }
+ if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean && bean.getBeanClass().exists()) {
+ try {
+ IType beanClass = bean.getBeanClass();
+ if(Flags.isFinal(beanClass.getFlags())) {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
+ // the problem and treats it as a deployment problem.
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getElementName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ } else {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
+ // the container automatically detects the problem and treats it as a deployment problem.
+ IType decoratorClass = injection.getClassBean().getBeanClass();
+ IMethod[] methods = decoratorClass.getMethods();
+ boolean reported = false;
+ if(methods!=null) {
+ for (IMethod method : methods) {
+ if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
+ IMethod[] beanMethods = beanClass.findMethods(method);
+ if(beanMethods!=null) {
+ for (IMethod beanMethod : beanMethods) {
+ int flags = beanMethod.getFlags();
+ if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
+ String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getElementName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ reported = true;
break;
}
}
+ if(reported) {
+ break;
+ }
}
}
}
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
}
}
13 years, 10 months
JBoss Tools SVN: r42008 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-15 20:45:10 -0400 (Fri, 15 Jun 2012)
New Revision: 42008
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/IUnproxyable.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
Log:
JBIDE-11460
https://issues.jboss.org/browse/JBIDE-11460
Validation of injection with unproxyable type resolved to a bean with a normal scope is fixed. Tests.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -21,6 +21,7 @@
class FishFarm
{
- @Inject Tuna_Broken tuna;
+ @Inject Tuna_Broken tuna; //error
+ @Inject Tuna tuna2; //ok
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable.finalClass;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+public class Opportunity {
+
+ @Inject
+ @Named("iiOpportunity")
+ String s;
+
+ @Produces
+ @Named("iiOpportunity")
+ @RequestScoped
+ String t;
+
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable.finalClass;
+
+import javax.enterprise.context.RequestScoped;
+
+public interface Tuna
+{
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalClass/Tuna_Broken.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -19,7 +19,7 @@
import javax.enterprise.context.RequestScoped;
@RequestScoped
-final class Tuna_Broken
+final class Tuna_Broken implements Tuna
{
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -20,5 +20,7 @@
class FishFarm
{
- @Inject Tuna_Broken tuna;
+ @Inject Tuna_Broken tuna; //error
+
+ @Inject Tuna tuna2; //ok
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable.finalMethod;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+punlic interface Tuna
+{
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/finalMethod/Tuna_Broken.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -19,7 +19,7 @@
import javax.enterprise.context.RequestScoped;
@RequestScoped
-class Tuna_Broken
+class Tuna_Broken implements Tuna
{
public final String getFoo() { return null; }
}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/IUnproxyable.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/IUnproxyable.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/IUnproxyable.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.lookup.clientProxy.unproxyable.privateConstructor;
+
+import javax.enterprise.context.RequestScoped;
+
+public interface IUnproxyable
+{
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/IUnproxyable.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -20,5 +20,7 @@
class InjectionPointBean
{
- @Inject Unproxyable_Broken foo;
+ @Inject Unproxyable_Broken foo; //error
+
+ @Inject IUnproxyable foo2; //ok
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/Unproxyable_Broken.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -19,7 +19,7 @@
import javax.enterprise.context.RequestScoped;
@RequestScoped
-class Unproxyable_Broken
+class Unproxyable_Broken implements IUnproxyable
{
private Unproxyable_Broken() {}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2012-06-16 00:15:04 UTC (rev 42007)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2012-06-16 00:45:10 UTC (rev 42008)
@@ -199,6 +199,7 @@
public void testClassWithPrivateConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "Unproxyable_Broken", "Unproxyable_Broken"), 23);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC.substring(0, 0), 25);
}
/**
@@ -221,6 +222,10 @@
public void testInjectionPointWhichResolvesToNormalScopedFinalBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "Tuna_Broken", "Tuna_Broken"), 24);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE.substring(0, 0) + ".*", 26);
+
+ file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/Opportunity.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "String", "Opportunity.t"), 26);
}
/**
@@ -234,6 +239,7 @@
public void testClassWithFinalMethodCannotBeProxied() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, "Tuna_Broken", "Tuna_Broken"), 23);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM.substring(0, 0) + ".*", 25);
}
/**
13 years, 10 months
JBoss Tools SVN: r42007 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-15 20:15:04 -0400 (Fri, 15 Jun 2012)
New Revision: 42007
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java
Log:
JBIDE-12198
https://issues.jboss.org/browse/JBIDE-12198
Selection is checked for null.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java 2012-06-15 22:24:05 UTC (rev 42006)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java 2012-06-16 00:15:04 UTC (rev 42007)
@@ -65,7 +65,7 @@
public XModelObject[] getSelectedModelObjects() {
ISelection s = context != null ? context.getSelection() : selection;
- if(s.isEmpty() || !(s instanceof StructuredSelection)) return new XModelObject[0];
+ if(s == null || s.isEmpty() || !(s instanceof StructuredSelection)) return new XModelObject[0];
StructuredSelection ss = (StructuredSelection)s;
Iterator it = ss.iterator();
ArrayList<XModelObject> l = new ArrayList<XModelObject>();
13 years, 10 months
JBoss Tools SVN: r42006 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-06-15 18:24:05 -0400 (Fri, 15 Jun 2012)
New Revision: 42006
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-12197 XHTMLValidator failure
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java 2012-06-15 18:11:56 UTC (rev 42005)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java 2012-06-15 22:24:05 UTC (rev 42006)
@@ -226,7 +226,7 @@
}
private void displaySubtask(String message, Object... arguments) {
- displaySubtask(monitor, MessageFormat.format(message, arguments));
+ displaySubtask(monitor, message, arguments);
}
private void displaySubtask(IProgressMonitor monitor, String message, Object... arguments) {
13 years, 10 months
JBoss Tools SVN: r42005 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-06-15 14:11:56 -0400 (Fri, 15 Jun 2012)
New Revision: 42005
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/JSFAsYouTypeValidationTest.java
Log:
JBIDE-10738
As-you-type EL validation
JUnit test is added for JSF project
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/JSFAsYouTypeValidationTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/JSFAsYouTypeValidationTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/JSFAsYouTypeValidationTest.java 2012-06-15 18:11:56 UTC (rev 42005)
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.test.validation;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.preferences.ELSeverityPreferences;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+/**
+ *
+ * @author Victor V. Rubezhny
+ *
+ */
+public class JSFAsYouTypeValidationTest extends ContentAssistantTestCase {
+ private static final String PROJECT_NAME = "JSF2KickStartWithoutLibs";
+ private static final String PAGE_NAME = "WebContent/pages/inputname.xhtml";
+
+ private static final String [][] EL2VALIDATE =
+ {
+ {"#{user.names}", "\"names\" cannot be resolved"},
+ {"#{suser.name}", "\"suser\" cannot be resolved"},
+ {"#{['}", "EL syntax error: Expecting expression."}
+ };
+
+ private static final int MAX_SECONDS_TO_WAIT = 10;
+ public static final String MARKER_TYPE = "org.jboss.tools.common.validation.asyoutype"; //$NON-NLS-1$
+ public static final String EL2FIND_START = "#{";
+ public static final String EL2FIND_END = "}";
+
+ private static boolean isSuspendedValidationDefaultValue;
+
+ public void setUp() throws Exception {
+ project = ProjectImportTestSetup.loadProject(PROJECT_NAME);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ isSuspendedValidationDefaultValue = ValidationFramework.getDefault().isSuspended();
+ ValidationFramework.getDefault().suspendAllValidation(false);
+ }
+
+ public void tearDown() throws Exception {
+ ValidationFramework.getDefault().suspendAllValidation(isSuspendedValidationDefaultValue);
+ }
+
+ public void testAsYouTypeInJavaValidation() throws JavaModelException, BadLocationException {
+ assertNotNull("Test project '" + PROJECT_NAME + "' is not prepared", project);
+ openEditor(PAGE_NAME);
+ IPreferenceStore store = WebKbPlugin.getDefault().getPreferenceStore();
+ String defaultValidateUnresolvedEL = SeverityPreferences.ENABLE;
+ String defaultUnknownELVariableName = SeverityPreferences.IGNORE;
+ try {
+ defaultValidateUnresolvedEL = store.getString(ELSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL);
+ defaultUnknownELVariableName = store.getString(ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME);
+ store.setValue(ELSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, SeverityPreferences.ENABLE);
+ store.setValue(ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, SeverityPreferences.ERROR);
+ for (int i = 0; i < EL2VALIDATE.length; i++) {
+ doAsYouTipeInJavaValidationTest(EL2VALIDATE[i][0], EL2VALIDATE[i][1]);
+ }
+ } finally {
+ store.setValue(ELSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, defaultValidateUnresolvedEL);
+ store.setValue(ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, defaultUnknownELVariableName);
+ closeEditor();
+ }
+ }
+
+ public void doAsYouTipeInJavaValidationTest(String elToValidate,
+ String errorMessage) throws JavaModelException, BadLocationException {
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent
+ .indexOf(EL2FIND_START));
+ assertFalse("No EL found in Java Strings: Starting '" + EL2FIND_START
+ + "' characters are not found in document", (start == -1));
+ int end = (documentContent == null ? -1 : documentContent.indexOf(
+ EL2FIND_END, start));
+ assertFalse("EL is not closed in Java Strings: Ending '"
+ + EL2FIND_START + "' characters are not found in document",
+ (end == -1));
+
+ int offset = start;
+ int length = end - start + EL2FIND_END.length();
+
+ IProgressMonitor monitor = new NullProgressMonitor();
+ document.replace(start, length, elToValidate);
+
+ end = start + elToValidate.length();
+
+ TemporaryAnnotation problemAnnotation = waitForProblemAnnotationAppearance(
+ start, end, MARKER_TYPE, MAX_SECONDS_TO_WAIT);
+ assertNotNull("No ProblemAnnotation found for Marker Type: "
+ + MARKER_TYPE, problemAnnotation);
+
+ String message = problemAnnotation.getText();
+ assertEquals(
+ "Not expected error message found in ProblemAnnotation. Expected: ["
+ + errorMessage + "], Found: [" + message + "]",
+ errorMessage, message);
+ }
+
+ private TemporaryAnnotation waitForProblemAnnotationAppearance(
+ final int start, final int end, final String markerType,
+ final int seconds) {
+ final TemporaryAnnotation[] result = new TemporaryAnnotation[] { null };
+
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ int secondsLeft = seconds;
+ while (secondsLeft-- > 0) {
+ JobUtils.delay(1000);
+
+ // clean deffered events
+ while (Display.getCurrent().readAndDispatch())
+ ;
+
+ IAnnotationModel annotationModel = getAnnotationModel(textEditor);
+ boolean found = false;
+ Iterator it = annotationModel.getAnnotationIterator();
+ while (!found && it.hasNext()) {
+ Object o = it.next();
+
+ if (!(o instanceof TemporaryAnnotation))
+ continue;
+
+ TemporaryAnnotation temporaryAnnotation = (TemporaryAnnotation) o;
+ Position position = annotationModel
+ .getPosition(temporaryAnnotation);
+
+ if (position.getOffset() < start
+ || position.getOffset() >= end)
+ continue;
+
+ if (position.getOffset() + position.getLength() >= end)
+ continue;
+
+ if (temporaryAnnotation.getAttributes() == null && temporaryAnnotation.getAttributes().isEmpty())
+ continue;
+
+ Object value = temporaryAnnotation.getAttributes().get(MARKER_TYPE);
+
+ if (Boolean.TRUE != value)
+ continue;
+
+ result[0] = temporaryAnnotation;
+ return;
+ }
+ }
+ }
+ });
+
+ return result[0];
+ }
+
+ protected IAnnotationModel getAnnotationModel(ITextEditor editor) {
+ final IDocumentProvider documentProvider = editor.getDocumentProvider();
+ if (documentProvider == null) {
+ return null;
+ }
+ return documentProvider.getAnnotationModel(editor.getEditorInput());
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/JSFAsYouTypeValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months
JBoss Tools SVN: r42004 - in trunk: common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/java and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-06-15 13:35:37 -0400 (Fri, 15 Jun 2012)
New Revision: 42004
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/validation/java/CDIAsYouTypeInJavaValidationTest.java
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/java/BaseAsYouTypeInJavaValidationTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/java/JSFAsYouTypeInJavaValidationTest.java
Log:
JBIDE-10738
As-you-type EL validation
JUnit tests are updated
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/validation/java/CDIAsYouTypeInJavaValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/validation/java/CDIAsYouTypeInJavaValidationTest.java 2012-06-15 17:19:11 UTC (rev 42003)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/validation/java/CDIAsYouTypeInJavaValidationTest.java 2012-06-15 17:35:37 UTC (rev 42004)
@@ -5,6 +5,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.common.base.test.validation.java.BaseAsYouTypeInJavaValidationTest;
@@ -16,7 +17,7 @@
public class CDIAsYouTypeInJavaValidationTest extends TCKTest {
private static final String PAGE_NAME = "JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java";
- private BaseAsYouTypeInJavaValidationTest baseTest;
+ private BaseAsYouTypeInJavaValidationTest baseTest = null;
protected IProject project;
@@ -28,12 +29,17 @@
};
public void setUp() throws Exception {
- project = TCKTest.importPreparedProject("/");
- baseTest = new BaseAsYouTypeInJavaValidationTest(project);
+ project = TCKTest.findTestProject();
+ if (baseTest == null) {
+ baseTest = new BaseAsYouTypeInJavaValidationTest(project);
+ }
}
- public void testAsYouTypeInJavaValidation() throws JavaModelException {
- assertNotNull("Test project '" + TCKTest.MAIN_PROJECT_NAME + "' is not prepared", project);
+ public void testAsYouTypeInJavaValidation() throws JavaModelException, BadLocationException {
+/*
+ * Reserved for a future test
+ *
+ assertNotNull("Test project '" + TCKTest.MAIN_PROJECT_NAME + "' is not prepared", project);
baseTest.openEditor(PAGE_NAME);
IPreferenceStore store = WebKbPlugin.getDefault().getPreferenceStore();
String defaultValidateUnresolvedEL = SeverityPreferences.ENABLE;
@@ -51,6 +57,7 @@
store.setValue(ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, defaultUnknownELVariableName);
baseTest.closeEditor();
}
+ */
}
}
Modified: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/java/BaseAsYouTypeInJavaValidationTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/java/BaseAsYouTypeInJavaValidationTest.java 2012-06-15 17:19:11 UTC (rev 42003)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/java/BaseAsYouTypeInJavaValidationTest.java 2012-06-15 17:35:37 UTC (rev 42004)
@@ -16,27 +16,21 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.WorkingCopyOwner;
import org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.ProblemAnnotation;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
@@ -55,7 +49,6 @@
protected ISourceViewer viewer = null;
protected IDocument document = null;
protected IFile file = null;
- protected ICompilationUnit unit = null;
IAnnotationModel annotationModel = null;
/** The working copy owner */
@@ -108,9 +101,6 @@
file = ((IFileEditorInput) javaEditor.getEditorInput()).getFile();
assertNotNull("Java Editor is opened for a binary Java Class", file);
- unit = EclipseUtil.getCompilationUnit(file);
- assertNotNull("Cannot find a Compilation Unit for Source file", unit);
-
annotationModel = getAnnotationModel();
assertNotNull("Cannot find an Annotation Model for the Java Editor",
annotationModel);
@@ -134,7 +124,7 @@
}
public void doAsYouTipeInJavaValidationTest(String elToValidate,
- String errorMessage) throws JavaModelException {
+ String errorMessage) throws JavaModelException, BadLocationException {
String documentContent = document.get();
int start = (documentContent == null ? -1 : documentContent
.indexOf(EL2FIND_START));
@@ -149,8 +139,7 @@
int offset = start;
int length = end - start + EL2FIND_END.length();
- IProgressMonitor monitor = new NullProgressMonitor();
- modifyDocumentContent(unit, start, length, elToValidate, monitor);
+ document.replace(start, length, elToValidate);
end = start + elToValidate.length();
@@ -166,32 +155,6 @@
errorMessage, message);
}
- private void modifyDocumentContent(final ICompilationUnit unit,
- final int start, final int length, final String text,
- final IProgressMonitor monitor) {
- // Display.getDefault().syncExec(new Runnable() {
- // public void run() {
- ICompilationUnit workingCopy;
- try {
- workingCopy = unit.getWorkingCopy(monitor);
- TextEdit edit = new MultiTextEdit();
- ReplaceEdit replaceEdit = new ReplaceEdit(start, length, text);
- edit.addChild(replaceEdit);
-
- workingCopy.applyTextEdit(edit, monitor);
- workingCopy.commitWorkingCopy(true, monitor);
- } catch (JavaModelException e) {
- fail("An error occured while modifying the document content");
- }
-
- String newDocumentContent = document.get();
- assertTrue("Document isn't modified",
- newDocumentContent.indexOf(text) != -1);
- // }
- // });
-
- }
-
private ProblemAnnotation waitForProblemAnnotationAppearance(
final int start, final int end, final String markerType,
final int seconds) {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/java/JSFAsYouTypeInJavaValidationTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/java/JSFAsYouTypeInJavaValidationTest.java 2012-06-15 17:19:11 UTC (rev 42003)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/java/JSFAsYouTypeInJavaValidationTest.java 2012-06-15 17:35:37 UTC (rev 42004)
@@ -14,6 +14,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
import org.jboss.tools.common.base.test.validation.java.BaseAsYouTypeInJavaValidationTest;
import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
@@ -41,7 +42,7 @@
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
}
- public void testAsYouTypeInJavaValidation() throws JavaModelException {
+ public void testAsYouTypeInJavaValidation() throws JavaModelException, BadLocationException {
assertNotNull("Test project '" + PROJECT_NAME + "' is not prepared", project);
openEditor(PAGE_NAME);
IPreferenceStore store = WebKbPlugin.getDefault().getPreferenceStore();
13 years, 10 months
JBoss Tools SVN: r42003 - in branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core: src/org/jboss/tools/esb/core/model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-06-15 13:19:11 -0400 (Fri, 15 Jun 2012)
New Revision: 42003
Added:
branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBUtil.java
Modified:
branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF
branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
Log:
JBIDE-12082
https://issues.jboss.org/browse/JBIDE-12082
ESB content folder is added to attachment selector.
Merged to 3.3.x
Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF 2012-06-15 17:11:28 UTC (rev 42002)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF 2012-06-15 17:19:11 UTC (rev 42003)
@@ -14,6 +14,10 @@
Require-Bundle: org.eclipse.core.resources;visibility:=reexport,
org.jboss.tools.common.model;visibility:=reexport,
org.eclipse.ui,
- org.jboss.tools.esb.project.core
+ org.jboss.tools.esb.project.core,
+ org.eclipse.wst.common.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.jst.j2ee
Bundle-Version: 1.5.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java 2012-06-15 17:11:28 UTC (rev 42002)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java 2012-06-15 17:19:11 UTC (rev 42003)
@@ -25,6 +25,7 @@
}
public XModelObject[] getChildren(XModelObject object) {
+ ESBUtil.updateModel(object.getModel());
if(object == getRoot()) {
XModelObject[] os = object.getChildren();
List<XModelObject> list = new ArrayList<XModelObject>();
@@ -32,6 +33,10 @@
if(r != null) {
list.add(r);
}
+ r = ESBUtil.getESBRoot(model);
+ if(r != null) {
+ list.add(r);
+ }
for (int i = 0; i < os.length; i++) {
String name = os[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
if(name.startsWith("src")) {
Added: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBUtil.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBUtil.java (rev 0)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBUtil.java 2012-06-15 17:19:11 UTC (rev 42003)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.esb.core.model;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.impl.FileSystemImpl;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class ESBUtil {
+ static String ESB_CHECKED = "esbChecked"; //$NON-NLS-1$
+ static String ESB_ROOT = "ESB-ROOT"; //$NON-NLS-1$
+
+ public static XModelObject getESBRoot(XModel model) {
+ return model.getByPath(FileSystemsHelper.FILE_SYSTEMS + "/" + ESB_ROOT); //$NON-NLS-1$
+ }
+
+ public static void updateModel(XModel model) {
+ if("true".equals(model.getProperties().getProperty(ESB_CHECKED))) { //$NON-NLS-1$
+ return;
+ }
+ model.getProperties().setProperty(ESB_CHECKED, "true"); //$NON-NLS-1$
+
+ IProject project = EclipseResourceUtil.getProject(model.getRoot());
+
+ IContainer[] roots = getESBRootFolders(project, true);
+
+ if(roots.length == 0) return;
+
+ IContainer esbContentFolder = roots.length > 1 ? roots[1] : roots[0];
+ if(!esbContentFolder.exists()) {
+ return;
+ }
+
+ String fsLoc = esbContentFolder.getLocation().toString().replace('\\', '/');
+ XModelObject fs = FileSystemsHelper.getFileSystems(model);
+ XModelObject[] cs = fs.getChildren();
+ for (XModelObject c: cs) {
+ if(fsLoc.equals(c.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION))) {
+ String name = c.getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ if(ESB_ROOT.equals(name)) return;
+ if(fsLoc.endsWith("/" + name)) { //$NON-NLS-1$
+ c.setAttributeValue(XModelObjectConstants.ATTR_NAME, ESB_ROOT);
+ return;
+ }
+ }
+ }
+ Properties properties = new Properties();
+ properties.setProperty(XModelObjectConstants.ATTR_NAME_LOCATION, fsLoc);
+ properties.setProperty(XModelObjectConstants.ATTR_NAME, ESB_ROOT);
+ FileSystemImpl s = (FileSystemImpl)model.createModelObject(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER, properties);
+ fs.addChild(s);
+ }
+
+ public static IContainer[] getESBRootFolders(IProject project, boolean ignoreDerived) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(IJBossESBFacetDataModelProperties.JBOSS_ESB_FACET_ID);
+ if(facet != null && facetedProject!=null && facetedProject.getProjectFacetVersion(facet)!=null) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component!=null) {
+ IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+
+ IContainer[] folders = webRootVirtFolder.getUnderlyingFolders();
+ if(folders.length > 1){
+ ArrayList<IContainer> containers = new ArrayList<IContainer>();
+ for(IContainer container : folders){
+ if(!ignoreDerived || !container.isDerived(IResource.CHECK_ANCESTORS)) {
+ containers.add(container);
+ }
+ }
+ return containers.toArray(new IContainer[containers.size()]);
+ } else {
+ return folders;
+ }
+ }
+ }
+ return EMPTY_ARRAY;
+ }
+
+ private static final IContainer[] EMPTY_ARRAY = new IContainer[0];
+}
Property changes on: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBUtil.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months