Author: Grid.Qian
Date: 2008-06-13 04:36:53 -0400 (Fri, 13 Jun 2008)
New Revision: 8755
Added:
trunk/ws/tests/org.jboss.tools.ws.core.test/.classpath
trunk/ws/tests/org.jboss.tools.ws.core.test/.project
trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/
trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties
trunk/ws/tests/org.jboss.tools.ws.core.test/src/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/Activator.java
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/classpath/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/classpath/JbossWSRuntimeManagerTest.java
Log:
JBIDE-2323: add some tests
Added: trunk/ws/tests/org.jboss.tools.ws.core.test/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/.classpath (rev
0)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/.classpath 2008-06-13 08:36:53 UTC (rev
8755)
@@ -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/ws/tests/org.jboss.tools.ws.core.test/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/.project (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/.project 2008-06-13 08:36:53 UTC (rev
8755)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.ws.core.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/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2008-06-13 08:36:53
UTC (rev 8755)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Plug-in
+Bundle-SymbolicName: org.jboss.tools.ws.core.test
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.ws.core.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit,
+ org.jboss.tools.tests,
+ org.jboss.tools.ws.core
+Eclipse-LazyStart: true
Added: trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties
(rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties 2008-06-13 08:36:53 UTC
(rev 8755)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added:
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/Activator.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/Activator.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/Activator.java 2008-06-13
08:36:53 UTC (rev 8755)
@@ -0,0 +1,50 @@
+package org.jboss.tools.ws.core.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.ws.core.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added:
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/classpath/JbossWSRuntimeManagerTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/classpath/JbossWSRuntimeManagerTest.java
(rev 0)
+++
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/classpath/JbossWSRuntimeManagerTest.java 2008-06-13
08:36:53 UTC (rev 8755)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.core.test.classpath;
+
+import org.jboss.tools.ws.core.classpath.JbossWSRuntime;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntimeManager;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Grid Qian
+ */
+public class JbossWSRuntimeManagerTest extends TestCase {
+
+ JbossWSRuntimeManager manager;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ manager = JbossWSRuntimeManager.getInstance();
+ assertNotNull("Cannot obtainJbossWSRuntimeManager instance", manager);
+ if (manager.findRuntimeByName("JBossWS Runtime 4.2") != null)
+ return;
+ manager.addRuntime("JBossWS Runtime 4.2", "runtimelocation",
"4.2",
+ true);
+ }
+
+ public void testGetRuntimes() {
+ JbossWSRuntime[] rtms = manager.getRuntimes();
+ assertTrue("JbossWS runtime 'JBossWS Runtime 4.2' is not created",
+ rtms.length == 1);
+ assertTrue("JbossWS runtime 'JBossWS Runtime 4.2' is not created",
+ rtms[0].getName().equals("JBossWS Runtime 4.2"));
+ }
+
+ public void testFindRuntimeByName() {
+ JbossWSRuntime srt = manager.findRuntimeByName("JBossWS Runtime 4.2");
+ assertNotNull("Cannot find runtime 'JBossWS Runtime 4.2'", srt);
+ }
+
+ public void testGetDefaultRuntime() {
+ assertNotNull("Cannot obtain default runtime 'JBossWS Runtime 4.2'",
+ manager.getDefaultRuntime());
+ }
+}