Add a library in compile/deploy test (annotations)

Copy needed library dynamically using maven
(This update has been done to fix a bug in deploy/undeploy tests in bamboo and jenkins servers)
parent 857f5394
......@@ -117,6 +117,34 @@
</systemPropertyVariables>
</configuration>
</plugin>
<!-- Copy jar to be used in tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy</id>
<phase>clean</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.stp.sca.osoa.java</groupId>
<artifactId>osoa-java-api</artifactId>
<version>2.0.1.2</version>
<type>jar</type>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
<outputDirectory>src/test/resources/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
......
......@@ -63,7 +63,7 @@ public class DeployTest {
private static final String helloworldApplicationName = "helloworld";
//TODO Change this to use dynamic lib path from resources
private static final String helloworldLibPath = System.getProperty("user.home")+File.separator+"Documents"+File.separator+"easysoawebsitesimplified"+File.separator+"lib";
private static final String helloworldLibPath = "src"+File.separator+"test"+File.separator+"resources"+File.separator+"lib";
private static DeployProcessor deployment;
......
......@@ -2,24 +2,33 @@ package org.easysoa.helloworld.impl;
import org.easysoa.helloworld.api.InterfaceHW;
import org.osoa.sca.annotations.EagerInit;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
/**
* Implementation class of the component 'client'.
* (Other components can share this implementation class.)
*/
@Scope("COMPOSITE")
@EagerInit
public class Client implements java.lang.Runnable {
private InterfaceHW reqClient;
@Reference
private InterfaceHW reqClient;
/**
* Set the client port 'reqClient'.
*/
public void setReqClient(InterfaceHW reqClient) {
this.reqClient = reqClient;
}
/**
* Set the client port 'reqClient'.
*/
public void setReqClient(InterfaceHW reqClient) {
this.reqClient = reqClient;
}
public void run() {
System.out.println(reqClient.call() );
}
@Override
@Init
public void run() {
System.out.println(reqClient.call() );
}
}
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