[jsword-svn] r1238 - in trunk/incubator/org.crosswire.jsword.test.rcp: . META-INF src src/org src/org/crosswire src/org/crosswire/jsword src/org/crosswire/jsword/test src/org/crosswire/jsword/test/rcp

Apache apache at www.crosswire.org
Sun Dec 31 15:07:58 MST 2006


Author: 
Date: 2006-12-31 15:07:58 -0700 (Sun, 31 Dec 2006)
New Revision: 1238

Added:
   trunk/incubator/org.crosswire.jsword.test.rcp/.classpath
   trunk/incubator/org.crosswire.jsword.test.rcp/.project
   trunk/incubator/org.crosswire.jsword.test.rcp/META-INF/
   trunk/incubator/org.crosswire.jsword.test.rcp/META-INF/MANIFEST.MF
   trunk/incubator/org.crosswire.jsword.test.rcp/bin/
   trunk/incubator/org.crosswire.jsword.test.rcp/build.properties
   trunk/incubator/org.crosswire.jsword.test.rcp/plugin.xml
   trunk/incubator/org.crosswire.jsword.test.rcp/src/
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/Application.java
   trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/RcpPlugin.java
Log:
[PRB] - Test RCP application to run the tests in org.crosswire.jsword.test . This simplifies testing the OSGi bundles from within the Eclipse IDE, without installing an external OSGi framework implementaiton.

Added: trunk/incubator/org.crosswire.jsword.test.rcp/.classpath
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/.classpath	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/.classpath	2006-12-31 22:07:58 UTC (rev 1238)
@@ -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/incubator/org.crosswire.jsword.test.rcp/.project
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/.project	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/.project	2006-12-31 22:07:58 UTC (rev 1238)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.crosswire.jsword.test.rcp</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/incubator/org.crosswire.jsword.test.rcp/META-INF/MANIFEST.MF
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/META-INF/MANIFEST.MF	2006-12-31 22:07:58 UTC (rev 1238)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Rcp Plug-in
+Bundle-SymbolicName: org.crosswire.jsword.test.rcp; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.crosswire.jsword.test.rcp.RcpPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ com.ice.tar,
+ org.apache.commons.codec,
+ org.apache.commons.httpclient,
+ org.apache.commons.logging,
+ org.apache.commons.net,
+ org.apache.lucene,
+ org.crosswire.common,
+ org.crosswire.jsword,
+ org.crosswire.jsword.test,
+ org.jdom
+Eclipse-AutoStart: true

Added: trunk/incubator/org.crosswire.jsword.test.rcp/build.properties
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/build.properties	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/build.properties	2006-12-31 22:07:58 UTC (rev 1238)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .

Added: trunk/incubator/org.crosswire.jsword.test.rcp/plugin.xml
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/plugin.xml	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/plugin.xml	2006-12-31 22:07:58 UTC (rev 1238)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+   <extension
+         id="application"
+         point="org.eclipse.core.runtime.applications">
+      <application>
+         <run
+               class="org.crosswire.jsword.test.rcp.Application">
+         </run>
+      </application>
+   </extension>
+
+</plugin>

Added: trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/Application.java
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/Application.java	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/Application.java	2006-12-31 22:07:58 UTC (rev 1238)
@@ -0,0 +1,38 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2006
+ *     The copyright to this program is held by it's authors.
+ *
+ */
+package org.crosswire.jsword.test.rcp;
+
+import org.eclipse.core.runtime.IPlatformRunnable;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class Application implements IPlatformRunnable {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
+	 */
+	public Object run(Object args) throws Exception {
+		//Do nothing. The actions we care about are
+		//performed in the plugin class.
+		return IPlatformRunnable.EXIT_OK;
+	}
+}

Added: trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/RcpPlugin.java
===================================================================
--- trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/RcpPlugin.java	                        (rev 0)
+++ trunk/incubator/org.crosswire.jsword.test.rcp/src/org/crosswire/jsword/test/rcp/RcpPlugin.java	2006-12-31 22:07:58 UTC (rev 1238)
@@ -0,0 +1,81 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2006
+ *     The copyright to this program is held by it's authors.
+ *
+ */
+package org.crosswire.jsword.test.rcp;
+
+import org.crosswire.jsword.test.BundleTrigger;
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to activate the OSGi test bundle. 
+ * Running this plugin's application as an Eclipse application
+ * simplifies testing and debugging the OSGi services.
+ * 
+ * @author Phillip [phillip at paristano dot org]
+ */
+public class RcpPlugin extends AbstractUIPlugin {
+
+	//The shared instance.
+	private static RcpPlugin plugin;
+	
+	/**
+	 * The constructor.
+	 */
+	public RcpPlugin() {
+		plugin = this;
+	}
+
+	/**
+	 * This method is called upon plug-in activation
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		//force the OSGi test bundle to load.
+		new BundleTrigger();
+	}
+
+	/**
+	 * This method is called when the plug-in is stopped
+	 */
+	public void stop(BundleContext context) throws Exception {
+		super.stop(context);
+		plugin = null;
+	}
+
+	/**
+	 * Returns the shared instance.
+	 */
+	public static RcpPlugin getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path.
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return AbstractUIPlugin.imageDescriptorFromPlugin("org.crosswire.jsword.test.rcp", path);
+	}
+}




More information about the jsword-svn mailing list