diff options
author | Pavel Samolisov | 2010-10-14 16:32:40 +0000 |
---|---|---|
committer | Pavel Samolisov | 2010-10-14 16:32:40 +0000 |
commit | c821ec635824e9b4d09f79d898450ffda93fc7a0 (patch) | |
tree | 0385e9a534a91a42ccbd9287580a33035e327882 /tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc | |
parent | d65578e161a2d84d5b6b527683811a58d571bc7a (diff) | |
download | org.eclipse.ecf-c821ec635824e9b4d09f79d898450ffda93fc7a0.tar.gz org.eclipse.ecf-c821ec635824e9b4d09f79d898450ffda93fc7a0.tar.xz org.eclipse.ecf-c821ec635824e9b4d09f79d898450ffda93fc7a0.zip |
Copy of o.e.e.tests.remoteservice.rpc
Signed-off-by: Pavel Samolisov <samolisov@gmail.com>
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc')
8 files changed, 144 insertions, 0 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.classpath b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.classpath new file mode 100644 index 000000000..64c5e31b7 --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.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.remoteservice.rpc/.gitignore b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.gitignore new file mode 100644 index 000000000..e660fd93d --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.project b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.project new file mode 100644 index 000000000..aa17c40e5 --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.ecf.tests.remoteservice.rpc</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.remoteservice.rpc/.settings/org.eclipse.jdt.core.prefs b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..122a97bf4 --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Mon Oct 11 08:19:28 MSD 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.remoteservice.rpc/META-INF/MANIFEST.MF b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF new file mode 100644 index 000000000..0917e3bc0 --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %plugin.name +Bundle-SymbolicName: org.eclipse.ecf.tests.remoteservice.rpc +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.ecf.internal.tests.remoteservice.rpc.Activator +Bundle-Vendor: %plugin.provider +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ecf;bundle-version="3.1.0", + org.eclipse.ecf.tests;bundle-version="2.1.0", + org.eclipse.ecf.tests.remoteservice;bundle-version="2.0.0", + org.junit;bundle-version="3.8.2", + org.eclipse.ecf.remoteservice.rpc;bundle-version="1.0.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/build.properties b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/build.properties new file mode 100644 index 000000000..34d2e4d2d --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java new file mode 100644 index 000000000..f8c918d78 --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java @@ -0,0 +1,30 @@ +package org.eclipse.ecf.internal.tests.remoteservice.rpc; + +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.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RPCContainerInstantiatorTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RPCContainerInstantiatorTest.java new file mode 100644 index 000000000..fff084556 --- /dev/null +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RPCContainerInstantiatorTest.java @@ -0,0 +1,51 @@ +package org.eclipse.ecf.tests.remoteservice.rpc; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.eclipse.ecf.core.ContainerTypeDescription; +import org.eclipse.ecf.core.IContainerFactory; +import org.eclipse.ecf.tests.ECFAbstractTestCase; + +public class RPCContainerInstantiatorTest extends ECFAbstractTestCase { + + private static final String RPC_CONTAINER_TYPE = "ecf.xmlrpc.client"; + + private IContainerFactory containerFactory; + + private ContainerTypeDescription description; + + protected void setUp() throws Exception { + containerFactory = getContainerFactory(); + description = containerFactory.getDescriptionByName(RPC_CONTAINER_TYPE); + } + + public void testSupportedParameterTypes() { + Class<?>[][] types = description.getSupportedParameterTypes(); + boolean foundString = false; + boolean foundInteger = false; + boolean foundBoolean = false; + boolean foundDouble = false; + boolean foundDate = false; + boolean foundByteArray = false; + boolean foundObjectArray = false; + boolean foundList = false; + boolean foundMap = false; + for(int i=0; i < types.length; i++) { + for(int j=0; j < types[i].length; j++) { + if (types[i][j].equals(String.class)) foundString = true; + if (types[i][j].equals(Integer.class)) foundInteger = true; + if (types[i][j].equals(Boolean.class)) foundBoolean = true; + if (types[i][j].equals(Double.class)) foundDouble = true; + if (types[i][j].equals(Date.class)) foundDate = true; + if (types[i][j].equals(byte[].class)) foundByteArray = true; + if (types[i][j].equals(Object[].class)) foundObjectArray = true; + if (types[i][j].equals(List.class)) foundList = true; + if (types[i][j].equals(Map.class)) foundMap = true; + } + } + assertTrue(foundString && foundInteger && foundBoolean && foundDouble && foundDate && foundByteArray + && foundObjectArray && foundList && foundMap); + } +} |