Author: estherbin
Date: 2008-06-10 05:43:57 -0400 (Tue, 10 Jun 2008)
New Revision: 8668
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java
Log:
Change testcases.
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java 2008-06-10
09:32:49 UTC (rev 8667)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2227TestCase.java 2008-06-10
09:43:57 UTC (rev 8668)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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.seam.ui.test.jbide;
@@ -21,57 +31,118 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
-import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
/**
* The Class JBide2227TestCase.
*/
-public class JBide2227TestCase extends ContentAssistantTestCase {
+public class JBide2227TestCase extends VpeTest {
+ /** The Constant CA_NAME. */
+ private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT";
+
/** The Constant IMPORT_PROJECT_NAME. */
private static final String IMPORT_PROJECT_NAME =
"TestSeamELContentAssist";
/** The Constant PAGE_1. */
private static final String PAGE_1 = "/WebContent/jbide2227/withEl.xhtml";
- /** The Constant CA_NAME. */
- private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT";
+ /** The Constant PAGE_2. */
+ private static final String PAGE_2 =
"/WebContent/jbide2227/withoutEl.xhtml";
- /** The provider. */
- private TestProjectProvider provider;
+ /**
+ * Suite.
+ *
+ * @return the test
+ */
+ public static Test suite() {
+ return new TestSuite(JBide2227TestCase.class);
+ }
- /** The project. */
- private IProject project;
-
/** The make copy. */
private boolean makeCopy;
- /** The Constant PAGE_2. */
- private static final String PAGE_2 =
"/WebContent/jbide2227/withoutEl.xhtml";
+ /** The project. */
+ private IProject project;
+ /** The provider. */
+ private TestProjectProvider provider;
/**
* The Constructor.
*/
public JBide2227TestCase() {
- super();
+ super("");
}
/**
- * Suite.
+ * The Constructor.
*
- * @return the test
+ * @param name
+ * the name
*/
- public static Test suite() {
- return new TestSuite(JBide2227TestCase.class);
+ public JBide2227TestCase(String name) {
+ super(name);
}
/**
+ * Base checkof CA.
+ *
+ * @param testPagePath
+ * the test page path
+ * @param position
+ * the position
+ * @param caName
+ * the ca name
+ * @param numberOfProposals
+ * the number of proposals
+ *
+ * @throws CoreException
+ * the core exception
+ */
+ protected void check(String caName, String testPagePath, int position, int
numberOfProposals) throws CoreException {
+ // get test page path
+ IFile file = project.getFile(testPagePath);
+ assertNotNull("Could not open specified file " + file.getFullPath(),
file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // sets cursor position
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(position);
+ TestUtil.waitForJobs();
+ TestUtil.delay(2000);
+ SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor)
part.getSourceEditor())
+ .getSourceViewerConfigurationForTest();
+ // errase errors which can be on start of editor(for example xuklunner
+ // not found)
+ setException(null);
+ StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration)
sourceViewerConfiguration;
+ IContentAssistant iContentAssistant = stvc.getContentAssistant((ISourceViewer)
part.getSourceEditor().getAdapter(
+ ISourceViewer.class));
+ assertNotNull(iContentAssistant);
+ IContentAssistProcessor iContentAssistProcessor =
iContentAssistant.getContentAssistProcessor(caName);
+ assertNotNull(iContentAssistProcessor);
+ ICompletionProposal[] results = iContentAssistProcessor
+ .computeCompletionProposals(part.getSourceEditor().getTextViewer(),
position);
+ assertNotNull(results);
+ assertEquals(numberOfProposals, results.length);
+
+ closeEditors();
+ TestUtil.delay(1000L);
+ }
+
+ /**
* Sets the up.
*
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
public void setUp() throws Exception {
provider = new TestProjectProvider("org.jboss.tools.seam.ui.test",
null, IMPORT_PROJECT_NAME, makeCopy);
@@ -89,7 +160,8 @@
/**
* Tear down.
*
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
protected void tearDown() throws Exception {
if (provider != null) {
@@ -100,90 +172,34 @@
/**
* Test content assist with el.
*
- * @throws Throwable the throwable
+ * @throws Throwable
+ * the throwable
*/
public void testContentAssistWithEl() throws Throwable {
// wait
TestUtil.waitForJobs();
// set exception
-
- // FIXME Compilation Error
- // setException(null);
-
+ setException(null);
// Tests CA
check(CA_NAME, PAGE_1, 576, 114);
// check exception
- /*
- * FIXME COmpilation error
- * if (getException() != null) {
+ if (getException() != null) {
throw getException();
- }*/
+ }
}
/**
- * Base checkof CA.
- *
- * @param testPagePath the test page path
- * @param position the position
- * @param caName the ca name
- * @param numberOfProposals the number of proposals
- *
- * @throws CoreException the core exception
- */
- protected void check(String caName, String testPagePath, int position, int
numberOfProposals) throws CoreException {
- // get test page path
- IFile file = project.getFile(testPagePath);
- assertNotNull("Could not open specified file " + file.getFullPath(),
file);
-
- IEditorInput input = new FileEditorInput(file);
-
- assertNotNull("Editor input is null", input);
-
- // open and get editor
- JSPMultiPageEditor part = null;
- // FIXME Compilation Error
- //JSPMultiPageEditor part = openEditor(input);
-
- // sets cursor position
- part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(position);
- TestUtil.waitForJobs();
- TestUtil.delay(2000);
- SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor)
part.getSourceEditor())
- .getSourceViewerConfigurationForTest();
- // errase errors which can be on start of editor(for example xuklunner
- // not found)
- // FIXME Compilation Errors
- //setException(null);
- StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration)
sourceViewerConfiguration;
- IContentAssistant iContentAssistant = stvc.getContentAssistant((ISourceViewer)
part.getSourceEditor().getAdapter(
- ISourceViewer.class));
- assertNotNull(iContentAssistant);
- IContentAssistProcessor iContentAssistProcessor =
iContentAssistant.getContentAssistProcessor(caName);
- assertNotNull(iContentAssistProcessor);
- ICompletionProposal[] results = iContentAssistProcessor
- .computeCompletionProposals(part.getSourceEditor().getTextViewer(),
position);
- assertNotNull(results);
- assertEquals(numberOfProposals, results.length);
-
- // FIXME Compilation Errors
- //closeEditors();
- TestUtil.delay(1000L);
- }
-
- /**
* Test content assist without el.
*
- * @throws Throwable the throwable
+ * @throws Throwable
+ * the throwable
*/
public void testContentAssistWithoutEl() throws Throwable {
TestUtil.waitForJobs();
- /* FIXME Compilation error
- * setException(null);
- */
check(CA_NAME, PAGE_2, 580, 11);
}