Author: yzhishko
Date: 2009-11-16 06:29:44 -0500 (Mon, 16 Nov 2009)
New Revision: 18692
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5193/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5193/JBIDE5193.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NullPointerWithStyleProperty_JBIDE5193.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5193 JUnit was added.
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5193/JBIDE5193.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5193/JBIDE5193.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5193/JBIDE5193.jsp 2009-11-16
11:29:44 UTC (rev 18692)
@@ -0,0 +1,13 @@
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<html>
+ <head>
+ <title>Input User Name Page</title>
+ </head>
+ <body>
+ <ul>
+ <li style="">Text</li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-11-16
09:47:40 UTC (rev 18691)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-11-16
11:29:44 UTC (rev 18692)
@@ -71,6 +71,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.MozDirtyTest_JBIDE5105;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.NullPointerWithStyleProperty_JBIDE5193;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.VpeI18nTest_JBIDE4887;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
@@ -176,6 +177,7 @@
suite.addTestSuite(VPERefreshTest.class);
suite.addTestSuite(OpenOnInsideJspRoot_JBIDE4852.class);
suite.addTestSuite(EditingSPecialSymbolsVPE_JBIDE3810.class);
+ suite.addTestSuite(NullPointerWithStyleProperty_JBIDE5193.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NullPointerWithStyleProperty_JBIDE5193.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NullPointerWithStyleProperty_JBIDE5193.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NullPointerWithStyleProperty_JBIDE5193.java 2009-11-16
11:29:44 UTC (rev 18692)
@@ -0,0 +1,49 @@
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+public class NullPointerWithStyleProperty_JBIDE5193 extends VpeTest {
+
+ private static final String TEST_PAGE_NAME = "JBIDE/5193/JBIDE5193.jsp";
//$NON-NLS-1$
+
+ public NullPointerWithStyleProperty_JBIDE5193(String name) {
+ super(name);
+ }
+
+ public void testNullPointerWithStyleProperty_JBIDE5193() throws Throwable {
+ TestUtil.waitForJobs();
+ setException(null);
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ JsfAllTests.IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file);
//$NON-NLS-1$
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+ final JSPMultiPageEditor parts = openEditor(input);
+ TestUtil.waitForIdle();
+ assertNotNull(parts);
+ StyledText styledText = parts.getSourceEditor().getTextViewer()
+ .getTextWidget();
+ String delimiter = styledText.getLineDelimiter();
+ int offset = styledText.getOffsetAtLine(10);
+ styledText.setCaretOffset(offset-delimiter.length()-"\">Text</li>".length());
+ styledText.insert(":");
+
+ VpeController controller = TestUtil.getVpeController(parts);
+ controller.selectionChanged(new SelectionChangedEvent(parts.getSelectionProvider(),
parts.getSelectionProvider().getSelection()));
+ }
+
+}