OSGi Make the integration test work again. See #3292
OSGi Adding ScalaBuff and removing experimental from cluster. See #3292 OSGi create bundle for ScalaBuff. See #3292 OSGi Make the integration test work again. See #3292
This commit is contained in:
parent
8e53a59e84
commit
9797e00f0c
6 changed files with 97 additions and 18 deletions
|
|
@ -18,6 +18,11 @@
|
|||
<bundle start-level="20">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.protobuf-java/${protobuf.version}_1</bundle>
|
||||
</feature>
|
||||
|
||||
<!-- TODO replace this with upstream scalabuff when osgi enabled -->
|
||||
<feature name='scalabuff' description='Scalabuff' version='${scalabuff.version}' resolver='(obr)'>
|
||||
<bundle start-level="20">mvn:com.typesafe.akka.akka-sample-osgi-dining-hakkers/scalabuff/${scalabuff.version}</bundle>
|
||||
</feature>
|
||||
|
||||
<feature name='netty' description='Netty feature' version='${netty.version}' resolver='(obr)'>
|
||||
<bundle start-level="20">mvn:io.netty/netty/${netty.version}</bundle>
|
||||
</feature>
|
||||
|
|
@ -32,8 +37,9 @@
|
|||
<feature version="[${netty.version},4.0.0)">netty</feature>
|
||||
<feature version="[1.2.2,3.0.0)">uncommons-maths</feature>
|
||||
<feature version="[${protobuf.version},3.0.0)">protobuf</feature>
|
||||
<feature version="[${scalabuff.version},1.3.0)">scalabuff</feature>
|
||||
<feature version="[${typesafe.config.version},2.0.0)">typesafe-config</feature>
|
||||
<bundle start-level="30">mvn:com.typesafe.akka/akka-cluster-experimental_${scala.dep.version}/${akka.version}</bundle>
|
||||
<bundle start-level="30">mvn:com.typesafe.akka/akka-cluster_${scala.dep.version}/${akka.version}</bundle>
|
||||
<bundle start-level="30">mvn:com.typesafe.akka/akka-remote_${scala.dep.version}/${akka.version}</bundle>
|
||||
<bundle start-level="30">mvn:com.typesafe.akka/akka-osgi_${scala.dep.version}/${akka.version}</bundle>
|
||||
</feature>
|
||||
|
|
|
|||
|
|
@ -56,9 +56,13 @@
|
|||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sandrogrzicic</groupId>
|
||||
<artifactId>scalabuff-runtime_${scala.dep.version}</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.typesafe.akka</groupId>
|
||||
<artifactId>akka-cluster-experimental_${scala.dep.version}</artifactId>
|
||||
<artifactId>akka-cluster_${scala.dep.version}</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.fusesource</groupId>
|
||||
|
|
|
|||
|
|
@ -85,15 +85,8 @@ java.io.EOFException
|
|||
// create an "Interrogator" actor that receives a Hakker's identification
|
||||
// this is to work around the TestProbe Exception above
|
||||
val response = new SynchronousQueue[(String, String)]()
|
||||
class Interrogator extends Actor {
|
||||
def receive = {
|
||||
case msg: Identification ⇒ {
|
||||
response.put((msg.name, msg.busyWith))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hakker.tell(Identify, actorSystem.actorOf(Props[Interrogator], "Interrogator"))
|
||||
hakker.tell(Identify, actorSystem.actorOf(Props(classOf[HakkerStatusTest.Interrogator], response), "Interrogator"))
|
||||
val (fromHakker, busyWith) = response.poll(5, TimeUnit.SECONDS)
|
||||
|
||||
println("---------------> %s is busy with %s.".format(fromHakker, busyWith))
|
||||
|
|
@ -103,3 +96,13 @@ java.io.EOFException
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
object HakkerStatusTest {
|
||||
class Interrogator(queue: SynchronousQueue[(String, String)]) extends Actor {
|
||||
def receive = {
|
||||
case msg: Identification ⇒ {
|
||||
queue.put((msg.name, msg.busyWith))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,14 @@
|
|||
<scala.dep.version>2.10</scala.dep.version>
|
||||
<scalatest.version>1.9.1</scalatest.version>
|
||||
<typesafe.config.version>1.0.0</typesafe.config.version>
|
||||
<scalabuff.version>1.2.0</scalabuff.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>api</module>
|
||||
<module>command</module>
|
||||
<module>uncommons</module>
|
||||
<module>scalabuff</module>
|
||||
<module>core</module>
|
||||
|
||||
<module>assembly-features</module>
|
||||
|
|
@ -78,7 +80,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.typesafe.akka</groupId>
|
||||
<artifactId>akka-cluster-experimental_${scala.dep.version}</artifactId>
|
||||
<artifactId>akka-cluster_${scala.dep.version}</artifactId>
|
||||
<version>${akka.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
@ -96,6 +98,11 @@
|
|||
<artifactId>protobuf-java</artifactId>
|
||||
<version>${protobuf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sandrogrzicic</groupId>
|
||||
<artifactId>scalabuff-runtime_${scala.dep.version}</artifactId>
|
||||
<version>${scalabuff.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.typesafe.akka.akka-sample-osgi-dining-hakkers</groupId>
|
||||
<artifactId>project</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>scalabuff</artifactId>
|
||||
<name>net.sandrogrzicic.scalabuff</name>
|
||||
<version>${scalabuff.version}</version>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sandrogrzicic</groupId>
|
||||
<artifactId>scalabuff-runtime_${scala.dep.version}</artifactId>
|
||||
<version>${scalabuff.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Name>${project.name}</Bundle-Name>
|
||||
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
|
||||
<Export-Package>net.sandrogrzicic.scalabuff</Export-Package>
|
||||
<Import-Package>!sun.misc, *</Import-Package>
|
||||
\ </instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -184,6 +184,7 @@ object AkkaBuild extends Build {
|
|||
dependencies = Seq(remote, remoteTests % "test->test" , testkit % "test->test"),
|
||||
settings = defaultSettings ++ scaladocSettings ++ javadocSettings ++ multiJvmSettings ++ OSGi.cluster ++ experimentalSettings ++
|
||||
scalabuffSettings ++ Seq(
|
||||
// this version needs to be reflected in the OSGi.scalabuffImport and dining hackers pom.xml
|
||||
scalabuffVersion in ScalaBuff := "1.2.0",
|
||||
libraryDependencies ++= Dependencies.cluster,
|
||||
// disable parallel tests
|
||||
|
|
@ -423,7 +424,7 @@ object AkkaBuild extends Build {
|
|||
base = file("akka-samples/akka-sample-osgi-dining-hakkers"),
|
||||
settings = parentSettings
|
||||
) aggregate(osgiDiningHakkersSampleApi, osgiDiningHakkersSampleCommand, osgiDiningHakkersSampleCore,
|
||||
osgiDiningHakkersSampleIntegrationTest, uncommons)
|
||||
osgiDiningHakkersSampleIntegrationTest, uncommons, scalaBuff)
|
||||
|
||||
lazy val osgiDiningHakkersSampleApi = Project(id = "akka-sample-osgi-dining-hakkers-api",
|
||||
base = file("akka-samples/akka-sample-osgi-dining-hakkers/api"),
|
||||
|
|
@ -446,15 +447,24 @@ object AkkaBuild extends Build {
|
|||
|
||||
//TODO to remove it as soon as the uncommons gets OSGified, see ticket #2990
|
||||
lazy val uncommons = Project(id = "akka-sample-osgi-dining-hakkers-uncommons",
|
||||
base = file("akka-samples/akka-sample-osgi-dining-hakkers//uncommons"),
|
||||
base = file("akka-samples/akka-sample-osgi-dining-hakkers/uncommons"),
|
||||
settings = sampleSettings ++ OSGi.osgiDiningHakkersSampleUncommons ++ Seq(
|
||||
libraryDependencies ++= Dependencies.uncommons,
|
||||
version := "1.2.2"
|
||||
version := "1.2.0"
|
||||
)
|
||||
)
|
||||
|
||||
//TODO to remove it as soon as the scalabuff gets OSGified, see ticket #3416
|
||||
lazy val scalaBuff = Project(id = "akka-sample-osgi-dining-hakkers-scalaBuff",
|
||||
base = file("akka-samples/akka-sample-osgi-dining-hakkers/scalabuff"),
|
||||
settings = sampleSettings ++ OSGi.osgiDiningHakkersSampleScalaBuff ++ Seq(
|
||||
libraryDependencies ++= Dependencies.scalaBuff,
|
||||
version := "1.2.0"
|
||||
)
|
||||
)
|
||||
|
||||
def executeMvnCommands(failureMessage: String, commands: String*) = {
|
||||
if ({List("sh", "-c", commands.mkString("cd akka-samples/akka-sample-osgi-dining-hakkers; mvn ", " ", "")) !} != 0)
|
||||
if ({List("sh", "-c", commands.mkString("cd akka-samples/akka-sample-osgi-dining-hakkers; mvn -U ", " ", "")) !} != 0)
|
||||
throw new Exception(failureMessage)
|
||||
}
|
||||
|
||||
|
|
@ -467,7 +477,7 @@ object AkkaBuild extends Build {
|
|||
}})
|
||||
else Seq.empty
|
||||
)
|
||||
) dependsOn(osgiDiningHakkersSampleApi, osgiDiningHakkersSampleCommand, osgiDiningHakkersSampleCore, uncommons)
|
||||
) dependsOn(osgiDiningHakkersSampleApi, osgiDiningHakkersSampleCommand, osgiDiningHakkersSampleCore, uncommons, scalaBuff)
|
||||
|
||||
|
||||
|
||||
|
|
@ -849,7 +859,7 @@ object AkkaBuild extends Build {
|
|||
|
||||
val camel = exports(Seq("akka.camel.*"))
|
||||
|
||||
val cluster = exports(Seq("akka.cluster.*"))
|
||||
val cluster = exports(Seq("akka.cluster.*"), imports = Seq(scalabuffImport(), protobufImport()))
|
||||
|
||||
val fileMailbox = exports(Seq("akka.actor.mailbox.filebased.*"))
|
||||
|
||||
|
|
@ -870,6 +880,8 @@ object AkkaBuild extends Build {
|
|||
|
||||
val osgiDiningHakkersSampleUncommons = exports(Seq("org.uncommons.maths.random")) ++ Seq(OsgiKeys.privatePackage := Seq("org.uncommons.maths.binary", "org.uncommons.maths", "org.uncommons.maths.number"))
|
||||
|
||||
val osgiDiningHakkersSampleScalaBuff = exports(Seq("net.sandrogrzicic.scalabuff"))
|
||||
|
||||
val osgiAries = exports() ++ Seq(OsgiKeys.privatePackage := Seq("akka.osgi.aries.*"))
|
||||
|
||||
val remote = exports(Seq("akka.remote.*"), imports = Seq(protobufImport()))
|
||||
|
|
@ -893,6 +905,7 @@ object AkkaBuild extends Build {
|
|||
"akka.remote.serialization",
|
||||
"akka.cluster",
|
||||
"akka.cluster.routing",
|
||||
"akka.cluster.protobuf",
|
||||
"akka.transactor",
|
||||
"akka.agent",
|
||||
"akka.dataflow",
|
||||
|
|
@ -902,7 +915,8 @@ object AkkaBuild extends Build {
|
|||
"akka.camel",
|
||||
"akka.camel.internal.component",
|
||||
"akka.zeromq",
|
||||
"com.google.protobuf")
|
||||
"com.google.protobuf",
|
||||
"net.sandrogrzicic.scalabuff")
|
||||
|
||||
def exports(packages: Seq[String] = Seq(), imports: Seq[String] = Nil) = osgiSettings ++ Seq(
|
||||
OsgiKeys.importPackage := imports ++ defaultImports,
|
||||
|
|
@ -912,6 +926,7 @@ object AkkaBuild extends Build {
|
|||
def akkaImport(packageName: String = "akka.*") = "%s;version=\"[2.2,2.3)\"".format(packageName)
|
||||
def configImport(packageName: String = "com.typesafe.config.*") = "%s;version=\"[0.4.1,1.1.0)\"".format(packageName)
|
||||
def protobufImport(packageName: String = "com.google.protobuf.*") = "%s;version=\"[2.4.0,2.5.0)\"".format(packageName)
|
||||
def scalabuffImport(packageName: String = "net.sandrogrzicic.scalabuff.*") = "%s;version=\"[1.2.0,1.3.0)\"".format(packageName)
|
||||
def scalaImport(packageName: String = "scala.*") = "%s;version=\"[2.10,2.11)\"".format(packageName)
|
||||
def optionalResolution(packageName: String) = "%s;resolution:=optional".format(packageName)
|
||||
}
|
||||
|
|
@ -929,6 +944,7 @@ object Dependencies {
|
|||
val netty = "io.netty" % "netty" % "3.6.6.Final" // ApacheV2
|
||||
val protobuf = "com.google.protobuf" % "protobuf-java" % "2.4.1" // New BSD
|
||||
val scalaStm = "org.scala-stm" %% "scala-stm" % "0.7" // Modified BSD (Scala)
|
||||
val scalaBuffRuntime = "net.sandrogrzicic" %% "scalabuff-runtime" % "1.2.0" // ApacheV2
|
||||
|
||||
val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.2" // MIT
|
||||
val zeroMQClient = "org.zeromq" %% "zeromq-scala-binding" % "0.0.7" // ApacheV2
|
||||
|
|
@ -1004,6 +1020,8 @@ object Dependencies {
|
|||
|
||||
val uncommons = Seq(uncommonsMath)
|
||||
|
||||
val scalaBuff = Seq(scalaBuffRuntime)
|
||||
|
||||
val osgiAries = Seq(osgiCore, osgiCompendium, ariesBlueprint, Test.ariesProxy)
|
||||
|
||||
val docs = Seq(Test.scalatest, Test.junit, Test.junitIntf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue