Beispiel #1
0
  @Test
  public void testLoadVersion() throws Exception {
    Version version = VersionLoader.getVersion();
    Properties props = new Properties();
    props.load(ClassLoader.getSystemResourceAsStream(VersionLoader.DEFAULT_PROP_FILE_NAME));

    Assert.assertEquals(props.get("hornetq.version.versionName"), version.getVersionName());
    Assert.assertEquals(props.get("hornetq.version.versionSuffix"), version.getVersionSuffix());

    Assert.assertEquals(
        Integer.parseInt(props.getProperty("hornetq.version.majorVersion")),
        version.getMajorVersion());
    Assert.assertEquals(
        Integer.parseInt(props.getProperty("hornetq.version.minorVersion")),
        version.getMinorVersion());
    Assert.assertEquals(
        Integer.parseInt(props.getProperty("hornetq.version.microVersion")),
        version.getMicroVersion());
    Assert.assertEquals(
        Integer.parseInt(
            new StringTokenizer(props.getProperty("hornetq.version.incrementingVersion"), ",")
                .nextToken()),
        version.getIncrementingVersion());
  }
 /**
  * Creates a new XAResourceWrapper. PRODUCT_NAME, productVersion and jndiName are useful for log
  * output in the Transaction Manager. For HornetQ only the resourceManagerID is required to allow
  * Transaction Manager to recover from relevant recovery scenarios.
  *
  * @param xaResource
  * @param jndiName
  */
 public HornetQXAResourceWrapper(XAResource xaResource, String jndiName, String nodeId) {
   this.xaResource = xaResource;
   this.productName = HornetQResourceAdapter.PRODUCT_NAME;
   this.productVersion = VersionLoader.getVersion().getFullVersion();
   this.jndiNameNodeId = jndiName + " NodeId:" + nodeId;
 }