JBoss Tools SVN: r34617 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-09-09 16:47:09 -0400 (Fri, 09 Sep 2011)
New Revision: 34617
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
Log:
fixed:
testELReferencesQueryParticipantForType(org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest) Time elapsed: 0.855 sec <<< FAILURE!
junit.framework.AssertionFailedError: Match not found (file - /tck/WebContent/el/integration/JSFTestPage.jsp name - sheep)
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.checkMatches(QueryParticipantTestUtils.java:111)
at org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.testSearchParticipant(QueryParticipantTestUtils.java:73)
at org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest.testELReferencesQueryParticipantForType(ELReferencesQueryParticipantTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:72)
at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication$1.run(AbstractUITestApplication.java:35)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:31)
at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:114)
at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:37)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
testELReferencesQueryParticipantForMethod(org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest) Time elapsed: 0.578 sec <<< FAILURE!
junit.framework.AssertionFailedError: Match not found (file - /tck/WebContent/el/integration/JSFTestPage.jsp name - name)
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.checkMatches(QueryParticipantTestUtils.java:111)
at org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.testSearchParticipant(QueryParticipantTestUtils.java:73)
at org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest.testELReferencesQueryParticipantForMethod(ELReferencesQueryParticipantTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:72)
at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication$1.run(AbstractUITestApplication.java:35)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:31)
at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:114)
at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:37)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Results :
Failed tests:
testELReferencesQueryParticipantForType(org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest)
testELReferencesQueryParticipantForMethod(org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest)
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09 19:18:36 UTC (rev 34616)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09 20:47:09 UTC (rev 34617)
@@ -14,7 +14,7 @@
ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
matches.add(new MatchStructure("/tck/WebContent/test.jsp", "sheep"));
- matches.add(new MatchStructure("/tck/WebContent/el/integration/JSFTestPage.jsp", "sheep"));
+ //matches.add(new MatchStructure("/tck/WebContent/el/integration/JSFTestPage.jsp", "sheep"));
matches.add(new MatchStructure("/tck/WebContent/tests/lookup/el/integration/JSFTestPage.jsp", "sheep"));
matches.add(new MatchStructure("/tck/WebContent/elValidation1.xhtml", "sheep"));
@@ -59,7 +59,7 @@
ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
matches.add(new MatchStructure("/tck/WebContent/test.jsp", "name"));
- matches.add(new MatchStructure("/tck/WebContent/el/integration/JSFTestPage.jsp", "name"));
+ //matches.add(new MatchStructure("/tck/WebContent/el/integration/JSFTestPage.jsp", "name"));
matches.add(new MatchStructure("/tck/WebContent/tests/lookup/el/integration/JSFTestPage.jsp", "name"));
matches.add(new MatchStructure("/tck/WebContent/elValidation1.xhtml", "name"));
14 years, 7 months
JBoss Tools SVN: r34616 - in trunk/cdi/tests: org.jboss.tools.cdi.core.test/resources/tck/tests and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-09-09 15:18:36 -0400 (Fri, 09 Sep 2011)
New Revision: 34616
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/elValidation1.xhtml
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
Log:
JBIDE-9633
Create JUnit tests to cover JBIDE-9515 issue
JUnit Test is added for proposals filtering and proposals applying check
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/elValidation1.xhtml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/elValidation1.xhtml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/elValidation1.xhtml 2011-09-09 19:18:36 UTC (rev 34616)
@@ -0,0 +1,13 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:define name="body">
+ <h:outputText value="#{namedBean.foo}"/>
+ <h:outputText value="#{sheep.name}"
+ rendered="#{(game.value == 'foo' and game.value == 'foo') ? game.value == 'foo' : false}"/>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/elValidation1.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09 19:09:18 UTC (rev 34615)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09 19:18:36 UTC (rev 34616)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
+ * Copyright (c) 2009-2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -13,24 +13,10 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.apache.xerces.impl.validation.ValidationManager;
-import org.eclipse.core.internal.jobs.JobManager;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentPropertiesManager;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
-import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
import org.eclipse.wst.validation.ValidationFramework;
import org.jboss.tools.cdi.core.test.CDICoreTestSetup;
-import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.ui.test.marker.CDIMarkerResolutionTest;
import org.jboss.tools.cdi.ui.test.perspective.CDIPerspectiveTest;
import org.jboss.tools.cdi.ui.test.preferences.CDIPreferencePageTest;
@@ -40,7 +26,6 @@
import org.jboss.tools.cdi.ui.test.wizard.NewCDIClassWizardFactoryTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIWizardTest;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.WorkbenchUtils;
/**
* @author Alexey Kazakov
@@ -65,7 +50,7 @@
suiteAll.addTestSuite(NewCDIClassWizardFactoryTest.class);
suiteAll.addTestSuite(CDIPreferencePageTest.class);
suiteAll.addTestSuite(NewCDIWizardTest.class);
- suiteAll.addTestSuite(CAELProposalFilteringTest.class);
+ suite.addTestSuite(CAELProposalFilteringTest.class);
suite.addTestSuite(CDISearchParticipantTest.class);
suite.addTestSuite(ELReferencesQueryParticipantTest.class);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09 19:09:18 UTC (rev 34615)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09 19:18:36 UTC (rev 34616)
@@ -16,6 +16,7 @@
matches.add(new MatchStructure("/tck/WebContent/test.jsp", "sheep"));
matches.add(new MatchStructure("/tck/WebContent/el/integration/JSFTestPage.jsp", "sheep"));
matches.add(new MatchStructure("/tck/WebContent/tests/lookup/el/integration/JSFTestPage.jsp", "sheep"));
+ matches.add(new MatchStructure("/tck/WebContent/elValidation1.xhtml", "sheep"));
QueryParticipantTestUtils.testSearchParticipant(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/lookup/el/integration/Sheep.java",
@@ -44,7 +45,7 @@
ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
matches.add(new MatchStructure("/tck/JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Zoo.java", "aaam"));
-
+
QueryParticipantTestUtils.testSearchParticipant(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Zoo.java",
QueryParticipantTestUtils.METHOD_SEARCH,
@@ -60,7 +61,8 @@
matches.add(new MatchStructure("/tck/WebContent/test.jsp", "name"));
matches.add(new MatchStructure("/tck/WebContent/el/integration/JSFTestPage.jsp", "name"));
matches.add(new MatchStructure("/tck/WebContent/tests/lookup/el/integration/JSFTestPage.jsp", "name"));
-
+ matches.add(new MatchStructure("/tck/WebContent/elValidation1.xhtml", "name"));
+
QueryParticipantTestUtils.testSearchParticipant(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/lookup/el/integration/Sheep.java",
QueryParticipantTestUtils.METHOD_SEARCH,
14 years, 7 months
JBoss Tools SVN: r34615 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-09-09 15:09:18 -0400 (Fri, 09 Sep 2011)
New Revision: 34615
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
Log:
https://issues.jboss.org/browse/JBIDE-9685 Seam JMS: CDI validator should be aware of JMS resource injections
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -394,8 +394,34 @@
}
/**
- * Return @Named declaration or the stereotype declaration if it declares @Named.
+ * Returns the annotation declaration directly or indirectly declared for this element.
+ * For instance some annotation directly declared for the element may declare wanted annotation then the method will return this declaration.
+ * So the returned declaration may be from a resource other than the resource of the element.
+ * Returns null if no declaration found.
*
+ * @param injection
+ * @param qualifierTypeName
+ * @return
+ */
+ public static IAnnotationDeclaration getAnnotationDeclaration(IAnnotated element, String annotationTypeName) {
+ List<IAnnotationDeclaration> declarations = element.getAnnotations();
+ for (IAnnotationDeclaration declaration : declarations) {
+ IAnnotationType type = declaration.getAnnotation();
+ if(type!=null) {
+ if(annotationTypeName.equals(type.getSourceType().getFullyQualifiedName())) {
+ return declaration;
+ }
+ if(type instanceof IAnnotated) {
+ return getAnnotationDeclaration((IAnnotated)type, annotationTypeName);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns @Named declaration or the stereotype declaration if it declares @Named.
+ *
* @param stereotyped
* @return
*/
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IQualifier.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.cdi.core;
+import org.jboss.tools.common.java.IAnnotated;
+
/**
* Represents a qualifier.
*
* @author Viacheslav Kabanovich
*/
-public interface IQualifier extends ICDIAnnotation {
+public interface IQualifier extends ICDIAnnotation, IAnnotated {
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIAnnotationElement.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -20,14 +20,16 @@
import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationMemberDefinition;
+import org.jboss.tools.common.java.IAnnotated;
import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class CDIAnnotationElement extends CDIElement implements ICDIAnnotation {
+public class CDIAnnotationElement extends CDIElement implements ICDIAnnotation, IAnnotated {
protected AnnotationDefinition definition;
@@ -88,9 +90,49 @@
return definition.getAnnotation(typeName);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#getAnnotations()
+ */
+ @Override
+ public List<IAnnotationDeclaration> getAnnotations() {
+ return definition.getAnnotations();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#getAnnotation(java.lang.String)
+ */
+ @Override
+ public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
+ return definition.getAnnotation(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#getAnnotationPosition(java.lang.String)
+ */
+ @Override
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return definition.getAnnotationPosition(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.java.IAnnotated#isAnnotationPresent(java.lang.String)
+ */
+ @Override
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ return definition.isAnnotationPresent(annotationTypeName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
public String toString() {
String type = getSourceType() == null ? "" : getSourceType().getFullyQualifiedName();
return super.toString() + " type=" + type;
}
-
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-09-09 19:09:18 UTC (rev 34615)
@@ -12,21 +12,22 @@
<extension
point="org.jboss.tools.cdi.core.cdiextensions">
- <cdiextension
- class="org.jboss.tools.cdi.seam.core.international.CDISeamInternationalExtension"
- runtime="org.jboss.seam.international.status.TypedStatusMessageBundleExtension">
- </cdiextension>
- <cdiextension
- class="org.jboss.tools.cdi.seam.core.persistence.CDISeamPersistenceExtension"
- runtime="org.jboss.seam.persistence.ManagedPersistenceContextExtension">
- </cdiextension>
- </extension>
-
- <extension
- point="org.jboss.tools.cdi.core.cdiextensions">
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.core.international.CDISeamInternationalExtension"
+ runtime="org.jboss.seam.international.status.TypedStatusMessageBundleExtension">
+ </cdiextension>
<cdiextension
+ class="org.jboss.tools.cdi.seam.core.persistence.CDISeamPersistenceExtension"
+ runtime="org.jboss.seam.persistence.ManagedPersistenceContextExtension">
+ </cdiextension>
+ <cdiextension
class="org.jboss.tools.cdi.seam.core.servlet.SeamServletExtension"
runtime="org.jboss.seam.servlet.ServletExtension">
</cdiextension>
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.core.jms.JmsDestinationExtension"
+ runtime="org.jboss.seam.jms.Seam3JmsExtension">
+ </cdiextension>
</extension>
+
</plugin>
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.jms;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JmsDestinationExtension implements ICDIExtension, IInjectionPointValidatorFeature {
+
+ private static final Set<String> INJECTION_TYPES = new HashSet<String>();
+ static{
+ INJECTION_TYPES.add("javax.jms.Connection");
+ INJECTION_TYPES.add("javax.jms.Session");
+ INJECTION_TYPES.add("javax.jms.Topic");
+ INJECTION_TYPES.add("javax.jms.Queue");
+ INJECTION_TYPES.add("javax.jms.TopicPublisher");
+ INJECTION_TYPES.add("javax.jms.QueueSender");
+ INJECTION_TYPES.add("javax.jms.TopicSubscriber");
+ INJECTION_TYPES.add("javax.jms.QueueReceiver");
+ }
+
+ private static final String JMS_DESTINATION_QUALIFIER = "org.jboss.seam.jms.annotations.JmsDestination";
+
+ /**
+ * The following JMS resources are available for injection in Seam JMS:
+ *
+ * javax.jms.Connection
+ * javax.jms.Session
+ *
+ * Destination-based resources:
+ *
+ * javax.jms.Topic
+ * javax.jms.Queue
+ * javax.jms.TopicPublisher
+ * javax.jms.QueueSender
+ * javax.jms.TopicSubscriber
+ * javax.jms.QueueReceiver
+ *
+ * If an injection has any type from the list above and also it has a qualifier JmsDestination then it should be ignored by CDI validator.
+ *
+ * See https://issues.jboss.org/browse/JBIDE-9685
+ */
+ @Override
+ public boolean shouldIgnoreInjection(IType typeOfInjectionPoint, IInjectionPoint injection) {
+ if(typeOfInjectionPoint!=null && INJECTION_TYPES.contains(typeOfInjectionPoint.getFullyQualifiedName())) {
+ IAnnotationDeclaration declaration = CDIUtil.getAnnotationDeclaration(injection, JMS_DESTINATION_QUALIFIER);
+ return declaration!=null;
+ }
+ return false;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/jms/JmsDestinationExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -31,7 +31,6 @@
import org.jboss.tools.cdi.core.IProducer;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.core.IQualifierDeclaration;
-import org.jboss.tools.cdi.core.test.tck.validation.CoreValidationTest;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.common.EclipseUtil;
@@ -42,8 +41,6 @@
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.validation.ValidatorManager;
-import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.osgi.framework.Bundle;
@@ -75,10 +72,10 @@
if(tckProject==null) {
try {
tckProject = findTestProject();
- if(tckProject==null || !tckProject.exists()) {
+ if(!tckProject.exists()) {
// ValidatorManager.setStatus(CoreValidationTest.VALIDATION_STATUS);
tckProject = importPreparedProject("/");
- TestUtil._waitForValidation(tckProject);
+// TestUtil._waitForValidation(tckProject);
// TestUtil.waitForValidation();
}
} catch (Exception e) {
@@ -101,7 +98,7 @@
public static IProject importPreparedProject(String packPath) throws Exception {
Bundle b = Platform.getBundle(PLUGIN_ID);
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- if(project==null || !project.exists()) {
+ if(!project.exists()) {
project = ResourcesUtils.importProject(b, PROJECT_PATH);
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
}
@@ -120,7 +117,8 @@
FileUtil.copyDir(from, webInfTo, true, true, true, new XmlFileFilter());
}
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
+ TestUtil._waitForValidation(project);
+// JobUtils.waitForIdle();
return project;
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -15,12 +15,13 @@
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.common.base.test.contentassist.CATestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
-import org.jboss.tools.test.util.JobUtils;
/**
* Test case testing http://jira.jboss.com/jira/browse/JBIDE-9633 issue.
@@ -40,17 +41,8 @@
}
public void setUp() {
- if (project == null) {
- try {
- IProject testProject = TCKUITest.importPreparedProject("/tests/lookup");
- testProject = TCKUITest.importPreparedProject("/tests/ca");
- caTest.setProject(testProject);
- project = testProject;
- } catch (Exception e) {
- project = null;
- e.printStackTrace();
- }
- }
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(TCKTest.PROJECT_NAME);
+ caTest.setProject(project);
}
public void testCAELProposalFilteringInJSP () {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -13,6 +13,7 @@
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
@@ -27,14 +28,9 @@
private String[] beanProposals = new String[] {"example", "example.com", "fishJBT", "game", "haddock", "salmon", "sheep", "tunaFarm", "whitefishJBT", "wolf"};
private String[] propertyProposals = new String[] {"game.value", "game.initialize()"};
- public CATest() {
- super();
- try {
- project = TCKUITest.importPreparedProject("/tests/lookup");
- caTest.setProject(project);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ public void setUp() {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(TCKTest.PROJECT_NAME);
+ caTest.setProject(project);
}
public void testEL() {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -65,21 +65,12 @@
suiteAll.addTestSuite(NewCDIClassWizardFactoryTest.class);
suiteAll.addTestSuite(CDIPreferencePageTest.class);
suiteAll.addTestSuite(NewCDIWizardTest.class);
- suiteAll.addTestSuite(CATest.class);
suiteAll.addTestSuite(CAELProposalFilteringTest.class);
suite.addTestSuite(CDISearchParticipantTest.class);
suite.addTestSuite(ELReferencesQueryParticipantTest.class);
- suiteAll.addTest(new CDICoreTestSetup(suite) {
- @Override
- protected void setUp() throws Exception {
- tckProject = TCKUITest.importPreparedProject("/");
- }
- protected void tearDown() throws Exception {
- tckProject.delete(true, true, null);
- }
- }
- );
+ suite.addTestSuite(CATest.class);
+ suiteAll.addTest(new CDICoreTestSetup(suite));
suiteAll.addTestSuite(AddQualifiersToBeanWizardTest.class);
Deleted: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -1,74 +0,0 @@
-package org.jboss.tools.cdi.ui.test;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.cdi.core.test.tck.TCKTest;
-import org.jboss.tools.cdi.core.test.tck.TCKTest.JavaFileFilter;
-import org.jboss.tools.cdi.core.test.tck.TCKTest.PageFileFilter;
-import org.jboss.tools.cdi.core.test.tck.TCKTest.XmlFileFilter;
-import org.jboss.tools.cdi.core.test.tck.validation.CoreValidationTest;
-import org.jboss.tools.common.EclipseUtil;
-import org.jboss.tools.common.base.test.validation.TestUtil;
-import org.jboss.tools.common.java.IParametedType;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.validation.ValidatorManager;
-import org.jboss.tools.test.util.ResourcesUtils;
-import org.osgi.framework.Bundle;
-
-public class TCKUITest extends TCKTest {
- public IProject getTestProject() {
- try {
- if(tckProject==null) {
- tckProject = findTestProject();
- if(tckProject==null || !tckProject.exists()) {
- ValidatorManager.setStatus(CoreValidationTest.VALIDATION_STATUS);
- tckProject = importPreparedProject("/");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail("Can't import CDI test project: " + e.getMessage());
- }
-
- return tckProject;
- }
-
- public static IProject importPreparedProject(String packPath) throws Exception {
- Bundle b = Platform.getBundle(PLUGIN_ID);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- if(project==null || !project.exists()) {
- project = ResourcesUtils.importProject(b, PROJECT_PATH);
- }
- String projectPath = project.getLocation().toOSString();
- String resourcePath = FileLocator.resolve(b.getEntry(TCK_RESOURCES_PREFIX)).getFile();
-
- File from = new File(resourcePath + packPath);
- if(from.isDirectory()) {
- File javaSourceTo = new File(projectPath + JAVA_SOURCE_SUFFIX + PACKAGE + packPath);
- FileUtil.copyDir(from, javaSourceTo, true, true, true, new JavaFileFilter());
-
- File webContentTo = new File(projectPath + WEB_CONTENT_SUFFIX);
- FileUtil.copyDir(from, webContentTo, true, true, true, new PageFileFilter());
-
- File webInfTo = new File(projectPath + WEB_CONTENT_SUFFIX + WEB_INF_SUFFIX);
- FileUtil.copyDir(from, webInfTo, true, true, true, new XmlFileFilter());
- }
-
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- project.build(IncrementalProjectBuilder.CLEAN_BUILD,null);
- project.build(IncrementalProjectBuilder.FULL_BUILD,null);
- TestUtil._waitForValidation(project);
-
- return project;
- }
-}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -24,7 +24,7 @@
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
-import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.marker.AddAnnotationMarkerResolution;
@@ -40,16 +40,14 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
-import org.jboss.tools.cdi.ui.test.TCKUITest;
import org.jboss.tools.common.base.test.validation.TestUtil;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.validation.ValidatorManager;
/**
* @author Daniel Azarov
*
*/
-public class CDIMarkerResolutionTest extends TCKUITest {
+public class CDIMarkerResolutionTest extends TCKTest {
private void checkResolution(IProject project, String[] fileNames, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
checkResolution(project, fileNames, new String[]{}, markerType, idName, id, resolutionClass);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -30,10 +30,9 @@
import org.jboss.tools.cdi.ui.search.CDIBeanQueryParticipant;
import org.jboss.tools.cdi.ui.search.CDIMatch;
import org.jboss.tools.cdi.ui.search.InjectionPointQueryParticipant;
-import org.jboss.tools.cdi.ui.test.TCKUITest;
import org.jboss.tools.common.EclipseUtil;
-public class CDISearchParticipantTest extends TCKUITest {
+public class CDISearchParticipantTest extends TCKTest {
private static final int FIELD_SEARCH = 1;
private static final int METHOD_SEARCH = 2;
private static final int TYPE_SEARCH = 3;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -3,12 +3,12 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.cdi.ui.test.TCKUITest;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.jst.web.kb.refactoring.ELReferencesQueryParticipant;
import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils;
import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.MatchStructure;
-public class ELReferencesQueryParticipantTest extends TCKUITest{
+public class ELReferencesQueryParticipantTest extends TCKTest{
public void testELReferencesQueryParticipantForType() throws CoreException{
ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java 2011-09-09 18:35:11 UTC (rev 34614)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java 2011-09-09 19:09:18 UTC (rev 34615)
@@ -10,6 +10,7 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
public class CDIQualifier implements IQualifier{
private ICDIProject project;
@@ -62,7 +63,6 @@
@Override
public ICDIProject getDeclaringProject() {
- // TODO Auto-generated method stub
return null;
}
@@ -70,4 +70,24 @@
public boolean exists() {
return false;
}
+
+ @Override
+ public List<IAnnotationDeclaration> getAnnotations() {
+ return null;
+ }
+
+ @Override
+ public IAnnotationDeclaration getAnnotation(String annotationTypeName) {
+ return null;
+ }
+
+ @Override
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return null;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ return false;
+ }
}
\ No newline at end of file
14 years, 7 months
JBoss Tools SVN: r34614 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-09-09 14:35:11 -0400 (Fri, 09 Sep 2011)
New Revision: 34614
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-9684
https://issues.jboss.org/browse/JBIDE-9684
Fixed handling annotation types declared as inner types.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-09-09 18:34:12 UTC (rev 34613)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-09-09 18:35:11 UTC (rev 34614)
@@ -463,7 +463,7 @@
TreeSet<String> injectionKeys = new TreeSet<String>();
for (IType d: injectionQualifiers) {
- injectionKeys.add(d.getFullyQualifiedName());
+ injectionKeys.add(d.getFullyQualifiedName().replace('$', '.'));
}
if(!injectionKeys.contains(CDIConstants.ANY_QUALIFIER_TYPE_NAME)) {
@@ -476,7 +476,7 @@
beanKeys.add(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
} else {
for (IAnnotationDeclaration d: beanQualifiers) {
- beanKeys.add(d.getTypeName());
+ beanKeys.add(d.getTypeName().replace('$', '.'));
}
}
if(beanKeys.size() == 1 && beanKeys.iterator().next().startsWith(CDIConstants.NAMED_QUALIFIER_TYPE_NAME)) {
@@ -928,7 +928,7 @@
* @see org.jboss.tools.cdi.core.IBeanManager#getStereotype(java.lang.String)
*/
public StereotypeElement getStereotype(String qualifiedName) {
- return stereotypes.get(qualifiedName);
+ return stereotypes.get(qualifiedName.replace('$', '.'));
}
/*
@@ -961,7 +961,7 @@
* @see org.jboss.tools.cdi.core.IBeanManager#getInterceptorBinding(java.lang.String)
*/
public InterceptorBindingElement getInterceptorBinding(String qualifiedName) {
- return interceptorBindings.get(qualifiedName);
+ return interceptorBindings.get(qualifiedName.replace('$', '.'));
}
/*
@@ -973,7 +973,7 @@
}
public QualifierElement getQualifier(String qualifiedName) {
- return qualifiers.get(qualifiedName);
+ return qualifiers.get(qualifiedName.replace('$', '.'));
}
public QualifierElement getQualifier(IPath path) {
@@ -987,7 +987,7 @@
}
public ScopeElement getScope(String qualifiedName) {
- return scopes.get(qualifiedName);
+ return scopes.get(qualifiedName.replace('$', '.'));
}
public IScope getScope(IPath path) {
@@ -1035,7 +1035,7 @@
if((d.getKind() & AnnotationDefinition.STEREOTYPE) > 0) {
StereotypeElement s = new StereotypeElement();
initAnnotationElement(s, d);
- stereotypes.put(d.getQualifiedName(), s);
+ stereotypes.put(d.getQualifiedName().replace('$', '.'), s);
if(d.getResource() != null && d.getResource().getFullPath() != null) {
stereotypesByPath.put(d.getResource().getFullPath(), s);
}
@@ -1043,7 +1043,7 @@
if((d.getKind() & AnnotationDefinition.INTERCEPTOR_BINDING) > 0) {
InterceptorBindingElement s = new InterceptorBindingElement();
initAnnotationElement(s, d);
- interceptorBindings.put(d.getQualifiedName(), s);
+ interceptorBindings.put(d.getQualifiedName().replace('$', '.'), s);
if(d.getResource() != null && d.getResource().getFullPath() != null) {
interceptorBindingsByPath.put(d.getResource().getFullPath(), s);
}
@@ -1051,7 +1051,7 @@
if((d.getKind() & AnnotationDefinition.QUALIFIER) > 0) {
QualifierElement s = new QualifierElement();
initAnnotationElement(s, d);
- qualifiers.put(d.getQualifiedName(), s);
+ qualifiers.put(d.getQualifiedName().replace('$', '.'), s);
if(d.getResource() != null && d.getResource().getFullPath() != null) {
qualifiersByPath.put(d.getResource().getFullPath(), s);
}
@@ -1059,7 +1059,7 @@
if((d.getKind() & AnnotationDefinition.SCOPE) > 0) {
ScopeElement s = new ScopeElement();
initAnnotationElement(s, d);
- scopes.put(d.getQualifiedName(), s);
+ scopes.put(d.getQualifiedName().replace('$', '.'), s);
if(d.getResource() != null && d.getResource().getFullPath() != null) {
scopesByPath.put(d.getResource().getFullPath(), s);
}
14 years, 7 months
JBoss Tools SVN: r34613 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: src/org/jboss/tools/cdi/core/test/tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-09-09 14:34:12 -0400 (Fri, 09 Sep 2011)
New Revision: 34613
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/qualifier/BeanWithInnerQualifier.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java
Log:
JBIDE-9684
https://issues.jboss.org/browse/JBIDE-9684
Fixed handling annotation types declared as inner types.
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/qualifier/BeanWithInnerQualifier.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/qualifier/BeanWithInnerQualifier.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/qualifier/BeanWithInnerQualifier.java 2011-09-09 18:34:12 UTC (rev 34613)
@@ -0,0 +1,30 @@
+package org.jboss.jsr299.tck.tests.definition.qualifier;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+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.inject.Inject;
+import javax.inject.Qualifier;
+
+(a)BeanWithInnerQualifier.InnerQualifier
+public class BeanWithInnerQualifier {
+
+ public BeanWithInnerQualifier() {}
+
+ @Inject
+ @InnerQualifier
+ BeanWithInnerQualifier a;
+
+ @Qualifier
+ @Target({ TYPE, METHOD, PARAMETER, FIELD })
+ @Retention(RUNTIME)
+ public @interface InnerQualifier {
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/qualifier/BeanWithInnerQualifier.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java 2011-09-09 17:36:21 UTC (rev 34612)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java 2011-09-09 18:34:12 UTC (rev 34613)
@@ -218,4 +218,16 @@
assertContainsQualifierType(bean, "javax.enterprise.inject.Default");
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
}
+
+ public void testQualifierDeclaredWithInnerType() throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier",
+ "org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier.InnerQualifier");
+ assertEquals("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier type.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ Set<IQualifier> qualifiers = bean.getQualifiers();
+ assertEquals("Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier type.", 2, qualifiers.size());
+ assertContainsQualifierType(bean, "org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier$InnerQualifier");
+ assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
+ }
+
}
\ No newline at end of file
14 years, 7 months
JBoss Tools SVN: r34612 - in trunk/cdi/tests/org.jboss.tools.cdi.ui.test: src/org/jboss/tools/cdi/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-09-09 13:36:21 -0400 (Fri, 09 Sep 2011)
New Revision: 34612
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
Log:
JBIDE-9633
Create JUnit tests to cover JBIDE-9515 issue
JUnit Test is added for proposals filtering and proposals applying check
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-09-09 17:11:51 UTC (rev 34611)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-09-09 17:36:21 UTC (rev 34612)
@@ -31,5 +31,5 @@
org.eclipse.wst.validation;bundle-version="1.2.300",
org.jboss.tools.jst.web.kb.test,
org.jboss.tools.common.validation,
- org.jboss.tools.jst.jsp;bundle-version="3.3.0"
+ org.jboss.tools.jst.jsp
Export-Package: org.jboss.tools.cdi.ui.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09 17:11:51 UTC (rev 34611)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09 17:36:21 UTC (rev 34612)
@@ -30,21 +30,28 @@
*/
public class CAELProposalFilteringTest extends TestCase {
- private IProject project;
+ private IProject project = null;
private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
private static final String JSP_PAGE_NAME = "WebContent/test.jsp";
private static final String XHTML_PAGE_NAME = "WebContent/elValidation1.xhtml";
public CAELProposalFilteringTest() {
super();
- try {
- project = TCKUITest.importPreparedProject("/tests/lookup");
- project = TCKUITest.importPreparedProject("/tests/ca");
- caTest.setProject(project);
- } catch (Exception e) {
- e.printStackTrace();
- }
}
+
+ public void setUp() {
+ if (project == null) {
+ try {
+ IProject testProject = TCKUITest.importPreparedProject("/tests/lookup");
+ testProject = TCKUITest.importPreparedProject("/tests/ca");
+ caTest.setProject(testProject);
+ project = testProject;
+ } catch (Exception e) {
+ project = null;
+ e.printStackTrace();
+ }
+ }
+ }
public void testCAELProposalFilteringInJSP () {
caTest.openEditor(JSP_PAGE_NAME);
@@ -76,8 +83,6 @@
String documentContentToCompare = documentContent.substring(0, start + prefix.length()) +
compareString + documentContent.substring(start + prefix.length());
- JobUtils.waitForIdle();
-
List<ICompletionProposal> res = CATestUtil.collectProposals(caTest.getContentAssistant(), caTest.getViewer(), offsetToTest);
assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
@@ -100,12 +105,7 @@
}
assertTrue("The proposal to apply not found.", bPropoosalToApplyFound);
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
+// JobUtils.waitForIdle();
String documentUpdatedContent = document.get();
assertTrue("The proposal replacement is failed.", documentContentToCompare.equals(documentUpdatedContent));
14 years, 7 months
JBoss Tools SVN: r34611 - trunk/seam/tests/org.jboss.tools.seam.core.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-09-09 13:11:51 -0400 (Fri, 09 Sep 2011)
New Revision: 34611
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/pom.xml
Log:
fix for requirements location used in seam.core.test
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/pom.xml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/pom.xml 2011-09-09 16:42:42 UTC (rev 34610)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/pom.xml 2011-09-09 17:11:51 UTC (rev 34611)
@@ -12,7 +12,7 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
- <systemProperties>-Djbosstools.test.seam.1.2.1.eap.home=${projectRoot}/requirements/target/jboss-eap-4.3/seam -Djbosstools.test.seam.2fp.eap.home=${projectRoot}/requirements/target/jboss-eap-4.3/seamfp -Djbosstools.test.seam.2.0.1.GA.home=${projectRoot}/requirements/target/jboss-seam-2.0.1.GA -Djbosstools.test.seam.2.1.0.GA.home=${projectRoot}/requirements/target/jboss-seam-2.1.1.GA</systemProperties>
+ <systemProperties>-Djbosstools.test.seam.1.2.1.eap.home=${requirement.build.root}/requirements/target/jboss-eap-4.3/seam -Djbosstools.test.seam.2fp.eap.home=${requirement.build.root}/requirements/target/jboss-eap-4.3/seamfp -Djbosstools.test.seam.2.0.1.GA.home=${requirement.build.root}/requirements/target/jboss-seam-2.0.1.GA -Djbosstools.test.seam.2.1.0.GA.home=${requirement.build.root}/requirements/target/jboss-seam-2.1.1.GA</systemProperties>
<emma.filter>org.jboss.tools.seam*</emma.filter>
<emma.instrument.bundles>org.jboss.tools.seam.core</emma.instrument.bundles>
</properties>
14 years, 7 months
JBoss Tools SVN: r34610 - trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-09-09 12:42:42 -0400 (Fri, 09 Sep 2011)
New Revision: 34610
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
Log:
JBIDE-9347
https://issues.jboss.org/browse/JBIDE-9347
Initial implementation of Assignable Beans dialog.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java 2011-09-09 16:42:20 UTC (rev 34609)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java 2011-09-09 16:42:42 UTC (rev 34610)
@@ -21,17 +21,25 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.internal.text.TableOwnerDrawSupport;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ICheckStateProvider;
import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StyledCellLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
@@ -141,7 +149,22 @@
list.getControl().setLayoutData(g);
list.setContentProvider(new ListContent());
list.setLabelProvider(new LP());
+ TableOwnerDrawSupport.install(list.getTable());
list.setInput(injectionPoint);
+ list.addDoubleClickListener(new IDoubleClickListener() {
+
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ ISelection s = event.getSelection();
+ if(!s.isEmpty() && s instanceof IStructuredSelection) {
+ Object o = ((IStructuredSelection)s).getFirstElement();
+ if(o instanceof IBean) {
+ ((IBean)o).open();
+ }
+ }
+
+ }
+ });
}
void createFilterView(Composite parent) {
@@ -322,10 +345,13 @@
}
- class LP extends LabelProvider implements ITableLabelProvider, IFontProvider, IColorProvider {
+ class LP extends StyledCellLabelProvider implements ITableLabelProvider, IFontProvider, IColorProvider, DelegatingStyledCellLabelProvider.IStyledLabelProvider {
public String getText(Object element) {
+ return getStyledText(element).getString();
+ }
+ public StyledString getStyledText(Object element) {
IBean b = (IBean)element;
- StringBuffer sb = new StringBuffer();
+ StyledString sb = new StyledString();
if(b.isAlternative()) {
sb.append("@Alternative ");
}
@@ -347,8 +373,8 @@
sb.append(b.getBeanClass().getElementName());
}
String pkg = b.getBeanClass().getPackageFragment().getElementName();
- sb.append(" - ").append(pkg).append(" - ");
- return sb.toString();
+ sb.append(" - ").append(pkg, StyledString.QUALIFIER_STYLER).append(" - ");
+ return sb;
}
@Override
@@ -384,6 +410,10 @@
@Override
public String getColumnText(Object element, int columnIndex) {
return getText(element);
+ }
+ @Override
+ public Image getImage(Object element) {
+ return null;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2011-09-09 16:42:20 UTC (rev 34609)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2011-09-09 16:42:42 UTC (rev 34610)
@@ -131,15 +131,14 @@
List<IBean> resultBeans = CDIUtil.getSortedBeans(cdiProject, true, injectionPoint);
- List<IBean> alternativeBeans = CDIUtil.getSortedBeans(cdiProject, false, injectionPoint);
-
+ Set<IBean> assignableBeans = cdiProject.getBeans(false, injectionPoint);
- if(alternativeBeans.size() > 0){
+ if(assignableBeans.size() > 0){
if(resultBeans.size() > 0){
hyperlinks.add(new InjectedPointHyperlink(region, resultBeans.get(0), document, true));
}
- if(alternativeBeans.size() > 1) {
- hyperlinks.add(new AlternativeInjectedPointListHyperlink(region, alternativeBeans, viewer, document));
+ if(assignableBeans.size() > 1) {
+// hyperlinks.add(new AlternativeInjectedPointListHyperlink(region, alternativeBeans, viewer, document));
hyperlinks.add(new AssignableBeansHyperlink(region, injectionPoint, document));
}
}
14 years, 7 months
JBoss Tools SVN: r34609 - trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-09-09 12:42:20 -0400 (Fri, 09 Sep 2011)
New Revision: 34609
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
Log:
JBIDE-9347
https://issues.jboss.org/browse/JBIDE-9347
Initial implementation of Assignable Beans dialog.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-09-09 16:29:33 UTC (rev 34608)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-09-09 16:42:20 UTC (rev 34609)
@@ -8,6 +8,7 @@
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
import org.jboss.tools.cdi.text.ext.hyperlink.AlternativeInjectedPointListHyperlink;
+import org.jboss.tools.cdi.text.ext.hyperlink.AssignableBeansHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlinkDetector;
import org.jboss.tools.cdi.text.ext.test.CDIHyperlinkTestUtil.TestRegion;
@@ -26,23 +27,23 @@
ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
regionList.add(new TestRegion(/*115, 6*/"Inject", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
- new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
})); // Inject
regionList.add(new TestRegion(/*133, 6*/"Logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
- new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
})); // Logger
regionList.add(new TestRegion(/*140, 6*/"logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
- new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
})); // logger
regionList.add(new TestRegion(/*196, 6*/"logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
- new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
})); // logger
regionList.add(new TestRegion(/*250, 6*/"logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
- new TestHyperlink(AlternativeInjectedPointListHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
})); // logger
CDIHyperlinkTestUtil.checkRegions(tckProject, "JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java", regionList, new InjectedPointHyperlinkDetector());
14 years, 7 months
JBoss Tools SVN: r34608 - in trunk: cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-09-09 12:29:33 -0400 (Fri, 09 Sep 2011)
New Revision: 34608
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/elValidation1.xhtml
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java
Log:
JBIDE-9633
Create JUnit tests to cover JBIDE-9515 issue
JUnit Test is added for proposals filtering and proposals applying check
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/elValidation1.xhtml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/elValidation1.xhtml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/elValidation1.xhtml 2011-09-09 16:29:33 UTC (rev 34608)
@@ -0,0 +1,13 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:define name="body">
+ <h:outputText value="#{namedBean.foo}"/>
+ <h:outputText value="#{sheep.name}"
+ rendered="#{(game.value == 'foo' and game.value == 'foo') ? game.value == 'foo' : false}"/>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/ca/elValidation1.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-09-09 16:22:59 UTC (rev 34607)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-09-09 16:29:33 UTC (rev 34608)
@@ -30,5 +30,6 @@
org.jboss.tools.jst.web.kb,
org.eclipse.wst.validation;bundle-version="1.2.300",
org.jboss.tools.jst.web.kb.test,
- org.jboss.tools.common.validation
+ org.jboss.tools.common.validation,
+ org.jboss.tools.jst.jsp;bundle-version="3.3.0"
Export-Package: org.jboss.tools.cdi.ui.test
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java 2011-09-09 16:29:33 UTC (rev 34608)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.test;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.common.base.test.contentassist.CATestUtil;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.test.util.JobUtils;
+
+/**
+ * Test case testing http://jira.jboss.com/jira/browse/JBIDE-9633 issue.
+ *
+ * @author Victor V. Rubezhny
+ *
+ */
+public class CAELProposalFilteringTest extends TestCase {
+
+ private IProject project;
+ private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
+ private static final String JSP_PAGE_NAME = "WebContent/test.jsp";
+ private static final String XHTML_PAGE_NAME = "WebContent/elValidation1.xhtml";
+
+ public CAELProposalFilteringTest() {
+ super();
+ try {
+ project = TCKUITest.importPreparedProject("/tests/lookup");
+ project = TCKUITest.importPreparedProject("/tests/ca");
+ caTest.setProject(project);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void testCAELProposalFilteringInJSP () {
+ caTest.openEditor(JSP_PAGE_NAME);
+ try {
+ doCAELProposalFilteringTest(JSP_PAGE_NAME, "rendered=\"#{(game.", "value : String - Game", "value");
+ doCAELProposalFilteringTest(JSP_PAGE_NAME, "value=\"#{sheep.", "name : String - Sheep", "name");
+ } finally {
+ caTest.closeEditor();
+ }
+ }
+
+ public void testCAELProposalFilteringInXHTML () {
+ caTest.openEditor(XHTML_PAGE_NAME);
+ try {
+ doCAELProposalFilteringTest(XHTML_PAGE_NAME, "value=\"#{sheep.", "name : String - Sheep", "name");
+ } finally {
+ caTest.closeEditor();
+ }
+ }
+
+ @SuppressWarnings("restriction")
+ private void doCAELProposalFilteringTest(String pageName, String prefix, String proposalToApply, String compareString) {
+ IDocument document = caTest.getDocument();
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent.indexOf(prefix));
+ assertFalse("Required text '" + prefix + "' not found in document", (start == -1));
+ int offsetToTest = start + prefix.length();
+
+ String documentContentToCompare = documentContent.substring(0, start + prefix.length()) +
+ compareString + documentContent.substring(start + prefix.length());
+
+ JobUtils.waitForIdle();
+
+ List<ICompletionProposal> res = CATestUtil.collectProposals(caTest.getContentAssistant(), caTest.getViewer(), offsetToTest);
+
+ assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
+
+ boolean bPropoosalToApplyFound = false;
+ for (ICompletionProposal p : res) {
+ if (!(p instanceof AutoContentAssistantProposal))
+ continue;
+ AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)p;
+ String proposalString = proposal.getDisplayString();
+
+ if (proposalToApply.equals(proposalString)) {
+ if (!bPropoosalToApplyFound) {
+ bPropoosalToApplyFound = true;
+ proposal.apply(document);
+ } else {
+ fail("Duplicate proposal '" + proposalToApply + "' found in CA Proposal List");
+ }
+ }
+ }
+ assertTrue("The proposal to apply not found.", bPropoosalToApplyFound);
+
+ try {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+
+ String documentUpdatedContent = document.get();
+ assertTrue("The proposal replacement is failed.", documentContentToCompare.equals(documentUpdatedContent));
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CAELProposalFilteringTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09 16:22:59 UTC (rev 34607)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-09-09 16:29:33 UTC (rev 34608)
@@ -58,7 +58,7 @@
}
TestSuite suiteAll = new TestSuite("CDI UI Tests");
TestSuite suite = new TestSuite("TCK Tests");
-
+
suiteAll.addTestSuite(CDIMarkerResolutionTest.class);
suiteAll.addTestSuite(CDIPerspectiveTest.class);
@@ -66,8 +66,8 @@
suiteAll.addTestSuite(CDIPreferencePageTest.class);
suiteAll.addTestSuite(NewCDIWizardTest.class);
suiteAll.addTestSuite(CATest.class);
-
-
+ suiteAll.addTestSuite(CAELProposalFilteringTest.class);
+
suite.addTestSuite(CDISearchParticipantTest.class);
suite.addTestSuite(ELReferencesQueryParticipantTest.class);
suiteAll.addTest(new CDICoreTestSetup(suite) {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java 2011-09-09 16:22:59 UTC (rev 34607)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java 2011-09-09 16:29:33 UTC (rev 34608)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.jsp.ca.test;
import java.util.List;
@@ -9,12 +19,17 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.jboss.tools.common.base.test.contentassist.CATestUtil;
-import org.jboss.tools.common.base.test.validation.TestUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
+/**
+ * Test case testing http://jira.jboss.com/jira/browse/JBIDE-9633 issue.
+ *
+ * @author Victor V. Rubezhny
+ *
+ */
public class CAJsfMessagesProposalsFilteringTest extends ContentAssistantTestCase {
private static final String PROJECT_NAME = "JSF2KickStartWithoutLibs";
private static final String PAGE_NAME = "WebContent/pages/inputname.xhtml";
14 years, 7 months