Author: dgolovin
Date: 2008-10-15 01:17:07 -0400 (Wed, 15 Oct 2008)
New Revision: 10841
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
Log:
fix junit tests errors in common.text.ext.test plug-in
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-14
23:48:00 UTC (rev 10840)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-15
05:17:07 UTC (rev 10841)
@@ -16,8 +16,10 @@
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.DocumentProviderRegistry;
@@ -45,6 +47,7 @@
OPENON_TEST_PROJECT);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
JobUtils.waitForIdle();
+ IWorkbench workbench = PlatformUI.getWorkbench();
}
protected void tearDown() {
@@ -314,7 +317,9 @@
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IRegion reg = new
FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "org.jboss.tools.test.TestBean1", true, true, false, false);
+ "b1", true, true, false, false);
+ reg = new
FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(reg.getOffset()+reg.getLength(),
+ "b1", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg,
false);
assertNotNull(links);
assertTrue(links.length!=0);
@@ -323,12 +328,11 @@
links[0].open();
JobUtils.waitForIdle();
editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ ITextSelection selection =
(ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<jsp:useBean id=\"b1\"
class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
- String fileName = editor.getEditorInput().getName();
- assertTrue("TestBean1.java".equals(fileName));
-
- reg = new
FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(reg.getOffset(),
- "b1", true, true, false, false);
+ reg = new
FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "org.jboss.tools.test.TestBean1", true, true, false, false);
links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
assertNotNull(links);
assertTrue(links.length!=0);
@@ -337,8 +341,8 @@
links[0].open();
JobUtils.waitForIdle();
editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextSelection selection =
(ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<jsp:useBean id=\"b1\"
class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("TestBean1.java".equals(fileName));
}
public static final String FORWARD_TEST_FILE = OPENON_TEST_PROJECT +
"/WebContent/forwardHiperlinkTests.jsp";
@@ -379,7 +383,7 @@
assertTrue("forwardHiperlinkPage1Tests.jsp".equals(fileName));
}
- public static final String INCLUDE_TEST_FILE = OPENON_TEST_PROJECT +
"/WebContent/includeHiperlinkTests.page.jsp";
+ public static final String INCLUDE_TEST_FILE = OPENON_TEST_PROJECT +
"/WebContent/includeHiperlinkTests.jsp";
public void testJspIncludeOpenOn() throws CoreException, BadLocationException {
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-14
23:48:00 UTC (rev 10840)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-15
05:17:07 UTC (rev 10841)
@@ -79,7 +79,7 @@
}
- assertTrue("Content Assistant peturned no proposals", (result != null
&& result.length > 0));
+ assertTrue("Content Assistant returned no proposals", (result != null
&& result.length > 0));
boolean bPropoosalToApplyFound = false;
for (int i = 0; i < result.length; i++) {