Author: dazarov
Date: 2011-07-28 20:18:02 -0400 (Thu, 28 Jul 2011)
New Revision: 33330
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/InjectedPointHyperlinkTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/XMLInjectedPointHyperlinkDetectorTest.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.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/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-9419
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/InjectedPointHyperlinkTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/InjectedPointHyperlinkTest.java 2011-07-28
22:37:43 UTC (rev 33329)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/InjectedPointHyperlinkTest.java 2011-07-29
00:18:02 UTC (rev 33330)
@@ -20,28 +20,28 @@
bean = b;
}
ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
- regionList.add(new TestRegion(97, 6, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*97, 6*/"Inject", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.messageDispatcherProducer()", bean),
})); // Inject
- regionList.add(new TestRegion(106, 7, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*106, 7*/"Durable", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.messageDispatcherProducer()", bean),
})); // Logger
- regionList.add(new TestRegion(115, 28, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*115, 28*/"MessageDispatcher dispatcher",
new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.messageDispatcherProducer()", bean),
})); // logger
- regionList.add(new TestRegion(148, 6, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*148, 6*/"Inject", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.getPolicy()", bean),
})); // logger
- regionList.add(new TestRegion(157, 7, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*157, 7*/"Durable", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.getPolicy()", bean),
})); // logger
- regionList.add(new TestRegion(166, 23, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*166, 23*/"DispatcherPolicy policy", new
TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.getPolicy()", bean),
})); // logger
- regionList.add(new TestRegion(281, 31, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*281, 31*/"Durable DispatcherPolicy policy",
new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.getPolicy()", bean),
})); // logger
- regionList.add(new TestRegion(318, 6, new TestHyperlink[]{
+ regionList.add(new TestRegion(/*318, 6*/"policy", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MessageManager.getPolicy()", bean),
})); // logger
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/XMLInjectedPointHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/XMLInjectedPointHyperlinkDetectorTest.java 2011-07-28
22:37:43 UTC (rev 33329)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/XMLInjectedPointHyperlinkDetectorTest.java 2011-07-29
00:18:02 UTC (rev 33330)
@@ -16,7 +16,7 @@
public void testXMLInjectedPointHyperlinkDetector() throws Exception {
ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
- regionList.add(new TestRegion(2166, 15, new TestHyperlink[]{
+ regionList.add(new TestRegion(2166, 15/*"s:Inject"*/, new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
MyBean6.myType6")
//new TestHyperlink(AlternativeInjectedPointListHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ALTERNATIVES)
}));
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2011-07-28
22:37:43 UTC (rev 33329)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2011-07-29
00:18:02 UTC (rev 33330)
@@ -11,6 +11,8 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
@@ -73,6 +75,9 @@
IDocument document = documentProvider.getDocument(editorInput);
assertNotNull("The document for the file \"" + fileName + "\"
is not loaded", document);
+
+ if(regionList.get(0).region == null)
+ loadRegions(regionList, document);
int expected = 0;
for(TestRegion testRegion : regionList)
@@ -99,6 +104,10 @@
int counter = 0;
for (int i = 0; i < document.getLength(); i++) {
+ int lineNumber = document.getLineOfOffset(i);
+ int position = i - document.getLineOffset(lineNumber)+1;
+ lineNumber++;
+
TestData testData = new TestData(document, i);
IHyperlink[] links = elPartitioner.detectHyperlinks(viewer,
testData.getHyperlinkRegion(), true);
@@ -110,7 +119,8 @@
counter++;
TestRegion testRegion = findOffsetInRegions(i, regionList);
if(testRegion == null){
- fail("Wrong detection for offset - "+i);
+ String information = findRegionInformation(document, i, regionList);
+ fail("Wrong detection for offset - "+i+" (line -
"+lineNumber+" position - "+position+") "+information);
}else{
checkTestRegion(links, testRegion);
}
@@ -118,8 +128,7 @@
else {
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);
+ fail("Wrong detection for region - "+getRegionInformation(document,
testRegion)+" offset - "+i+" (line - "+lineNumber+" position -
"+position+")");
}
}
}
@@ -167,6 +176,30 @@
}
return null;
}
+
+ private static void loadRegions(List<TestRegion> regionList, IDocument document)
throws BadLocationException{
+ FindReplaceDocumentAdapter adapter = new FindReplaceDocumentAdapter(document);
+ //String documentText = document.get();
+ //int position = documentText.indexOf("{");
+ IRegion region = adapter.find(0, "{", true, true, false, false);
+ if(region == null)
+ region = new Region(0,0);
+ for(TestRegion testRegion : regionList){
+ //int newPosition = documentText.indexOf(testRegion.regionText, position);
+ IRegion newRegion = adapter.find(region.getOffset()+region.getLength(),
testRegion.regionText, true, true, false, false);
+ if(newRegion != null){
+ testRegion.region = newRegion;
+ region = newRegion;
+ }else
+ fail("Can not find string - "+testRegion.regionText);
+ }
+
+ for(int i = regionList.size()-1; i >= 0; i--){
+ TestRegion r = regionList.get(i);
+ if(r.hyperlinks.size() == 0)
+ regionList.remove(r);
+ }
+ }
public static void checkHyperLinkInXml(IProject project, String fileName, int offset,
String hyperlinkClassName) throws Exception {
checkHyperLinkInXml(fileName, project, offset, hyperlinkClassName);
@@ -214,6 +247,34 @@
}
return null;
}
+
+ private static String findRegionInformation(IDocument document, int offset,
List<TestRegion> regionList) throws BadLocationException{
+ int index = 0;
+ for(int i = 0; i < regionList.size(); i++){
+ TestRegion testRegion = regionList.get(i);
+ if(offset > testRegion.region.getOffset()+testRegion.region.getLength()){
+ index = i;
+ }
+ }
+ String info = "previous region - " + getRegionInformation(document,
regionList.get(index));
+ if(index+1 < regionList.size())
+ info += " next region - " + getRegionInformation(document,
regionList.get(index+1));
+ return info;
+ }
+
+ private static String getRegionInformation(IDocument document, TestRegion region) throws
BadLocationException{
+ String info = "";
+ int lineNumber = document.getLineOfOffset(region.region.getOffset());
+ int position = region.region.getOffset() - document.getLineOffset(lineNumber)+1;
+ lineNumber++;
+
+ if(region.regionText != null)
+ info += "<"+region.regionText+"> ";
+
+ info += region.region.getOffset()+" -
"+(region.region.getOffset()+region.region.getLength())+" line -
"+lineNumber+" position - "+position;
+
+ return info;
+ }
public static IEditorPart openFileInEditor(IFile input) {
return openFileInEditor(input, null);
@@ -337,7 +398,8 @@
}
public static class TestRegion{
- Region region;
+ IRegion region = null;
+ String regionText = null;
ArrayList<TestHyperlink> hyperlinks = new ArrayList<TestHyperlink>();
public TestRegion(int offset, int length, TestHyperlink[] testHyperlinks){
@@ -346,6 +408,13 @@
hyperlinks.add(testHyperlink);
}
}
+
+ public TestRegion(String regionText, TestHyperlink[] testHyperlinks){
+ this.regionText = regionText;
+ for(TestHyperlink testHyperlink : testHyperlinks){
+ hyperlinks.add(testHyperlink);
+ }
+ }
}
public static class TestHyperlink{
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-07-28
22:37:43 UTC (rev 33329)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/EventAndObserverMethodHyperlinkDetectorTest.java 2011-07-29
00:18:02 UTC (rev 33330)
@@ -35,19 +35,18 @@
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, elementPaths)}));
- regionList.add(new TestRegion(967, 16, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(985, 11, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1006, 6, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1014, 3, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1019, 34, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1055, 42, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1107, 6, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1115, 34, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1151, 36, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1188, 3, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1235, 11, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
- regionList.add(new TestRegion(1334, 42, new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*959, 6*/"Inject", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*967, 16*/"Any Event<String", new
TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*985, 11*/"stringEvent", new
TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1006, 6*/"Inject", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1014, 3*/"Any", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1019, 34*/"NonRuntimeBindingType
Event<String", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1055,
42*/"stringEventWithAnyAndNonRuntimeBindingType", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1107, 6*/"Inject", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1115, 34*/"NonRuntimeBindingType
Event<String", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1151,
36*/"stringEventWithOnlyNonRuntimeBindingType", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1235, 11*/"stringEvent", new
TestHyperlink[]{new TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
+ regionList.add(new TestRegion(/*1334,
42*/"stringEventWithAnyAndNonRuntimeBindingType", new TestHyperlink[]{new
TestHyperlink(ObserverMethodListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_OBSERVER_METHODS, elementPaths)}));
CDIHyperlinkTestUtil.checkRegions(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/event/bindingTypes/EventEmitter.java",
regionList, new EventAndObserverMethodHyperlinkDetector());
}
@@ -62,11 +61,10 @@
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, elementPaths)}));
- regionList.add(new TestRegion(1201, 13, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
- regionList.add(new TestRegion(1216, 15, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
- regionList.add(new TestRegion(1232, 9, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
- regionList.add(new TestRegion(1264, 18, new TestHyperlink[]{new
TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
+ regionList.add(new TestRegion(/*1201, 13*/"observeSimpleEvent", new
TestHyperlink[]{new TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
+ regionList.add(new TestRegion(/*1216, 15*/"Observes String", new
TestHyperlink[]{new TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
+ regionList.add(new TestRegion(/*1232, 9*/"someEvent", new
TestHyperlink[]{new TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
+ regionList.add(new TestRegion(/*1264, 18*/"OversizedException", new
TestHyperlink[]{new TestHyperlink(EventListHyperlink.class,
CDIExtensionsMessages.CDI_EVENT_LIST_HYPERLINK_OPEN_EVENTS, elementPaths)}));
CDIHyperlinkTestUtil.checkRegions(tckProject,
"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/InjectedPointHyperlinkDetectorTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-07-28
22:37:43 UTC (rev 33329)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-07-29
00:18:02 UTC (rev 33330)
@@ -24,23 +24,23 @@
bean = b;
}
ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
- regionList.add(new TestRegion(115, 6, new TestHyperlink[]{
+ 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)
})); // Inject
- regionList.add(new TestRegion(133, 6, new TestHyperlink[]{
+ 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)
})); // Logger
- regionList.add(new TestRegion(140, 6, new TestHyperlink[]{
+ 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)
})); // logger
- regionList.add(new TestRegion(196, 6, new TestHyperlink[]{
+ 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)
})); // logger
- regionList.add(new TestRegion(250, 6, new TestHyperlink[]{
+ 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)
})); // logger
@@ -55,18 +55,21 @@
bean = b;
}
ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
- regionList.add(new TestRegion(104, 6, new TestHyperlink[]{
+ regionList.add(new TestRegion("Inject", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger", bean)
})); // Inject
- regionList.add(new TestRegion(134, 13, new TestHyperlink[]{
+ regionList.add(new TestRegion("Logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger", bean)
})); // Logger
- regionList.add(new TestRegion(197, 6, new TestHyperlink[]{
+ regionList.add(new TestRegion("logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger", bean)
})); // logger
- regionList.add(new TestRegion(251, 6, new TestHyperlink[]{
+ regionList.add(new TestRegion("logger", new TestHyperlink[]{
new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger", bean)
})); // logger
+ regionList.add(new TestRegion("logger", new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ "
BasicLogger", bean)
+ })); // logger
CDIHyperlinkTestUtil.checkRegions(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/LoggerConsumer.java",
regionList, new InjectedPointHyperlinkDetector());
}
@@ -97,12 +100,14 @@
bean = b;
}
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",
bean)}));
- regionList.add(new TestRegion(894, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)})); // Fox
- regionList.add(new TestRegion(898, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
- regionList.add(new TestRegion(975, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
- regionList.add(new TestRegion(979, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
- regionList.add(new TestRegion(1017, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*880, 6*/"Inject", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*894, 3*/"Fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)})); // Fox
+ regionList.add(new TestRegion(/*898, 3*/"fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ // Fake TestRegion for search purpose
+ regionList.add(new TestRegion("FoxFarm", new TestHyperlink[]{}));
+ regionList.add(new TestRegion(/*975, 3*/"Fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*979, 3*/"fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*1017, 3*/"fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
CDIHyperlinkTestUtil.checkRegions(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java",
regionList, new InjectedPointHyperlinkDetector());
}
@@ -114,12 +119,13 @@
bean = b;
}
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",
bean)}));
- regionList.add(new TestRegion(894, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)})); // Fox
- regionList.add(new TestRegion(898, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
- regionList.add(new TestRegion(972, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
- regionList.add(new TestRegion(976, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
- regionList.add(new TestRegion(1014, 3, new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*880, 6*/"Inject", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*894, 3*/"Fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)})); // Fox
+ regionList.add(new TestRegion(/*898, 3*/"fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion("init(", new TestHyperlink[]{}));
+ regionList.add(new TestRegion(/*972, 3*/"Fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*976, 3*/"fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
+ regionList.add(new TestRegion(/*1014, 3*/"fox", new TestHyperlink[]{new
TestHyperlink(InjectedPointHyperlink.class,
CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " Fox",
bean)}));
CDIHyperlinkTestUtil.checkRegions(tckProject,
"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-07-28
22:37:43 UTC (rev 33329)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/ProducerDisposerHyperlinkDetectorTest.java 2011-07-29
00:18:02 UTC (rev 33330)
@@ -14,9 +14,9 @@
public void testProducerDisposerHyperlinkDetector() throws Exception {
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
+ regionList.add(new TestRegion(/*1199, 8*/"Produces", new TestHyperlink[]{new
TestHyperlink(DisposerHyperlink.class,
CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER+ "
dispose")})); // @Produces
+ regionList.add(new TestRegion(/*1222, 7*/"produce", new TestHyperlink[]{new
TestHyperlink(DisposerHyperlink.class,
CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER+ "
dispose")})); // producer
+ regionList.add(new TestRegion(/*1291, 7*/"dispose", new TestHyperlink[]{new
TestHyperlink(ProducerHyperlink.class,
CDIExtensionsMessages.CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_PRODUCER+ "
produce")})); // disposer
CDIHyperlinkTestUtil.checkRegions(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java",
regionList, new ProducerDisposerHyperlinkDetector());
}