Commit a66cc00e authored by Philippe Merle's avatar Philippe Merle

* Added dependency to FraSCAti Web Service binding.

* Exposed Nuxeo services as Web Services.
* Added the Nuxeo Reload Component.
* Allow to sleep some minutes before terminating JUnit tests.
  During these minutes, the user can access the Web services of Nuxeo.
  Type 'mvn -Dsleep=1' to sleep 1 minutes.
parent 135ff1b9
......@@ -42,4 +42,103 @@
<name>OW2 FraSCAti: Nuxeo as SCA Components</name>
<artifactId>nuxeo-as-sca-components</artifactId>
<!-- ============ -->
<!-- Properties -->
<!-- ============ -->
<properties>
<sleep>0</sleep>
</properties>
<!-- ============ -->
<!-- Build -->
<!-- ============ -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<skipTests>false</skipTests>
<useSystemClassLoader>false</useSystemClassLoader>
<systemPropertyVariables>
<org.ow2.frascati.bootstrap>${org.ow2.frascati.bootstrap}</org.ow2.frascati.bootstrap>
<java.util.logging.config.file>${java.util.logging.config.file}</java.util.logging.config.file>
<sleep>${sleep}</sleep>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<!-- ============ -->
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<!-- OW2 FraSCAti SCA Binding Web Service Module. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-binding-ws</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Nuxeo Runtime Reload Component. -->
<dependency>
<groupId>org.nuxeo.runtime</groupId>
<artifactId>nuxeo-runtime-reload</artifactId>
<version>${nuxeo.version}</version>
</dependency>
</dependencies>
<!-- ============ -->
<!-- Repositories -->
<!-- ============ -->
<repositories>
<repository>
<id>frascati-repo</id>
<name>FraSCAti Nexus repository</name>
<url>https://frascati-repo.inria.fr/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>nuxeo-repo</id>
<name>Nuxeo Nexus repository</name>
<url>https://maven-us.nuxeo.org/nexus/content/repositories/public-releases</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<!-- ============ -->
<!-- Profiles -->
<!-- ============ -->
<profiles>
<profile>
<id>explorer</id>
<dependencies>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-explorer-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<properties>
<org.ow2.frascati.bootstrap>org.ow2.frascati.bootstrap.FraSCAtiFractal</org.ow2.frascati.bootstrap>
</properties>
</profile>
</profiles>
</project>
......@@ -29,6 +29,7 @@
name="Nuxeo">
<service name="LoginService" promote="LoginComponent/LoginService"/>
<service name="ReloadService" promote="ReloadComponent/ReloadService"/>
<component name="org-nuxeo-runtime-started">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.started" />
......@@ -69,6 +70,15 @@
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.LoginComponent" />
<service name="LoginService">
<interface.java interface="org.nuxeo.runtime.api.login.LoginService"/>
<binding.ws uri="/Nuxeo/LoginService"/>
</service>
</component>
<component name="ReloadComponent">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.reload" />
<service name="ReloadService">
<interface.java interface="org.nuxeo.runtime.reload.ReloadService"/>
<binding.ws uri="/Nuxeo/ReloadService"/>
</service>
</component>
......
......@@ -26,11 +26,19 @@
*/
package org.ow2.frascati.nuxeo.test;
import org.nuxeo.runtime.test.runner.Deploy;
import org.nuxeo.runtime.test.runner.LocalDeploy;
import org.nuxeo.runtime.test.runner.Features;
import org.nuxeo.runtime.test.runner.RuntimeFeature;
import org.nuxeo.runtime.test.runner.SimpleFeature;
@Features(RuntimeFeature.class)
@Deploy({
"org.nuxeo.runtime.reload"
})
@LocalDeploy({
"org.nuxeo.runtime.reload:OSGI-INF/reload-service.xml"
})
public class MinimalistNuxeoFeature extends SimpleFeature
{
}
......@@ -38,6 +38,7 @@ import org.nuxeo.runtime.model.ComponentName;
import org.nuxeo.runtime.model.RegistrationInfo;
import org.nuxeo.runtime.test.runner.Features;
import org.nuxeo.runtime.test.runner.FeaturesRunner;
import org.nuxeo.runtime.reload.ReloadService;
import org.objectweb.fractal.api.Component;
......@@ -100,6 +101,7 @@ public class TestNuxeo
FraSCAti frascati = FraSCAti.newFraSCAti();
// Get the Nuxeo composite.
Component nuxeo = frascati.getComposite("Nuxeo");
// Retrieve the LoginService service.
LoginService loginService = frascati.getService(nuxeo, "LoginService", LoginService.class);
// Invoke it.
......@@ -107,6 +109,16 @@ public class TestNuxeo
System.out.println("* " + securityDomain);
}
// Thread.sleep(5*60*1000);
// Retrieve the ReloadService service.
ReloadService reloadService = frascati.getService(nuxeo, "ReloadService", ReloadService.class);
// Invoke it.
reloadService.reload();
// Sleep in order to use the Nuxeo services as Web Services.
int minutesToSleep = Integer.getInteger("sleep", 0);
if(minutesToSleep > 0) {
System.out.println("Will sleep " + minutesToSleep + " minutes...");
Thread.sleep(minutesToSleep*60*1000);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment