diff options
author | slewis | 2011-01-15 02:53:57 +0000 |
---|---|---|
committer | slewis | 2011-01-15 02:53:57 +0000 |
commit | ec9cb7618d514b0a6a4bc0d895ca622cf3305696 (patch) | |
tree | bbab89f7165e9b41b3cae52bd1fe977982ea850c /tests | |
parent | e1a95f36c362194b503722d9b0ff1b92bb4cab17 (diff) | |
download | org.eclipse.ecf-ec9cb7618d514b0a6a4bc0d895ca622cf3305696.tar.gz org.eclipse.ecf-ec9cb7618d514b0a6a4bc0d895ca622cf3305696.tar.xz org.eclipse.ecf-ec9cb7618d514b0a6a4bc0d895ca622cf3305696.zip |
Fixes for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=334448
Diffstat (limited to 'tests')
5 files changed, 3 insertions, 218 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.generic/.gitignore b/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.generic/.gitignore index e660fd93d..f3ffc3562 100644 --- a/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.generic/.gitignore +++ b/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.generic/.gitignore @@ -1 +1,2 @@ bin/ +/slewis.org.eclipse.ecf.tests.osgi.services.distribution.generic.launch diff --git a/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.r-osgi/.gitignore b/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.r-osgi/.gitignore index e660fd93d..0e2cc9a1e 100644 --- a/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.r-osgi/.gitignore +++ b/tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.r-osgi/.gitignore @@ -1 +1,2 @@ bin/ +/slewis.org.eclipse.ecf.tests.osgi.services.distribution.r-osgi.launch diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/.gitignore b/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/.gitignore index ba077a403..b5bfb2dc9 100755..100644 --- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/.gitignore +++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/.gitignore @@ -1 +1,2 @@ bin +/slewis.org.eclipse.ecf.tests.remoteservice.generic.host.launch diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/src/org/eclipse/ecf/tests/remoteservice/generic/ServiceTrackerTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/src/org/eclipse/ecf/tests/remoteservice/generic/ServiceTrackerTest.java deleted file mode 100755 index 565d3fa1a..000000000 --- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/src/org/eclipse/ecf/tests/remoteservice/generic/ServiceTrackerTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2008 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.remoteservice.generic; - -import java.util.Dictionary; -import java.util.Hashtable; - -import org.eclipse.ecf.remoteservice.Constants; -import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter; -import org.eclipse.ecf.tests.remoteservice.AbstractServiceTrackerTest; -import org.eclipse.ecf.tests.remoteservice.Activator; -import org.eclipse.ecf.tests.remoteservice.IConcatService; -import org.osgi.util.tracker.ServiceTracker; - -/** - * - */ -public class ServiceTrackerTest extends AbstractServiceTrackerTest { - - /* (non-Javadoc) - * @see org.eclipse.ecf.tests.remoteservice.AbstractRemoteServiceTest#getClientContainerName() - */ - protected String getClientContainerName() { - return Generic.CONSUMER_CONTAINER_TYPE; - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - setClientCount(2); - createServerAndClients(); - connectClients(); - setupRemoteServiceAdapters(); - addRemoteServiceListeners(); - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception { - cleanUpServerAndClients(); - super.tearDown(); - } - - public void testServiceTracker() throws Exception { - final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters(); - // client [0]/adapter[0] is the service 'server' - // client [1]/adapter[1] is the service target (client) - final Dictionary props = new Hashtable(); - props.put(Constants.SERVICE_REGISTRATION_TARGETS, getClients()[1].getConnectedID()); - props.put(Constants.AUTOREGISTER_REMOTE_PROXY, "true"); - // Register - adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, createService(), props); - // Give some time for propagation - sleep(3000); - - final ServiceTracker st = new ServiceTracker(Activator.getDefault().getContext(), IConcatService.class.getName(), null); - assertNotNull(st); - st.open(); - final IConcatService concatService = (IConcatService) st.getService(); - assertNotNull(concatService); - System.out.println("proxy call start"); - final String result = concatService.concat("OSGi ", "is cool"); - System.out.println("proxy call end. result=" + result); - sleep(3000); - st.close(); - sleep(3000); - } - - /* - public void testRemoteServiceWithServiceTracker() throws Exception { - final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters(); - // client [0]/adapter[0] is the service 'server' - // client [1]/adapter[1] is the service target (client) - final Dictionary props = new Hashtable(); - props.put(Constants.SERVICE_REGISTRATION_TARGETS, getClients()[1].getConnectedID()); - props.put(Constants.AUTOREGISTER_REMOTE_PROXY, "true"); - // Register - adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, createService(), props); - // Give some time for propagation - sleep(3000); - - final ServiceTracker st = new ServiceTracker(Activator.getDefault().getContext(), IConcatService.class.getName(), null); - assertNotNull(st); - st.open(); - final ServiceReference ref = st.getServiceReference(); - assertNotNull(ref); - final IRemoteService remoteService = (IRemoteService) ref.getProperty(Constants.REMOTE_SERVICE); - assertNotNull(remoteService); - // Call it asynch with listener - remoteService.callAsynch(createRemoteConcat("OSGi ", "Sucks (sic)"), createRemoteCallListener()); - - sleep(3000); - st.close(); - } - */ -} diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/src/org/eclipse/ecf/tests/remoteservice/generic/TransparentProxyTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/src/org/eclipse/ecf/tests/remoteservice/generic/TransparentProxyTest.java deleted file mode 100755 index 247199721..000000000 --- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.generic/src/org/eclipse/ecf/tests/remoteservice/generic/TransparentProxyTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 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.remoteservice.generic; - -import java.util.Dictionary; -import java.util.Hashtable; - -import org.eclipse.ecf.remoteservice.Constants; -import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter; -import org.eclipse.ecf.tests.remoteservice.AbstractRemoteServiceTest; -import org.eclipse.ecf.tests.remoteservice.Activator; -import org.eclipse.ecf.tests.remoteservice.IConcatService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; - -public class TransparentProxyTest extends AbstractRemoteServiceTest { - - /* (non-Javadoc) - * @see org.eclipse.ecf.tests.remoteservice.AbstractRemoteServiceTest#getClientContainerName() - */ - protected String getClientContainerName() { - return Generic.CONSUMER_CONTAINER_TYPE; - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - setClientCount(2); - createServerAndClients(); - connectClients(); - setupRemoteServiceAdapters(); - addRemoteServiceListeners(); - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception { - cleanUpServerAndClients(); - super.tearDown(); - } - - public void testTransparentProxy() throws Exception { - final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters(); - // client [0]/adapter[0] is the service 'server' - // client [1]/adapter[1] is the service target (client) - final Dictionary props = new Hashtable(); - props.put(Constants.SERVICE_REGISTRATION_TARGETS, getClients()[1].getConnectedID()); - props.put(Constants.AUTOREGISTER_REMOTE_PROXY, "true"); - // Register - adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, createService(), props); - // Give some time for propagation - sleep(2000); - - final BundleContext bc = Activator.getDefault().getContext(); - assertNotNull(bc); - final ServiceReference ref = bc.getServiceReference(IConcatService.class.getName()); - assertNotNull(ref); - final IConcatService concatService = (IConcatService) bc.getService(ref); - assertNotNull(concatService); - System.out.println("proxy call start"); - final String result = concatService.concat("OSGi ", "is cool"); - System.out.println("proxy call end. result=" + result); - bc.ungetService(ref); - } - - /* - public void testIRemoteService() throws Exception { - final IRemoteServiceContainerAdapter[] adapters = getRemoteServiceAdapters(); - // client [0]/adapter[0] is the service 'server' - // client [1]/adapter[1] is the service target (client) - final Dictionary props = new Hashtable(); - props.put(Constants.SERVICE_REGISTRATION_TARGETS, getClients()[1].getConnectedID()); - props.put(Constants.AUTOREGISTER_REMOTE_PROXY, "true"); - // Register - adapters[0].registerRemoteService(new String[] {IConcatService.class.getName()}, createService(), props); - // Give some time for propagation - sleep(3000); - - final BundleContext bc = Activator.getDefault().getContext(); - assertNotNull(bc); - final ServiceReference ref = bc.getServiceReference(IConcatService.class.getName()); - assertNotNull(ref); - final IRemoteService remoteService = (IRemoteService) ref.getProperty(Constants.REMOTE_SERVICE); - assertNotNull(remoteService); - // Call it asynch with listener - remoteService.callAsynch(createRemoteConcat("OSGi ", "Sucks (sic)"), createRemoteCallListener()); - sleep(3000); - } - */ -} |