Author: dmaliarevich
Date: 2010-11-25 07:00:24 -0500 (Thu, 25 Nov 2010)
New Revision: 26930
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TaglibXMLUnformatedDTD_JBIDE5642.java
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TaglibXMLUnformatedDTD_JBIDE5642.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
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/browse/JBIDE-7704 , TaglibXMLUnformatedDTD_JBIDE5642 was moved to
jsf.ui.tests
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-11-25
11:52:16 UTC (rev 26929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-11-25
12:00:24 UTC (rev 26930)
@@ -52,6 +52,7 @@
suite.addTestSuite(JsfJspJbide6259Test.class);
suite.addTestSuite(JsfJspJbide1704Test.class);
suite.addTestSuite(JsfJspJbide1717Test.class);
+ suite.addTestSuite(TaglibXMLUnformatedDTD_JBIDE5642.class);
suite.addTest(
new ProjectImportTestSetup(WebContentAssistProviderTest.suite(),
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TaglibXMLUnformatedDTD_JBIDE5642.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TaglibXMLUnformatedDTD_JBIDE5642.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TaglibXMLUnformatedDTD_JBIDE5642.java 2010-11-25
12:00:24 UTC (rev 26930)
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.ui.test;
+
+import java.util.StringTokenizer;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.jst.web.ui.navigator.WebProjectsNavigator;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class TaglibXMLUnformatedDTD_JBIDE5642 extends TestCase {
+
+ private static final String WEB_PROJECTS_VIEW_ID =
"org.jboss.tools.jst.web.ui.navigator.WebProjectsView"; //$NON-NLS-1$
+ private static final String PACKAGE_EXPLORER_VIEW_ID =
"org.eclipse.jdt.ui.PackageExplorer"; //$NON-NLS-1$
+ private static final String LIB_PATH = "jsfTest/Tag Libraries/";
//$NON-NLS-1$
+ private static final String LIB_NAME_I = "primefaces-i.taglib.xml -
primefaces-2.0.0.RC.jar"; //$NON-NLS-1$
+ private static final String LIB_NAME_P = "primefaces-p.taglib.xml -
primefaces-2.0.0.RC.jar"; //$NON-NLS-1$
+
+ private IViewPart webProjectsView;
+
+ public TaglibXMLUnformatedDTD_JBIDE5642(String name) {
+ super(name);
+ }
+
+ public void testTaglibXMLUnformatedDTD() throws Throwable {
+ webProjectsView = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().showView(WEB_PROJECTS_VIEW_ID);
+ assertNotNull("Web Projects view is not available", webProjectsView);
//$NON-NLS-1$
+ TestUtil.delay(2000);
+ TestUtil.waitForIdle();
+
+ WebProjectsNavigator projectsNavigator = (WebProjectsNavigator) webProjectsView;
+ TreeViewer treeViewer = projectsNavigator.getViewer();
+ assertNotNull(treeViewer);
+
+ Object testLibI = findElementByPath(LIB_PATH + LIB_NAME_I, treeViewer);
+ assertNotNull("The tag library " + LIB_NAME_I + " was not found",
//$NON-NLS-1$ //$NON-NLS-2$
+ testLibI);
+
+ Object testLibP = findElementByPath(LIB_PATH + LIB_NAME_P, treeViewer);
+ assertNotNull("The tag library " + LIB_NAME_P + " was not found",
//$NON-NLS-1$ //$NON-NLS-2$
+ testLibP);
+ }
+
+ private Object findElementByPath(String path, final TreeViewer searchTreeViwer) {
+ Tree searchTree = searchTreeViwer.getTree();
+ if (searchTree == null || path == null) {
+ return null;
+ }
+ StringTokenizer tokenizer = new StringTokenizer(path, "/", false);
//$NON-NLS-1$
+ TreeItem childItem = getItemByName(tokenizer.nextToken(), searchTree);
+ if (childItem != null) {
+ searchTreeViwer.expandToLevel(childItem.getData(), 1);
+ } else {
+ return null;
+ }
+ while (tokenizer.hasMoreTokens()) {
+ childItem = getItemByName(tokenizer.nextToken(), childItem);
+ if (childItem != null) {
+ searchTreeViwer.expandToLevel(childItem.getData(), 1);
+ } else {
+ return null;
+ }
+ }
+ return childItem.getData();
+ }
+
+ private TreeItem getItemByName(String elementName, Widget rootItem) {
+ if (rootItem == null || elementName == null) {
+ return null;
+ }
+ TreeItem[] children = null;
+ if (rootItem instanceof Tree) {
+ children = ((Tree) rootItem).getItems();
+ } else if (rootItem instanceof TreeItem) {
+ children = ((TreeItem) rootItem).getItems();
+ }
+ if (children == null) {
+ return null;
+ }
+ for (int i = 0; i < children.length; i++) {
+ if (elementName.equals(children[i].getText())) {
+ return children[i];
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .hideView(webProjectsView);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .showView(PACKAGE_EXPLORER_VIEW_ID);
+ super.tearDown();
+ }
+
+}
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 2010-11-25
11:52:16 UTC (rev 26929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2010-11-25
12:00:24 UTC (rev 26930)
@@ -92,7 +92,6 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectAllAndCut_JBIDE4853;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectWholeElement_JBIDE4713;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SourceDomUtilTest;
-import org.jboss.tools.jsf.vpe.jsf.test.jbide.TaglibXMLUnformatedDTD_JBIDE5642;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestContextPathResolution;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.TestFViewLocaleAttribute_JBIDE5218;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.UnclosedELExpressionTest;
@@ -130,7 +129,7 @@
/*
* Content tests
*/
- suite.addTestSuite(JsfComponentContentTest.class);
+ suite.addTestSuite(JsfComponentContentTest.class) ;
suite.addTestSuite(Jsf20ComponentContentTest.class);
/*
* Other tests
@@ -218,7 +217,6 @@
suite.addTestSuite(NullPointerWithStyleProperty_JBIDE5193.class);
suite.addTestSuite(TestFViewLocaleAttribute_JBIDE5218.class);
suite.addTestSuite(TestOpenOnForXhtmlFiles_JBIDE5577.class);
- suite.addTestSuite(TaglibXMLUnformatedDTD_JBIDE5642.class);
suite.addTestSuite(OpenOnInJarPackageFragment_JBIDE5682.class);
suite.addTestSuite(MessageResolutionInPreviewTabTest.class);
suite.addTestSuite(OpenOnTLDPackedInJar_JBIDE5693.class);
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TaglibXMLUnformatedDTD_JBIDE5642.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TaglibXMLUnformatedDTD_JBIDE5642.java 2010-11-25
11:52:16 UTC (rev 26929)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TaglibXMLUnformatedDTD_JBIDE5642.java 2010-11-25
12:00:24 UTC (rev 26930)
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 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.util.StringTokenizer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.jst.web.ui.navigator.WebProjectsNavigator;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
-
-/**
- *
- * @author yzhishko
- *
- */
-
-public class TaglibXMLUnformatedDTD_JBIDE5642 extends VpeTest {
-
- private static final String WEB_PROJECTS_VIEW_ID =
"org.jboss.tools.jst.web.ui.navigator.WebProjectsView"; //$NON-NLS-1$
- private static final String PACKAGE_EXPLORER_VIEW_ID =
"org.eclipse.jdt.ui.PackageExplorer"; //$NON-NLS-1$
- private static final String LIB_PATH = "jsfTest/Tag Libraries/";
//$NON-NLS-1$
- private static final String LIB_NAME_I = "primefaces-i.taglib.xml -
primefaces-2.0.0.RC.jar"; //$NON-NLS-1$
- private static final String LIB_NAME_P = "primefaces-p.taglib.xml -
primefaces-2.0.0.RC.jar"; //$NON-NLS-1$
-
- private IViewPart webProjectsView;
-
- public TaglibXMLUnformatedDTD_JBIDE5642(String name) {
- super(name);
- }
-
- public void testTaglibXMLUnformatedDTD() throws Throwable {
- webProjectsView = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getActivePage().showView(WEB_PROJECTS_VIEW_ID);
- assertNotNull("Web Projects view is not available", webProjectsView);
//$NON-NLS-1$
- TestUtil.delay(2000);
- TestUtil.waitForJobs();
-
- WebProjectsNavigator projectsNavigator = (WebProjectsNavigator) webProjectsView;
- TreeViewer treeViewer = projectsNavigator.getViewer();
- assertNotNull(treeViewer);
-
- Object testLibI = findElementByPath(LIB_PATH + LIB_NAME_I, treeViewer);
- assertNotNull("The tag library " + LIB_NAME_I + " was not found",
//$NON-NLS-1$ //$NON-NLS-2$
- testLibI);
-
- Object testLibP = findElementByPath(LIB_PATH + LIB_NAME_P, treeViewer);
- assertNotNull("The tag library " + LIB_NAME_P + " was not found",
//$NON-NLS-1$ //$NON-NLS-2$
- testLibP);
- }
-
- private Object findElementByPath(String path, final TreeViewer searchTreeViwer) {
- Tree searchTree = searchTreeViwer.getTree();
- if (searchTree == null || path == null) {
- return null;
- }
- StringTokenizer tokenizer = new StringTokenizer(path, "/", false);
//$NON-NLS-1$
- TreeItem childItem = getItemByName(tokenizer.nextToken(), searchTree);
- if (childItem != null) {
- searchTreeViwer.expandToLevel(childItem.getData(), 1);
- } else {
- return null;
- }
- while (tokenizer.hasMoreTokens()) {
- childItem = getItemByName(tokenizer.nextToken(), childItem);
- if (childItem != null) {
- searchTreeViwer.expandToLevel(childItem.getData(), 1);
- } else {
- return null;
- }
- }
- return childItem.getData();
- }
-
- private TreeItem getItemByName(String elementName, Widget rootItem) {
- if (rootItem == null || elementName == null) {
- return null;
- }
- TreeItem[] children = null;
- if (rootItem instanceof Tree) {
- children = ((Tree) rootItem).getItems();
- } else if (rootItem instanceof TreeItem) {
- children = ((TreeItem) rootItem).getItems();
- }
- if (children == null) {
- return null;
- }
- for (int i = 0; i < children.length; i++) {
- if (elementName.equals(children[i].getText())) {
- return children[i];
- }
- }
- return null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .hideView(webProjectsView);
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .showView(PACKAGE_EXPLORER_VIEW_ID);
- super.tearDown();
- }
-
-}