Commit d53ff9d6 authored by Philippe Merle's avatar Philippe Merle

* Moved module frascati-test outside of examples.

  This allows the simplification of example pom.xml files as the dependency
  to the artifact frascati-test is defined in examples/pom.xml only once time.
* Removed getComposite() methods for test classes as this method is now
  defined into the class FraSCAtiTestCase and use a Java property to
  identify the composite to load.
parent aca3c827
......@@ -43,15 +43,4 @@
<composite.file>availability</composite.file>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -56,14 +56,6 @@
<artifactId>frascati-implementation-bpel</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- For JUnit testing. -->
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -47,21 +47,4 @@
<method.params>HelloWorld</method.params>
</properties>
<!-- ============= -->
<!-- Dependencies -->
<!-- ============= -->
<dependencies>
<!-- ===== -->
<!-- Tests -->
<!-- ===== -->
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* OW2 FraSCAti Examples : CallBack
* Copyright (C) 2009-2010 INRIA, University of Lille 1
* Copyright (C) 2009-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -28,19 +29,13 @@ package org.ow2.frascati.examples.callback.test;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
import org.ow2.frascati.examples.callback.api.Notifier;
public class CallbackTestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
return "callback.composite";
}
@Test
public final void testCallback() throws Exception
{
......
......@@ -48,13 +48,4 @@
<method.name>run</method.name>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -28,7 +29,7 @@ package org.ow2.frascati.examples.comanche;
import org.junit.Assert;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
......@@ -58,9 +59,4 @@ public class ComancheTestCase
Assert.assertTrue("The server image seems to be corrupted.", offsets1[i] == offsets2[i]);
}
}
public String getComposite()
{
return "comanche.composite";
}
}
......@@ -90,13 +90,6 @@
<artifactId>frascati-binding-rest</artifactId>
<version>${frascati.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<modules>
......
/**
* OW2 FraSCAti: Crisis BPEL
* Copyright (C) 2010 INRIA, University of Lille 1
* Copyright (C) 2010-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -27,25 +28,18 @@
package org.ow2.frascati.examples.crisis.test;
import org.junit.Test;
import org.objectweb.fractal.api.Component;
import org.ow2.frascati.FraSCAti;
import org.ow2.frascati.test.FraSCAtiTestCase;
/**
* JUnit test case for OW2 FraSCAti class.
*
* @author Philippe Merle - INRIA
*/
public class CrisisTest {
public class CrisisTest extends FraSCAtiTestCase
{
@Test
public void runCrisisComposite() throws Exception {
FraSCAti frascati = FraSCAti.newFraSCAti();
Component crisisComposite = frascati.getComposite("Crisis");
Runnable runnable = frascati.getService(crisisComposite, "runnable", Runnable.class);
Runnable runnable = getService(Runnable.class, "runnable");
runnable.run();
frascati.close(crisisComposite);
}
}
......@@ -59,15 +59,4 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* OW2 FraSCAti Examples: Dictionary
* Copyright (C) 2009-2010 INRIA, University of Lille 1
* Copyright (C) 2009-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -30,17 +31,11 @@ import java.io.StringReader;
import org.junit.Assert;
import org.junit.Test;
import org.ow2.frascati.examples.dictionary.api.Dictionary;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
public class DictionaryTestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
return "dictionary";
}
@Test
public final void testService()
{
......
/**
* OW2 FraSCAti Examples: Echo BPEL
* Copyright (C) 2010 INRIA, University of Lille 1
* Copyright (C) 2010-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -28,10 +29,7 @@ package org.ow2.frascati.examples.bpel.echo.test;
import static org.junit.Assert.*;
import org.junit.Test;
import org.objectweb.fractal.api.Component;
import org.ow2.frascati.FraSCAti;
import org.ow2.frascati.test.FraSCAtiTestCase;
import org.ow2.frascati.examples.bpel.echo.Echo;
......@@ -40,17 +38,13 @@ import org.ow2.frascati.examples.bpel.echo.Echo;
*
* @author Philippe Merle.
*/
public class EchoTest {
public class EchoTest extends FraSCAtiTestCase
{
@Test
public void runEchoBpelComposite() throws Exception {
FraSCAti frascati = FraSCAti.newFraSCAti();
Component echoComposite = frascati.getComposite("Echo.composite");
Echo echo = frascati.getService(echoComposite, "echo", Echo.class);
Echo echo = getService(Echo.class, "echo");
String echoRequest = "Philippe Merle";
String echoResponse = echo.process(echoRequest);
assertEquals("echo.process(" + echoRequest + ")", echoRequest, echoResponse);
frascati.close(echoComposite);
}
}
......@@ -57,19 +57,4 @@
<module>helloworld-jgroups</module>
</modules>
<!-- ============ -->
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* OW2 FraSCAti Examples: HelloWorld JNA
* Copyright (C) 2010 INRIA, University of Lille 1
* Copyright (C) 2010-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -26,8 +27,7 @@
package org.ow2.frascati.examples.helloworld.jna;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
/**
* Test the HelloWorld JNA composite.
......@@ -36,23 +36,9 @@ import org.ow2.frascati.examples.test.FraSCAtiTestCase;
public class HelloWorldJNATestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
String composite ="helloworld-jna";
String osName = System.getProperty("os.name");
if(osName.startsWith("Windows")) {
composite += "-windows";
}
return composite;
}
@Test
public final void testService()
{
getService(Runnable.class, "r").run();
}
}
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -28,7 +29,7 @@ package org.ow2.frascati.examples.helloworld.jna.test;
import org.junit.Before;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
import org.ow2.frascati.util.FrascatiException;
/**
......@@ -51,16 +52,9 @@ public class HelloWorldNativeTestCase
super.loadComposite();
}
@Override
public final String getComposite()
{
return "helloworld-native";
}
@Test
public final void testService()
{
getService(Runnable.class, "r").run();
}
}
......@@ -63,20 +63,11 @@
<!-- ============ -->
<dependencies>
<dependency>
<groupId>org.ow2.frascati.native</groupId>
<artifactId>frascati-binding-jna</artifactId>
<version>${frascati.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* OW2 FraSCAti Examples: HelloWorld POJO
* Copyright (C) 2009-2010 INRIA, University of Lille 1
* Copyright (C) 2009-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -26,17 +27,11 @@
package org.ow2.frascati.examples.helloworld;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
public class HelloworldTestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
return "helloworld-annotated";
}
@Test
public final void testService()
{
......
/**
* OW2 FraSCAti Examples: HelloWorld POJO
* Copyright (C) 2009-2010 INRIA, University of Lille 1
* Copyright (C) 2009-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -26,17 +27,11 @@
package org.ow2.frascati.examples.helloworld;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
public class HelloworldTestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
return "helloworld-bean";
}
@Test
public final void testService()
{
......
/**
* OW2 FraSCAti Examples: HelloWorld POJO
* Copyright (C) 2009-2010 INRIA, University of Lille 1
* Copyright (C) 2009-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -26,17 +27,11 @@
package org.ow2.frascati.examples.helloworld;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
public class HelloworldTestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
return "helloworld-pojo";
}
@Test
public final void testService()
{
......
......@@ -61,20 +61,11 @@
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......
/**
* OW2 FraSCAti: Factorial BPEL
* Copyright (C) 2010 INRIA, University of Lille 1
* Copyright (C) 2010-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,7 +14,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Contact: frascati@ow2.org
*
......@@ -28,10 +29,8 @@ package org.ow2.frascati.examples.factorial.bpel.test;
import static org.junit.Assert.*;
import org.junit.Test;
import org.ow2.frascati.test.FraSCAtiTestCase;
import org.objectweb.fractal.api.Component;
import org.ow2.frascati.FraSCAti;
import org.ow2.frascati.examples.factorial.bpel.api.Factorial;
/**
......@@ -39,18 +38,14 @@ import org.ow2.frascati.examples.factorial.bpel.api.Factorial;
*
* @author Philippe Merle.
*/
public class FraSCAtiTest
public class FraSCAtiTest extends FraSCAtiTestCase
{
@Test
public final void testFactorialBPEL() throws Exception
{
FraSCAti frascati = FraSCAti.newFraSCAti();
Component factorialComposite = frascati.getComposite("factorial.composite");
Factorial factorial = frascati.getService(factorialComposite, "factorial", Factorial.class);
Factorial factorial = getService(Factorial.class, "factorial");
double result = factorial.factorial(5);
System.out.println("factorial(5) ==> " + result);
assertEquals("factorial(5) == 120", 120.0, result, 0.0);
frascati.close(factorialComposite);
}
}
......@@ -68,14 +68,6 @@
<artifactId>frascati-binding-ws</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- Test. -->
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* OW2 FraSCAti Examples: Fibonacci
* Copyright (C) 2011 INRIA, University Lille 1
* Copyright (C) 2011-2012 Inria, University Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -28,17 +28,12 @@ package org.ow2.frascati.examples.fibonacci.test;
import org.junit.Assert;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
import org.ow2.frascati.test.FraSCAtiTestCase;
import org.ow2.frascati.examples.fibonacci.api.Fibonacci;
public class FibonacciTestCase
extends FraSCAtiTestCase
{
public final String getComposite()
{
return "fibonacci";
}
@Test
public final void testService()
{
......
......@@ -46,15 +46,4 @@
<method.name>run</method.name>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* OW2 FraSCAti : Forge Example
* Copyright (C) 2008-2010 INRIA, University of Lille 1
* Copyright (C) 2008-2012 Inria, University of Lille 1