Permalink
Browse files

Added Fork Per Spec to sbt settings and refactored tests.

  • Loading branch information...
atooni committed Nov 10, 2018
1 parent 999c6ff commit 0ecd8d14040d4b85950a0ff591f10ff75b856ceb
Showing with 912 additions and 883 deletions.
  1. +8 −8 ...emq.brokerstarter/src/main/scala/blended/activemq/brokerstarter/internal/BrokerControlActor.scala
  2. +17 −17 ...mq.brokerstarter/src/test/scala/blended/activemq/brokerstarter/internal/BrokerActivatorSpec.scala
  3. +10 −7 blended.akka.http/src/test/scala/blended/akka/http/internal/RouteProviderSpec.scala
  4. +7 −5 blended.jms.bridge/src/test/resources/container/etc/broker.amq
  5. +7 −6 blended.jms.bridge/src/test/resources/container/etc/broker2.amq
  6. +87 −89 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/BridgeSpec.scala
  7. +1 −5 blended.jms.bridge/src/test/scala/blended/jms/bridge/internal/InboundConfigSpec.scala
  8. +6 −3 blended.launcher/src/test/scala/blended/launcher/EquinoxFrameworkTest.scala
  9. +2 −1 blended.launcher/src/test/scala/blended/launcher/FelixFrameworkTest.scala
  10. +41 −73 blended.mgmt.rest/src/test/scala/blended/mgmt/rest/internal/ContainerDeploymentSpec.scala
  11. +78 −59 blended.mgmt.ws/src/test/scala/blended/mgmt/ws/internal/MgmtWebSocketSpec.scala
  12. +2 −0 blended.security.login.api/src/main/scala/blended/security/login/api/TokenStore.scala
  13. +6 −0 blended.security.login.impl/src/main/scala/blended/security/login/impl/SimpleTokenStore.scala
  14. +21 −18 blended.security.login.impl/src/test/scala/blended/security/login/internal/TokenStoreSpec.scala
  15. +60 −74 ...ed.security.login.rest/src/test/scala/blended/security/login/rest/internal/LoginServiceSpec.scala
  16. +14 −17 blended.security.ssl/src/test/scala/blended/security/ssl/internal/CertificateActivatorSpec.scala
  17. +7 −2 blended.security.ssl/src/test/scala/blended/security/ssl/internal/CertificateRefresherSpec.scala
  18. +9 −19 blended.security.test/src/test/scala/blended/security/AbstractLoginSpec.scala
  19. +10 −17 blended.security.test/src/test/scala/blended/security/ConfigLoginSpec.scala
  20. +22 −26 blended.security.test/src/test/scala/blended/security/ConfigPermissionManagerSpec.scala
  21. +24 −22 blended.security.test/src/test/scala/blended/security/LDAPLoginSpec.scala
  22. +20 −20 ...reams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/DispatcherActivatorSpec.scala
  23. +3 −5 ...ms.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/CoreDispatcherSpec.scala
  24. +10 −12 ...treams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/DispatcherSpec.scala
  25. +42 −39 ...dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/DispatcherSpecSupport.scala
  26. +5 −8 ...ed.streams.dispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/FanoutSpec.scala
  27. +3 −5 ...ispatcher/src/test/scala/blended/streams/dispatcher/internal/builder/OutboundDispatcherSpec.scala
  28. +13 −15 ...her/src/test/scala/blended/streams/dispatcher/internal/builder/ResourceTypeRouterConfigSpec.scala
  29. +48 −51 ...spatcher/src/test/scala/blended/streams/dispatcher/internal/builder/TransactionOutboundSpec.scala
  30. +9 −11 ...patcher/src/test/scala/blended/streams/dispatcher/internal/builder/WorklistEventhandlerSpec.scala
  31. +37 −35 blended.streams/src/test/scala/blended/streams/processor/HeaderProcessorSpec.scala
  32. +39 −43 blended.streams/src/test/scala/blended/streams/transaction/FlowTransactionStreamSpec.scala
  33. +1 −1 blended.testsupport.pojosr/src/main/scala/blended/testsupport/pojosr/BlendedPojoRegistry.scala
  34. +100 −39 blended.testsupport.pojosr/src/main/scala/blended/testsupport/pojosr/PojoSrTestHelper.scala
  35. +21 −0 blended.testsupport.pojosr/src/main/scala/blended/testsupport/pojosr/SimplePojoContainerSpec.scala
  36. +0 −49 ...d.testsupport.pojosr/src/main/scala/blended/testsupport/pojosr/SimplePojosrBlendedContainer.scala
  37. +3 −4 blended.testsupport.pojosr/src/main/scala/org/apache/felix/connect/BlendedPojoBundle.scala
  38. +2 −8 blended.testsupport/src/main/scala/blended/testsupport/RequiresForkedJVM.scala
  39. +3 −66 build.sbt
  40. +1 −1 doc/jbake.properties
  41. +1 −0 project/BlendedAkkaHttp.scala
  42. +1 −0 project/BlendedMgmtRest.scala
  43. +3 −1 project/BlendedTestsupportPojosr.scala
  44. +15 −1 project/CommonSettings.scala
  45. +25 −0 project/JBake.scala
  46. +39 −1 project/ProjectSettings.scala
  47. +29 −0 project/RootSettings.scala
