Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2010-06-12 03:09:28 +0000
committerslewis2010-06-12 03:09:28 +0000
commit47e497d97380c26270a932e7b3a78a899f129a59 (patch)
tree3a3ea031f426a57068d4bfb39f0c884eaaf0b374
parent6509b8e195d3bffc10325a18db577ed05b81cc89 (diff)
downloadorg.eclipse.ecf-47e497d97380c26270a932e7b3a78a899f129a59.tar.gz
org.eclipse.ecf-47e497d97380c26270a932e7b3a78a899f129a59.tar.xz
org.eclipse.ecf-47e497d97380c26270a932e7b3a78a899f129a59.zip
Initial checkin of local remote service provider tests
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/.classpath7
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/.project28
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/META-INF/MANIFEST.MF17
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/build.properties5
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/bundle.properties10
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/internal/tests/provider/local/Activator.java30
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/Local.java16
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/LocalRemoteServiceTest.java66
10 files changed, 191 insertions, 0 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/.classpath b/tests/bundles/org.eclipse.ecf.tests.provider.local/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/.project b/tests/bundles/org.eclipse.ecf.tests.provider.local/.project
new file mode 100644
index 000000000..520d17586
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ecf.tests.provider.local</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>
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.jdt.core.prefs b/tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..d101ddfc5
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Jun 11 13:36:53 PDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.pde.core.prefs b/tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..2d86e8407
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Fri Jun 11 13:36:53 PDT 2010
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/META-INF/MANIFEST.MF b/tests/bundles/org.eclipse.ecf.tests.provider.local/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..fc303b5f4
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Local
+Bundle-SymbolicName: org.eclipse.ecf.tests.provider.local
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.ecf.internal.tests.provider.local.Activator
+Bundle-Vendor: Eclipse.org - ECF
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.ecf.remoteservice,
+ org.osgi.framework;version="1.3.0"
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.junit;bundle-version="4.8.1",
+ org.eclipse.equinox.common;bundle-version="3.6.0",
+ org.eclipse.ecf.tests;bundle-version="2.1.0",
+ org.eclipse.ecf.tests.remoteservice;bundle-version="2.0.0",
+ org.eclipse.ecf;bundle-version="3.1.0"
+Bundle-Localization: bundle
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/build.properties b/tests/bundles/org.eclipse.ecf.tests.provider.local/build.properties
new file mode 100644
index 000000000..a4b8d79c1
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ bundle.properties
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/bundle.properties b/tests/bundles/org.eclipse.ecf.tests.provider.local/bundle.properties
new file mode 100644
index 000000000..cee2df09e
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/bundle.properties
@@ -0,0 +1,10 @@
+############################################################################
+# Copyright (c) 2010 Composent Inc., IBM and others.
+# All rights reserved. This program and the accompanying materials
+# are 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
+#
+############################################################################
+plugin.name=ECF Local Remote Service Provider Test
+plugin.provider=Eclipse.org - ECF
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/internal/tests/provider/local/Activator.java b/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/internal/tests/provider/local/Activator.java
new file mode 100644
index 000000000..809890904
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/internal/tests/provider/local/Activator.java
@@ -0,0 +1,30 @@
+package org.eclipse.ecf.internal.tests.provider.local;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/Local.java b/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/Local.java
new file mode 100644
index 000000000..2f3c2f8b7
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/Local.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+* Copyright (c) 2010 Composent, Inc. and others. All rights reserved. This
+* program and the accompanying materials are 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:
+* Composent, Inc. - initial API and implementation
+******************************************************************************/
+package org.eclipse.ecf.tests.provider.local;
+
+public interface Local {
+
+ String CONTAINER_FACTORY_NAME = "ecf.localremoteservice";
+
+}
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/LocalRemoteServiceTest.java b/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/LocalRemoteServiceTest.java
new file mode 100644
index 000000000..9e8d70044
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.local/src/org/eclipse/ecf/tests/provider/local/LocalRemoteServiceTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+* Copyright (c) 2010 Composent, Inc. and others. All rights reserved. This
+* program and the accompanying materials are 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:
+* Composent, Inc. - initial API and implementation
+******************************************************************************/
+package org.eclipse.ecf.tests.provider.local;
+
+import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.core.identity.IDFactory;
+import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;
+import org.eclipse.ecf.remoteservice.IRemoteServiceID;
+import org.eclipse.ecf.tests.remoteservice.AbstractRemoteServiceTest;
+
+public class LocalRemoteServiceTest extends AbstractRemoteServiceTest {
+
+ protected String getClientContainerName() {
+ return Local.CONTAINER_FACTORY_NAME;
+ }
+
+ protected String getServerContainerName() {
+ return Local.CONTAINER_FACTORY_NAME;
+ }
+
+ protected ID createServerID() throws Exception {
+ return IDFactory.getDefault().createGUID();
+ }
+
+ protected void setupRemoteServiceAdapters() throws Exception {
+ for (int i = 0; i < 2; i++) {
+ adapters[i] = (IRemoteServiceContainerAdapter) server
+ .getAdapter(IRemoteServiceContainerAdapter.class);
+ }
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ setClientCount(1);
+ createServerAndClients();
+ adapters = new IRemoteServiceContainerAdapter[2];
+ ids = new IRemoteServiceID[2];
+ setupRemoteServiceAdapters();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ if (server != null) {
+ serverID = null;
+ server.dispose();
+ server = null;
+ }
+ }
+
+ protected IContainer createServer() throws Exception {
+ server = getContainerFactory().createContainer(Local.CONTAINER_FACTORY_NAME);
+ return server;
+ }
+
+ protected IContainer createClient(int index) throws Exception {
+ return server;
+ }
+}

Back to the top