Author: dgolovin
Date: 2007-06-29 15:35:07 -0400 (Fri, 29 Jun 2007)
New Revision: 2222
Added:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.classpath
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.project
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebViewsTest.java
Log:
http://jira.jboss.org/jira/browse/EXIN-13
Added: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.classpath
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.classpath 2007-06-29 19:35:07 UTC
(rev 2222)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.project (rev
0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.project 2007-06-29 19:35:07 UTC (rev
2222)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.web.ui.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF 2007-06-29
19:35:07 UTC (rev 2222)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WEB UI Test Plug-in
+Bundle-SymbolicName: org.jboss.tools.jst.web.ui.test
+Bundle-Version: 1.0.0
+Bundle-Vendor: Red Hat, Inc.
+Require-Bundle: org.jboss.tools.jst.web.ui,
+ org.junit,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.common.model.ui
Added: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/build.properties
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/build.properties 2007-06-29 19:35:07
UTC (rev 2222)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2007-06-29
19:35:07 UTC (rev 2222)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * @author eskimo
+ *
+ */
+public class JstWebUiAllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JstWebUiAllTests.class.getName());
+ suite.addTestSuite(WebViewsTest.class);
+ return suite;
+ }
+}
Added:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebViewsTest.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebViewsTest.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebViewsTest.java 2007-06-29
19:35:07 UTC (rev 2222)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.jboss.tools.common.model.ui.views.palette.PaletteViewPart;
+import org.jboss.tools.jst.web.ui.BrowserView;
+import org.jboss.tools.jst.web.ui.RedHat4WebPerspectiveFactory;
+import org.jboss.tools.jst.web.ui.navigator.WebProjectsNavigator;
+
+/**
+ * @author eskimo
+ *
+ */
+public class WebViewsTest extends TestCase {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void setUp() throws Exception {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ try {
+ workbench.showPerspective(RedHat4WebPerspectiveFactory.PERSPECTIVE_ID,workbench.getActiveWorkbenchWindow());
+ } catch (WorkbenchException e) {
+ fail("Cannot load perspective '"
+RedHat4WebPerspectiveFactory.PERSPECTIVE_ID + "'");
+ }
+ }
+
+ /**
+ *
+ */
+ public void testRhdsPerspectiveIsDefined() {
+ IPerspectiveDescriptor perspective = getRhdsPerspective();
+ assertNotNull("Cannot find perspective '"
+RedHat4WebPerspectiveFactory.PERSPECTIVE_ID + "'",perspective);
+ }
+
+
+ public void testPerspectiveIsShowed() {
+ IPerspectiveDescriptor perspective = getRhdsPerspective();
+ IWorkbench workbench =PlatformUI.getWorkbench();
+ try {
+ workbench.showPerspective(RedHat4WebPerspectiveFactory.PERSPECTIVE_ID,
workbench.getActiveWorkbenchWindow());
+ } catch (WorkbenchException e) {
+ fail("Cannot show perspective '"
+RedHat4WebPerspectiveFactory.PERSPECTIVE_ID + "'");
+ }
+ }
+ /**
+ *
+ */
+ public void testBrowserViewIsShowed() {
+ IViewPart browserView = findView(BrowserView.ID);
+ assertNotNull("Browser View hasn't been loaded",browserView);
+ }
+
+ public void testWebProjectsViewIsShowed() {
+ IViewPart webProjectsView = findView(WebProjectsNavigator.VIEW_ID);
+ assertNotNull("Web project Navigator hasn't been
loaded",webProjectsView);
+ }
+
+ public void testPaletteViewIsShowed() {
+ IViewPart paletteView = findView(PaletteViewPart.VIEW_ID);
+ assertNotNull("Palette View hasn't been loaded",paletteView);
+ }
+
+ // Helper methods
+
+ private IViewPart findView(String id) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ return workbench.getActiveWorkbenchWindow().getActivePage().findView(id);
+ }
+
+ /*
+ *
+ */
+ private IPerspectiveDescriptor getRhdsPerspective() {
+ IPerspectiveRegistry reg = getPerspectiveRegistry();
+ return reg.findPerspectiveWithId(RedHat4WebPerspectiveFactory.PERSPECTIVE_ID);
+ }
+
+ /*
+ *
+ */
+ private IPerspectiveRegistry getPerspectiveRegistry() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ return workbench.getPerspectiveRegistry();
+ }
+}