@@ -120,14 +120,14 @@ class BrokerControlActor(brokerCfg: BrokerConfig, cfg: OSGIActorConfig, sslCtxt:
val actor = context.self
// TODO: set Datadirectories from Code ??
val f = Future {
b.setBrokerName(brokerCfg.brokerName)
b.setStartAsync(false)
b.start()
b.waitUntilStarted()
log.info(s"ActiveMQ broker [${brokerCfg.brokerName}] started successfully.")
actor ! BrokerControlActor.BrokerStarted(uuid)
}(context.system.dispatcher)
b.setBrokerName(brokerCfg.brokerName)
b.setStartAsync(false)
b.setSchedulerSupport(true)
b.start()
b.waitUntilStarted()
log.info(s"ActiveMQ broker [${brokerCfg.brokerName}] started successfully.")
actor ! BrokerControlActor.BrokerStarted(uuid)
} catch {
case NonFatal(t) =>
log.warn(t)(s"Error starting ActiveMQ broker [${brokerCfg.brokerName}]")
@@ -5,34 +5,34 @@ import java.io.File
import blended.activemq.brokerstarter.BrokerActivator
import blended.akka.internal.BlendedAkkaActivator
import blended.jms.utils.IdAwareConnectionFactory
import blended.testsupport.BlendedTestSupport
import blended.testsupport.pojosr.{PojoSrTestHelper, SimplePojosrBlendedContainer}
import blended.testsupport.scalatest.LoggingFreeSpec
import blended.testsupport.{BlendedTestSupport, RequiresForkedJVM}
import blended.testsupport.pojosr.{PojoSrTestHelper, SimplePojoContainerSpec}
import blended.testsupport.scalatest.LoggingFreeSpecLike
import org.osgi.framework.BundleActivator
import org.scalatest.Matchers
import scala.concurrent.duration._
class BrokerActivatorSpec extends LoggingFreeSpec
with SimplePojosrBlendedContainer
@RequiresForkedJVM
class BrokerActivatorSpec extends SimplePojoContainerSpec
with LoggingFreeSpecLike
with PojoSrTestHelper
with Matchers {
private val baseDir = new File(BlendedTestSupport.projectTestOutput, "container").getAbsolutePath()
override def baseDir: String = new File(BlendedTestSupport.projectTestOutput, "container").getAbsolutePath()
override def bundles: Seq[(String, BundleActivator)] = Seq(
"blended.akka" -> new BlendedAkkaActivator(),
"blended.activemq.brokerstarter" -> new BrokerActivator()
)
"The BrokerActivator should" - {
"start the configured brokers correctly" in {
withSimpleBlendedContainer(baseDir) { sr =>
withStartedBundles(sr)(Seq(
"blended.akka" -> Some(() => new BlendedAkkaActivator()),
"blended.activemq.brokerstarter" -> Some(() => new BrokerActivator())
)) { sr =>
implicit val timeout = 10.seconds
waitOnService[IdAwareConnectionFactory](sr)(Some("(&(vendor=activemq)(provider=blended))")) should be (defined)
waitOnService[IdAwareConnectionFactory](sr)(Some("(&(vendor=activemq)(provider=broker2))")) should be (defined)
}
}
implicit val timeout = 10.seconds
waitOnService[IdAwareConnectionFactory](registry)(Some("(&(vendor=activemq)(provider=blended))")) should be (defined)
waitOnService[IdAwareConnectionFactory](registry)(Some("(&(vendor=activemq)(provider=broker2))")) should be (defined)
}
}
}
@@ -1,12 +1,13 @@
package blended.akka.http.internal
import scala.util.Try
import java.io.File
import scala.util.Try
import org.scalatest.FreeSpec
import akka.http.scaladsl.testkit.ScalatestRouteTest
import blended.akka.http.HttpContext
import blended.akka.http.SimpleHttpContext
import blended.testsupport.BlendedTestSupport
import blended.testsupport.pojosr.PojoSrTestHelper
import domino.DominoActivator
@@ -15,6 +16,8 @@ class RouteProviderSpec
with ScalatestRouteTest
with PojoSrTestHelper {
override def baseDir: String = new File(System.getProperty(BlendedTestSupport.projectTestOutput)).getAbsolutePath()
val routeProvider = new RouteProvider()
val route = routeProvider.dynamicRoute
@@ -38,7 +41,7 @@ class RouteProviderSpec
"Inside a dynamic (OSGi) environment, the RouteProvider should" - {
"handle comming and going HttpContext registrations" in {
withPojoServiceRegistry { sr =>
withPojoServiceRegistry { sr => Try {
val serviceBundle = new DominoActivator() {
whenBundleActive {
@@ -88,10 +91,10 @@ class RouteProviderSpec
Try { routeBundle.stop(bundleContext) }
}
}
}
}}
"handle HttpContext registrations with prefixes containing slashes" in {
withPojoServiceRegistry { sr =>
withPojoServiceRegistry { sr => Try {
val serviceBundle = new DominoActivator() {
whenBundleActive {
@@ -141,8 +144,8 @@ class RouteProviderSpec
Try { routeBundle.stop(bundleContext) }
}
}
}
}}
}
}
}
@@ -58,24 +58,26 @@
</amq:policyEntry>
</amq:policyEntries>
</amq:policyMap>
</amq:destinationPolicy>
<amq:plugins>
<amq:redeliveryPlugin>
<amq:redeliveryPolicyMap>
<amq:redeliveryPolicyEntries>
<amq:redeliveryPolicyMap>
<amq:redeliveryPolicyEntries />
<amq:defaultEntry>
<amq:reliveryPolicy
<amq:redeliveryPolicy
maximumRedeliveries = "5"
initialRedeliveryDelay = "5000"
maximumRedeliveryDelay = "120000"
backOffMultiplier = "5"
useExponentialBackOff = "true"
/>
</amq:defaultEntry>
</amq:redeliveryPolicyEntries>
</amq:redeliveryPolicyMap>
</amq:redeliveryPolicyMap>
</amq:redeliveryPlugin>
</amq:destinationPolicy>
</amq:plugins>
</amq:broker>
@@ -58,25 +58,26 @@
</amq:policyEntry>
</amq:policyEntries>
</amq:policyMap>
</amq:destinationPolicy>
<amq:plugins>
<amq:redeliveryPlugin>
<amq:redeliveryPolicyMap>
<amq:redeliveryPolicyEntries>
<amq:redeliveryPolicyMap>
<amq:redeliveryPolicyEntries />
<amq:defaultEntry>
<amq:reliveryPolicy
<amq:redeliveryPolicy
maximumRedeliveries = "5"
initialRedeliveryDelay = "5000"
maximumRedeliveryDelay = "120000"
backOffMultiplier = "5"
useExponentialBackOff = "true"
/>
</amq:defaultEntry>
</amq:redeliveryPolicyEntries>
</amq:redeliveryPolicyMap>
</amq:redeliveryPolicyMap>
</amq:redeliveryPlugin>
</amq:destinationPolicy>
</amq:plugins>
</amq:broker>
Oops, something went wrong.

0 comments on commit 0ecd8d1

Please sign in to comment.