示例#1
0
 @Override
 public void run() {
   try {
     if (!latch.await(5000)) {
       UnitTestLogger.LOGGER.error("Latch timed out");
     }
   } catch (Exception e) {
     UnitTestLogger.LOGGER.error(e);
   }
   waiting = false;
 }
示例#2
0
 @Override
 public void run() {
   waiting = true;
   readyLatch.countDown();
   try {
     if (!latch.await(1000)) {
       UnitTestLogger.LOGGER.error("Latch timed out!", new Exception("trace"));
     }
   } catch (Exception e) {
     UnitTestLogger.LOGGER.error(e);
     this.e = e;
   }
   waiting = false;
 }
示例#3
0
 @Override
 public void run() {
   try {
     latchReady.countDown();
     // Everybody should start at the same time, to worse concurrency
     // effects
     latchStart.await();
     for (int i = 0; i < numberOfAdds; i++) {
       latch.countUp();
     }
   } catch (Exception e) {
     UnitTestLogger.LOGGER.error(e.getMessage(), e);
   }
 }
示例#4
0
  @Test
  public void testManifestEntries() throws Exception {
    Properties props = System.getProperties();
    String userDir = props.getProperty("build.lib");

    UnitTestLogger.LOGGER.trace("userDir is " + userDir);

    // The jar must be there
    File file = new File("build/jars", "hornetq-core.jar");
    Assert.assertTrue(file.exists());

    // Open the jar and load MANIFEST.MF
    JarFile jar = new JarFile(file);
    Manifest manifest = jar.getManifest();

    // Open a connection and get ConnectionMetaData
    Connection conn = null;

    try {
      HornetQServer server = HornetQServers.newHornetQServer(createBasicConfig());

      ConnectionMetaData meta = new HornetQConnectionMetaData(server.getVersion());

      // Compare the value from ConnectionMetaData and MANIFEST.MF
      Attributes attrs = manifest.getMainAttributes();

      Assert.assertEquals(meta.getProviderVersion(), attrs.getValue("HornetQ-Version"));
      // TODO fix this
      Assert.assertEquals(
          "https://svn.jboss.org/repos/hornetq/branches/Branch_2_2_EAP",
          attrs.getValue("HornetQ-SVN-URL"));
    } finally {
      if (conn != null) {
        conn.close();
      }
    }
  }
 private static void debug(final String msg) {
   UnitTestLogger.LOGGER.debug(msg);
 }