Author: dazarov
Date: 2011-06-02 16:29:02 -0400 (Thu, 02 Jun 2011)
New Revision: 31789
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java
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/ProducerDisposerHyperlinkDetectorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9058
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java 2011-06-02
20:04:56 UTC (rev 31788)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/CustomProducerImpl.java 2011-06-02
20:29:02 UTC (rev 31789)
@@ -1,15 +1,10 @@
package org.jboss.jsr299.tck.tests.jbt.openon;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.New;
import javax.enterprise.inject.Produces;
-/**
- * @author pmuir
- *
- */
-public class CustomProducerImpl implements Producer
+public class CustomProducerImpl
{
private static boolean disposedCorrectly = false;
@@ -23,22 +18,16 @@
}
@Produces
- public Foo produce()
+ public Something produce(Something order)
{
- return new Foo("foo!");
+ return new Something();
}
- @Produces
- public Foo produce2(Foo order)
+ public void dispose(@Disposes Something toDispose)
{
- return new Foo("foo!");
+
}
- public void dispose(@Disposes Foo foo)
- {
- disposedCorrectly = foo.getFoo().equals("decorated");
- }
-
/**
* @return the disposedCorrectly
*/
@@ -46,5 +35,9 @@
{
return disposedCorrectly;
}
+
+ public class Something{
+
+ }
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java 2011-06-02
20:04:56 UTC (rev 31788)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java 2011-06-02
20:29:02 UTC (rev 31789)
@@ -3,7 +3,9 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.Region;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.cdi.seam.text.ext.CDISeamExtMessages;
+import org.jboss.tools.cdi.seam.text.ext.hyperlink.CDISeamResourceLoadingHyperlink;
import
org.jboss.tools.cdi.seam.text.ext.hyperlink.CDISeamResourceLoadingHyperlinkDetector;
import org.jboss.tools.cdi.text.ext.test.HyperlinkDetectorTest;
import org.jboss.tools.common.util.FileUtil;
@@ -16,12 +18,12 @@
String text = FileUtil.readStream(file);
- ArrayList<Region> regionList = new ArrayList<Region>();
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
int injectPosition = text.indexOf("@Inject");
//System.out.println("injectPosition - "+injectPosition);
if(injectPosition > 0){
- regionList.add(new Region(injectPosition, 58));
+ regionList.add(new TestRegion(injectPosition, 58, new TestHyperlink[]{new
TestHyperlink(CDISeamResourceLoadingHyperlink.class,
NLS.bind(CDISeamExtMessages.CDI_SEAM_RESOURCE_LOADING_HYPERLINK,
"WEB-INF/beans.xml"))}));
}
checkRegions(FILENAME, regionList, new CDISeamResourceLoadingHyperlinkDetector());
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2011-06-02
20:04:56 UTC (rev 31788)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2011-06-02
20:29:02 UTC (rev 31789)
@@ -2,37 +2,40 @@
import java.util.ArrayList;
-import org.eclipse.jface.text.Region;
+import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
import org.jboss.tools.cdi.text.ext.hyperlink.EventAndObserverMethodHyperlinkDetector;
+import org.jboss.tools.cdi.text.ext.hyperlink.EventListHyperlink;
+import org.jboss.tools.cdi.text.ext.hyperlink.ObserverMethodListHyperlink;
public class EventAndObserverMethodHyperlinkDetectorTest extends HyperlinkDetectorTest {
public void testEventHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(959, 6));
- regionList.add(new Region(967, 16));
- regionList.add(new Region(985, 11));
- regionList.add(new Region(1006, 6));
- regionList.add(new Region(1014, 3));
- regionList.add(new Region(1019, 34));
- regionList.add(new Region(1055, 42));
- regionList.add(new Region(1107, 6));
- regionList.add(new Region(1115, 34));
- regionList.add(new Region(1151, 36));
- regionList.add(new Region(1188, 3));
- regionList.add(new Region(1235, 11));
- regionList.add(new Region(1334, 42));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+
+ regionList.add(new TestRegion(959, 6, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(967, 16, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(985, 11, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1006, 6, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1014, 3, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1019, 34, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1055, 42, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1107, 6, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1115, 34, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1151, 36, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1188, 3, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1235, 11, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
+ regionList.add(new TestRegion(1334, 42, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS)}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java",
regionList, new EventAndObserverMethodHyperlinkDetector());
}
public void testObserverMethodHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(1196, 4));
- regionList.add(new Region(1201, 13));
- regionList.add(new Region(1216, 15));
- regionList.add(new Region(1232, 9));
- regionList.add(new Region(1264, 18));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(1196, 4, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1201, 13, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1216, 15, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1232, 9, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
+ regionList.add(new TestRegion(1264, 18, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS)}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/event/observer/checkedException/TeaCupPomeranian.java",
regionList, new EventAndObserverMethodHyperlinkDetector());
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java 2011-06-02
20:04:56 UTC (rev 31788)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/HyperlinkDetectorTest.java 2011-06-02
20:29:02 UTC (rev 31789)
@@ -1,5 +1,6 @@
package org.jboss.tools.cdi.text.ext.test;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -35,7 +36,7 @@
import org.jboss.tools.common.text.ext.util.AxisUtil;
public class HyperlinkDetectorTest extends TCKTest {
- protected void checkRegions(String fileName, List<Region> regionList,
AbstractHyperlinkDetector elPartitioner) throws Exception {
+ protected void checkRegions(String fileName, List<TestRegion> regionList,
AbstractHyperlinkDetector elPartitioner) throws Exception {
IFile file = tckProject.getFile(fileName);
assertNotNull("The file \"" + fileName + "\" is not
found", file);
@@ -65,8 +66,8 @@
assertNotNull("The document for the file \"" + fileName + "\"
is not loaded", document);
int expected = 0;
- for(Region region : regionList)
- expected += region.getLength()+1;
+ for(TestRegion testRegion : regionList)
+ expected += testRegion.region.getLength()+1;
IEditorPart part = openFileInEditor(file);
ISourceViewer viewer = null;
@@ -85,14 +86,17 @@
if (recognized) {
counter++;
- if(!findOffsetInRegions(i, regionList)){
+ TestRegion testRegion = findOffsetInRegions(i, regionList);
+ if(testRegion == null){
fail("Wrong detection for offset - "+i);
+ }else{
+ checkTestRegion(links, testRegion);
}
} else {
- for(Region region : regionList){
- if(i >= region.getOffset() && i <=
region.getOffset()+region.getLength()) {
- int line = document.getLineOfOffset(region.getOffset());
- fail("Wrong detection for region - "+region.getOffset()+" :
"+region.getLength()+" region - "+i);
+ for(TestRegion testRegion : regionList){
+ if(i >= testRegion.region.getOffset() && i <=
testRegion.region.getOffset()+testRegion.region.getLength()) {
+ int line = document.getLineOfOffset(testRegion.region.getOffset());
+ fail("Wrong detection for region - "+testRegion.region.getOffset()+"
: "+testRegion.region.getLength()+" region - "+i);
}
}
}
@@ -102,7 +106,37 @@
documentProvider.disconnect(editorInput);
}
+
+ protected void checkTestRegion(IHyperlink[] links, TestRegion testRegion){
+ for(IHyperlink link : links){
+ TestHyperlink testLink = findTestHyperlink(testRegion.hyperlinks, link);
+ assertNotNull("Unexpected hyperlink - "+link.getHyperlinkText(), testLink);
+ assertEquals("Unexpected hyperlink type", testLink.hyperlink,
link.getClass());
+ assertTrue("Validation fails for hyperlink - "+link.getHyperlinkText(),
testLink.validateHyperlink(link));
+ }
+
+ for(TestHyperlink testLink : testRegion.hyperlinks){
+ IHyperlink link = findHyperlink(links, testLink);
+ assertNotNull("Hyperlink - "+testLink.name+" not found", link);
+ }
+ }
+
+ protected TestHyperlink findTestHyperlink(List<TestHyperlink> testHyperlinks,
IHyperlink link){
+ for(TestHyperlink testLink : testHyperlinks){
+ if(testLink.name.equals(link.getHyperlinkText()))
+ return testLink;
+ }
+ return null;
+ }
+ protected IHyperlink findHyperlink(IHyperlink[] links, TestHyperlink testLink){
+ for(IHyperlink link : links){
+ if(testLink.name.equals(link.getHyperlinkText()))
+ return link;
+ }
+ return null;
+ }
+
protected void checkHyperLinkInXml(String fileName, int offset, String
hyperlinkClassName) throws Exception {
checkHyperLinkInXml(fileName, tckProject, offset, hyperlinkClassName);
}
@@ -142,12 +176,12 @@
return null;
}
- protected boolean findOffsetInRegions(int offset, List<Region> regionList){
- for(Region region : regionList){
- if(offset >= region.getOffset() && offset <=
region.getOffset()+region.getLength())
- return true;
+ protected TestRegion findOffsetInRegions(int offset, List<TestRegion>
regionList){
+ for(TestRegion testRegion : regionList){
+ if(offset >= testRegion.region.getOffset() && offset <=
testRegion.region.getOffset()+testRegion.region.getLength())
+ return testRegion;
}
- return false;
+ return null;
}
public static IEditorPart openFileInEditor(IFile input) {
@@ -270,4 +304,30 @@
return null;
}
}
+
+ public class TestRegion{
+ Region region;
+ ArrayList<TestHyperlink> hyperlinks = new ArrayList<TestHyperlink>();
+
+ public TestRegion(int offset, int length, TestHyperlink[] testHyperlinks){
+ region = new Region(offset, length);
+ for(TestHyperlink testHyperlink : testHyperlinks){
+ hyperlinks.add(testHyperlink);
+ }
+ }
+ }
+
+ public class TestHyperlink{
+ Class<? extends IHyperlink> hyperlink;
+ String name;
+
+ public TestHyperlink(Class<? extends IHyperlink> hyperlink, String name){
+ this.hyperlink = hyperlink;
+ this.name = name;
+ }
+
+ public boolean validateHyperlink(IHyperlink hyperlink){
+ return true;
+ }
+ }
}
\ No newline at end of file
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-06-02
20:04:56 UTC (rev 31788)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-06-02
20:29:02 UTC (rev 31789)
@@ -2,54 +2,77 @@
import java.util.ArrayList;
-import org.eclipse.jface.text.Region;
+import org.eclipse.core.resources.IFile;
+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.InjectedPointHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlinkDetector;
-import org.jboss.tools.cdi.text.ext.hyperlink.ProducerDisposerHyperlinkDetector;
+import org.jboss.tools.cdi.text.ext.test.HyperlinkDetectorTest.TestRegion;
+import org.jboss.tools.common.util.FileUtil;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
public class InjectedPointHyperlinkDetectorTest extends HyperlinkDetectorTest {
public void testInjectedPointHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(115, 6)); // Inject
- regionList.add(new Region(133, 6)); // Logger
- regionList.add(new Region(140, 6)); // logger
- regionList.add(new Region(196, 6)); // logger
- regionList.add(new Region(250, 6)); // logger
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(115, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // Inject
+ regionList.add(new TestRegion(133, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // Logger
+ regionList.add(new TestRegion(140, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // logger
+ regionList.add(new TestRegion(196, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // logger
+ regionList.add(new TestRegion(250, 6, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger"),
+ new TestHyperlink(AlternativeInjectedPointListHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
+ })); // logger
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java",
regionList, new InjectedPointHyperlinkDetector());
}
public void testInjectedProducerMethodParametersHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(551, 9)); // order
+ IFile file =
tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java");
+ String text = FileUtil.readStream(file);
+ int orderPosition = text.indexOf("Something order");
+
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(orderPosition, 15, new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
CustomProducerImpl.produce()")
+ })); // order
+
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java",
regionList, new InjectedPointHyperlinkDetector());
}
public void testInjectedConstructorParametersHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(880, 6));
- regionList.add(new Region(894, 3)); // Fox
- regionList.add(new Region(898, 3));
- regionList.add(new Region(975, 3));
- regionList.add(new Region(979, 3));
- regionList.add(new Region(1017, 3));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(880, 6, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(894, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
// Fox
+ regionList.add(new TestRegion(898, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(975, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(979, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(1017, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java",
regionList, new InjectedPointHyperlinkDetector());
}
public void testInjectedInitializerParametersHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(880, 6));
- regionList.add(new Region(894, 3)); // Fox
- regionList.add(new Region(898, 3));
- regionList.add(new Region(972, 3));
- regionList.add(new Region(976, 3));
- regionList.add(new Region(1014, 3));
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(880, 6, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(894, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox")}));
// Fox
+ regionList.add(new TestRegion(898, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(972, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(976, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
+ regionList.add(new TestRegion(1014, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
Fox")}));
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java",
regionList, new InjectedPointHyperlinkDetector());
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2011-06-02
20:04:56 UTC (rev 31788)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2011-06-02
20:29:02 UTC (rev 31789)
@@ -2,16 +2,18 @@
import java.util.ArrayList;
-import org.eclipse.jface.text.Region;
+import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
+import org.jboss.tools.cdi.text.ext.hyperlink.DisposerHyperlink;
import org.jboss.tools.cdi.text.ext.hyperlink.ProducerDisposerHyperlinkDetector;
+import org.jboss.tools.cdi.text.ext.hyperlink.ProducerHyperlink;
public class ProducerDisposerHyperlinkDetectorTest extends HyperlinkDetectorTest {
public void testProducerDisposerHyperlinkDetector() throws Exception {
- ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(1199, 8)); // @Produces
- regionList.add(new Region(1222, 7)); // producer
- regionList.add(new Region(1291, 7)); // disposer
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(1199, 8, new TestHyperlink[]{new
TestHyperlink(DisposerHyperlink.class,
CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER+ "
dispose")})); // @Produces
+ regionList.add(new TestRegion(1222, 7, new TestHyperlink[]{new
TestHyperlink(DisposerHyperlink.class,
CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER+ "
dispose")})); // producer
+ regionList.add(new TestRegion(1291, 7, new TestHyperlink[]{new
TestHyperlink(ProducerHyperlink.class,
CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_PRODUCER+ "
produce")})); // disposer
checkRegions("JavaSource/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java",
regionList, new ProducerDisposerHyperlinkDetector());
}