Author: mareshkau
Date: 2008-10-29 07:24:07 -0400 (Wed, 29 Oct 2008)
New Revision: 11274
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
junit for JBIDE-3030
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-10-29
11:11:17 UTC (rev 11273)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-10-29
11:24:07 UTC (rev 11274)
@@ -20,6 +20,8 @@
org.eclipse.jface.text,
org.jboss.tools.jsf.vpe.jsf,
org.jboss.tools.jst.web,
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.ide,
org.jboss.tools.vpe.resref;bundle-version="2.0.0",
org.jboss.tools.common.el.ui;bundle-version="1.0.0",
org.jboss.tools.common.el.core;bundle-version="2.0.0"
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.html 2008-10-29
11:24:07 UTC (rev 11274)
@@ -0,0 +1,124 @@
+<html>
+<head>
+<title>
+html table
+</title>
+</head>
+<body>
+<table cellpadding="3" cellspacing="3" border="1">
+
+ <tr id="2row 1">
+ <td colspan="2" bgcolor="aqua" height="20">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ </tr>
+ <tr id="2row 2">
+ <td bgcolor="red">
+
+ </td>
+ <td bgcolor="green" height="50" width="200">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ </tr>
+
+ <tr id="2row 3">
+ <td colspan="2" bgcolor="aqua" height="20">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ </tr>
+
+ <tr id="2row 4">
+ <td bgcolor="orange" height="50" width="63">
+
+ </td>
+ <td bgcolor="blue" height="10" width="224">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ </tr>
+
+ <tr id="2row 5">
+ <td bgcolor="yellow" width="70">
+ </td>
+ <td colspan="2" bgcolor="aqua" height="20">
+
+ </td>
+ </tr>
+
+ </table>
+
+
+
+<table cellpadding="3" cellspacing="3" border="1">
+
+ <tr id="row 1">
+ <td bgcolor="yellow">
+ </td>
+ <td colspan="2" bgcolor="aqua" height="20">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ </tr>
+ <tr id="row 2">
+ <td bgcolor="red">
+
+ </td>
+ <td bgcolor="green" height="50" width="200">
+
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ </tr>
+
+ <tr id="row 3">
+ <td colspan="2" bgcolor="aqua" height="20">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ </tr>
+
+ <tr id="row 4">
+ <td bgcolor="yellow" width="70">
+ </td>
+ <td bgcolor="orange" height="50" width="63">
+
+ </td>
+ <td bgcolor="blue" height="10" width="224">
+
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ </tr>
+
+ <tr id="row 5">
+ <td bgcolor="yellow" width="70">
+ </td>
+ <td colspan="2" bgcolor="aqua" height="20">
+
+ </td>
+ <td bgcolor="yellow" width="70">
+ </td>
+ <td bgcolor="pink" width="70">
+ </td>
+ </tr>
+
+ </table>
+</body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.jsp 2008-10-29
11:24:07 UTC (rev 11274)
@@ -0,0 +1,15 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:loadBundle basename="demo.resources" var="msg" />
+ <f:view>
+ <H1> JSP Test Page </H1>
+ <h:outputText value="#{msg.header}" />
+ </f:view>
+ </body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/test.xhtml 2008-10-29
11:24:07 UTC (rev 11274)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+<f:loadBundle basename="demo.Messages" var="msg" />
+<head>
+<title><ui:insert name="pageTitle">Page
Title</ui:insert></title>
+</head>
+
+<body>
+ <!-- Comment Node -->
+ <h1>Text XHtml Page</h1>
+
+</body>
+
+</html>
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 2008-10-29
11:11:17 UTC (rev 11273)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-29
11:24:07 UTC (rev 11274)
@@ -39,6 +39,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2624Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2774Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2828Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3030Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -103,6 +104,7 @@
suite.addTestSuite(JsfComponentContentTest.class);
suite.addTestSuite(JBIDE2774Test.class);
suite.addTestSuite(JBIDE2828Test.class);
+ suite.addTestSuite(JBIDE3030Test.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/JBIDE3030Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java 2008-10-29
11:24:07 UTC (rev 11274)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+* 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.jsf.vpe.jsf.test.jbide;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfTestPlugin;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * Test class for JBIDE-3030
+ *
+ * @author mareshkau
+ *
+ */
+public class JBIDE3030Test extends VpeTest {
+
+ private static Set<String> fileNames = new HashSet<String>();;
+
+ static {
+ String jbide3030Path= JsfTestPlugin.getPluginResourcePath()
+ +File.separator+"JBIDE-3030"+File.separator;//$NON-NLS-1$
+ fileNames.add(jbide3030Path+"test.jsp"); //$NON-NLS-1$
+ fileNames.add(jbide3030Path+"test.html"); //$NON-NLS-1$
+ fileNames.add(jbide3030Path+"test.xhtml"); //$NON-NLS-1$
+ }
+
+
+ public JBIDE3030Test(String name) {
+ super(name);
+ }
+
+ /**
+ *
+ * @throws Throwable
+ */
+ public void testJBIDE3030() throws Exception {
+
+ setException(null);
+
+ for (String fileName : fileNames) {
+
+ File file = new File(fileName);
+
+ assertTrue("File doesn't exists", file.isFile()); //$NON-NLS-1$
+
+ IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+
+ IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI());
+
+ IEditorPart editorPart = IDE.openEditorOnFileStore(page, fileStore );
+
+ assertNotNull(editorPart);
+
+ assertTrue("Editor Part should be instance of JSPMultipageEditor",
//$NON-NLS-1$
+ editorPart instanceof JSPMultiPageEditor);
+
+ page.closeAllEditors(false);
+
+ if(getException()!=null) {
+
+ throw new Exception(getException());
+ }
+ }
+ }
+
+}