Permalink
Browse files

SWITCHYARD-930 Problems when using JCAMixIn in the application testing

* fix jboss-logging conflict
* fix to retrieve HornetQ version from HornetQ class but not from environment variable
  • Loading branch information...
igarashitm authored and kcbabo committed Jul 2, 2013
1 parent 9da8125 commit b008131d8fc3e8feb49b1451bc8455d5fdd9881b
View
@@ -10,4 +10,5 @@ bin/
*.iws
.DS_Store
jca/transaction.log
+transaction.log.*
itests/transaction.log
View
@@ -81,6 +81,12 @@
<dependency>
<groupId>org.jboss.ironjacamar</groupId>
<artifactId>ironjacamar-core-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
View
@@ -51,6 +51,12 @@
<dependency>
<groupId>org.jboss.ironjacamar</groupId>
<artifactId>ironjacamar-core-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.ironjacamar</groupId>
@@ -80,6 +86,14 @@
<groupId>org.jboss.spec.javax.resource</groupId>
<artifactId>jboss-connector-api_1.6_spec</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-core-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
@@ -33,7 +33,9 @@
import junit.framework.Assert;
import org.apache.log4j.Logger;
-import org.jboss.as.connector.ConnectorServices;
+import org.hornetq.core.version.Version;
+import org.hornetq.utils.VersionLoader;
+import org.jboss.as.connector.util.ConnectorServices;
import org.jboss.jca.core.spi.rar.ResourceAdapterRepository;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
@@ -64,8 +66,6 @@
private static final String MOCK_DEFAULT_MCF_CLASS = "org.switchyard.test.mixins.jca.MockManagedConnectionFactory";
private static final String MOCK_RESOURCE_ADAPTER_XML = "jcamixin-mock-ra.xml";
private static final String HORNETQ_RESOURCE_ADAPTER_XML = "jcamixin-hornetq-ra.xml";
- private static final String ENV_HORNETQ_VERSION = "HORNETQ_VERSION";
- private static final String ENV_NETTY_VERSION = "NETTY_VERSION";
private Logger _logger = Logger.getLogger(JCAMixIn.class);
private SwitchYardIronJacamarHandler _ironJacamar;
@@ -205,12 +205,19 @@ private void deployMockResourceAdapter(String raName, Map<String, String> connDe
}
private void deployHornetQResourceAdapter(String raName, Map<String, String> connDefs) {
- String hqVersion = System.getenv(ENV_HORNETQ_VERSION);
- String nettyVersion = System.getenv(ENV_NETTY_VERSION);
+ Version version = VersionLoader.getVersion();
+ String hqVersion = version.getMajorVersion()
+ + "." + version.getMinorVersion()
+ + "." + version.getMicroVersion()
+ + "." + version.getVersionSuffix();
+ String nettyVersion = org.jboss.netty.util.Version.ID;
+ if (nettyVersion.indexOf('-') != -1) {
+ nettyVersion = nettyVersion.substring(0, nettyVersion.indexOf('-'));
+ }
ResourceAdapterArchive raa =
ShrinkWrap.create(ResourceAdapterArchive.class, stripDotRarSuffix(raName == null ? "hornetq-ra.rar" : raName) + ".rar");
- raa.addAsLibrary(ShrinkwrapUtil.getArchive("org.jboss.netty", "netty", nettyVersion, JavaArchive.class, "jar"));
+ raa.addAsLibrary(ShrinkwrapUtil.getArchive("io.netty", "netty", nettyVersion, JavaArchive.class, "jar"));
raa.addAsLibrary(ShrinkwrapUtil.getArchive("org.hornetq", "hornetq-ra", hqVersion, JavaArchive.class, "jar"));
raa.addAsLibrary(ShrinkwrapUtil.getArchive("org.hornetq", "hornetq-core-client", hqVersion, JavaArchive.class, "jar"));
raa.addAsLibrary(ShrinkwrapUtil.getArchive("org.hornetq", "hornetq-jms-client", hqVersion, JavaArchive.class, "jar"));

0 comments on commit b008131

Please sign in to comment.