Author: scabanovich
Date: 2011-05-04 14:47:01 -0400 (Wed, 04 May 2011)
New Revision: 31070
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CdiSeamTextExtAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamConfigTagNameHyperlinkTest.java
Log:
JBIDE-8841
https://issues.jboss.org/browse/JBIDE-8841
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CdiSeamTextExtAllTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CdiSeamTextExtAllTests.java 2011-05-04
18:30:40 UTC (rev 31069)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CdiSeamTextExtAllTests.java 2011-05-04
18:47:01 UTC (rev 31070)
@@ -29,7 +29,7 @@
suiteAll.addTest(new CDICoreTestSetup(suite));
- TestSuite suiteConfig = new TestSuite("CDI Seam Config Tests");
+ TestSuite suiteConfig = new TestSuite("CDI Seam Config OpenOns Tests");
suiteConfig.addTestSuite(SeamConfigTagNameHyperlinkTest.class);
suiteAll.addTest(new SeamConfigTestSetup(suiteConfig));
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamConfigTagNameHyperlinkTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamConfigTagNameHyperlinkTest.java 2011-05-04
18:30:40 UTC (rev 31069)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamConfigTagNameHyperlinkTest.java 2011-05-04
18:47:01 UTC (rev 31070)
@@ -11,12 +11,15 @@
package org.jboss.tools.cdi.seam.text.ext.test;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.jboss.tools.cdi.seam.config.core.test.SeamConfigTest;
import org.jboss.tools.cdi.seam.text.ext.CDISeamExtPlugin;
import org.jboss.tools.cdi.text.ext.test.HyperlinkDetectorTest;
+import org.jboss.tools.common.util.FileUtil;
/**
*
@@ -27,14 +30,30 @@
public SeamConfigTagNameHyperlinkTest() {}
public void testSeamConfigTagNameHyperlink() throws Exception {
- IHyperlink hyperlink =
HyperlinkDetectorTest.checkHyperLinkInXml("src/META-INF/beans.xml", project,
802, "org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlink");
+ int offset = 802; // <|test602:Report>
+ IHyperlink hyperlink =
HyperlinkDetectorTest.checkHyperLinkInXml("src/META-INF/beans.xml", project,
offset,
"org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlink");
hyperlink.open();
IEditorPart editor =
CDISeamExtPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
IFileEditorInput input = (IFileEditorInput)editor.getEditorInput();
IFile f = input.getFile();
- assertEquals("Report.java", f.getName());
+ assertEquals("Report.java", f.getName());
+ }
+
+ public void testSeamConfigTagAttributeHyperlink() throws Exception {
+ int offset = 1088; // <test603:OtherQualifier va|lue1="AA"
+ IHyperlink hyperlink =
HyperlinkDetectorTest.checkHyperLinkInXml("src/META-INF/beans.xml", project,
offset,
"org.jboss.tools.cdi.seam.text.ext.hyperlink.SeamConfigTagNameHyperlink");
+ hyperlink.open();
+ IEditorPart editor =
CDISeamExtPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ IFileEditorInput input = (IFileEditorInput)editor.getEditorInput();
+ IFile f = input.getFile();
+ assertEquals("OtherQualifier.java", f.getName());
+ ISelection selection = editor.getEditorSite().getSelectionProvider().getSelection();
+ System.out.println(selection);
+ assertTrue(selection instanceof TextSelection);
+ TextSelection textSelection = (TextSelection)selection;
+ assertEquals("value1", textSelection.getText());
}
}