From 434838d201764c72889b2cd524fefe4dd76da3f8 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Wed, 3 Jun 2009 11:19:21 +0000 Subject: [PATCH] Use new version of Osgi plugin git-svn-id: https://svn.argeo.org/slc/trunk@2447 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../org.argeo.slc.it.webapp/pom.xml | 54 ++++++++++++++++-- .../org/argeo/slc/it/webapp/AgentTest.java | 22 ++++++++ .../slc/it/webapp/StartStopServerTest.java | 55 ------------------- .../slc/it/webapp/applicationContext.xml | 17 ++++++ 4 files changed, 87 insertions(+), 61 deletions(-) create mode 100644 integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java delete mode 100644 integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/StartStopServerTest.java create mode 100644 integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml diff --git a/integration-tests/org.argeo.slc.it.webapp/pom.xml b/integration-tests/org.argeo.slc.it.webapp/pom.xml index c1ba1a27a..4ee9f5731 100644 --- a/integration-tests/org.argeo.slc.it.webapp/pom.xml +++ b/integration-tests/org.argeo.slc.it.webapp/pom.xml @@ -12,21 +12,58 @@ Argeo SLC Web Application Integration Tests + - org.apache.maven.plugins - maven-dependency-plugin + org.argeo.slc.maven + maven-argeo-osgi-plugin + ${version.maven-argeo-osgi} - copy-dependencies + equinox-start pre-integration-test - copy-dependencies + equinox - true - true + false + 5000 + + -clean + + + ${basedir}/../../demo/site;in=*;ex=target + + org.argeo.dep.osgi.catalina.start, + org.springframework.osgi.extender, + org.springframework.osgi.web.extender, + org.springframework.osgi.samples.simplewebapp, + org.argeo.slc.server.activemq, + org.argeo.slc.server.hsqldb, + org.argeo.slc.server.hibernate, + org.argeo.slc.server.services, + org.argeo.slc.server.jms, + org.argeo.slc.webapp, + org.argeo.slc.ria + + + + equinox-shutdown + post-integration-test + + equinox-shutdown + + @@ -58,6 +95,11 @@ ${project.version} pom + + org.argeo.slc.runtime + org.argeo.slc.support.equinox + + diff --git a/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java b/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java new file mode 100644 index 000000000..09f368e4f --- /dev/null +++ b/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java @@ -0,0 +1,22 @@ +package org.argeo.slc.it.webapp; + +import java.net.InetAddress; + +import org.argeo.slc.msg.ObjectList; +import org.argeo.slc.runtime.SlcAgentDescriptor; +import org.argeo.slc.server.client.SlcServerHttpClient; +import org.argeo.slc.unit.AbstractSpringTestCase; + +public class AgentTest extends AbstractSpringTestCase { + public void testListAgents() throws Exception { + SlcServerHttpClient httpClient = getBean(SlcServerHttpClient.class); + ObjectList objectList = httpClient.callService("listAgents.service", + null); + assertEquals(0, objectList.getObjects().size()); +// SlcAgentDescriptor slcAgentDescriptor = (SlcAgentDescriptor) objectList +// .getObjects().get(0); +// assertEquals(InetAddress.getLocalHost().getHostName(), +// slcAgentDescriptor.getHost()); + } + +} diff --git a/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/StartStopServerTest.java b/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/StartStopServerTest.java deleted file mode 100644 index 84ac24828..000000000 --- a/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/StartStopServerTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.argeo.slc.it.webapp; - -import java.util.Properties; - -import org.argeo.slc.osgi.test.AbstractOsgiRuntimeTest; -import org.argeo.slc.osgiboot.OsgiBoot; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.springframework.osgi.test.platform.EquinoxPlatform; -import org.springframework.osgi.test.platform.OsgiPlatform; -import org.springframework.osgi.util.OsgiStringUtils; - -public class StartStopServerTest extends AbstractOsgiRuntimeTest { - public void testStartStop() throws Exception { - BundleContext bundleContext = osgiPlatform.getBundleContext(); - Bundle[] bundles = bundleContext.getBundles(); - for (int i = 0; i < bundles.length; i++) { - System.out - .println(OsgiStringUtils.nullSafeSymbolicName(bundles[i])); - } - - Thread.sleep(5 * 1000); - - } - - protected void postStart() throws Exception { - String classpath = System.getProperty("java.class.path"); - System.out.println("Classpath=" + classpath); - osgiBoot.installUrls(osgiBoot.getLocationsUrls( - OsgiBoot.DEFAULT_BASE_URL, classpath)); - osgiBoot.installUrls(osgiBoot.getBundlesUrls(OsgiBoot.DEFAULT_BASE_URL, - "../../demo/site;in=*;ex=target")); - osgiBoot.installUrls(osgiBoot.getBundlesUrls(OsgiBoot.DEFAULT_BASE_URL, - "target/dependency;in=*.jar")); - - String bundlesToStart = "org.argeo.dep.osgi.catalina.start,org.springframework.osgi.extender,org.springframework.osgi.web.extender,org.springframework.osgi.samples.simplewebapp,org.argeo.slc.server.activemq,org.argeo.slc.server.hsqldb,org.argeo.slc.server.hibernate,org.argeo.slc.server.services,org.argeo.slc.server.jms,org.argeo.slc.webapp,org.argeo.slc.ria"; - osgiBoot.startBundles(bundlesToStart); - } - - @Override - protected OsgiPlatform createOsgiPlatform() { - - return new EquinoxPlatform() { - - @Override - public Properties getConfigurationProperties() { - Properties props = super.getConfigurationProperties(); - props.put("osgi.console", ""); - return props; - } - - }; - } - -} diff --git a/integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml b/integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml new file mode 100644 index 000000000..8c1dcb7f6 --- /dev/null +++ b/integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml @@ -0,0 +1,17 @@ + + + + + + + + + + \ No newline at end of file -- 2.39.2