<name>Argeo SLC Web Application Integration Tests</name>
<build>
<plugins>
+ <!--
+ <plugin> <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId> <executions>
+ <execution> <id>copy-dependencies</id>
+ <phase>pre-integration-test</phase> <goals>
+ <goal>copy-dependencies</goal> </goals> <configuration>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots> </configuration>
+ </execution> </executions> </plugin>
+ -->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
+ <groupId>org.argeo.slc.maven</groupId>
+ <artifactId>maven-argeo-osgi-plugin</artifactId>
+ <version>${version.maven-argeo-osgi}</version>
<executions>
<execution>
- <id>copy-dependencies</id>
+ <id>equinox-start</id>
<phase>pre-integration-test</phase>
<goals>
- <goal>copy-dependencies</goal>
+ <goal>equinox</goal>
</goals>
<configuration>
- <overWriteReleases>true</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
+ <wait>false</wait>
+ <pause>5000</pause>
+ <argsToAppend>
+ <arg>-clean</arg>
+ </argsToAppend>
+ <systemProperties>
+ <slc.osgi.bundles>${basedir}/../../demo/site;in=*;ex=target</slc.osgi.bundles>
+ <slc.osgi.start>
+ 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
+ </slc.osgi.start>
+ </systemProperties>
</configuration>
</execution>
+ <execution>
+ <id>equinox-shutdown</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>equinox-shutdown</goal>
+ </goals>
+ </execution>
</executions>
</plugin>
<plugin>
<version>${project.version}</version>
<type>pom</type>
</dependency>
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.support.equinox</artifactId>
+ </dependency>
+
<!-- TEST -->
<dependency>
--- /dev/null
+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());
+ }
+
+}
+++ /dev/null
-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;
- }
-
- };
- }
-
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
+ default-lazy-init="true">
+
+ <import resource="classpath:org/argeo/slc/castor/spring.xml" />
+
+ <!-- Http client -->
+ <bean id="slcDefault.serverHttpClient"
+ class="org.argeo.slc.server.client.SlcServerHttpClient" lazy-init="true">
+ <property name="unmarshaller" ref="slcDefault.castor.marshaller" />
+ </bean>
+</beans>
\ No newline at end of file