Beispiel #1
0
  public void testConfigure_Valid() throws Exception {
    launcher.configure(getConfigPath("valid-launch.conf"));
    Class mainClass = launcher.getMainClass();

    assertNotNull(mainClass);
    assertEquals("a.A", mainClass.getName());
    assertEquals("app", launcher.getMainRealm().getId());
  }
Beispiel #2
0
  public void testLaunch_ClassNotFound() throws Exception {
    launcher.configure(getConfigPath("launch-noclass.conf"));

    try {
      launcher.launch(new String[] {});
      fail("throw ClassNotFoundException");
    } catch (ClassNotFoundException e) {
      // expected and correct
    }
  }
Beispiel #3
0
  public void testLaunch_NoSuchMethod() throws Exception {
    launcher.configure(getConfigPath("launch-nomethod.conf"));

    try {
      launcher.launch(new String[] {});
      fail("should have thrown NoSuchMethodException");
    } catch (NoSuchMethodException e) {
      // expected and correct
    }
  }
Beispiel #4
0
  public void testLaunch_ValidEnhancedExitCode() throws Exception {
    launcher.configure(getConfigPath("valid-enh-launch-exitCode.conf"));
    launcher.launch(new String[] {});

    assertEquals("check exit code", 45, launcher.getExitCode());
  }
Beispiel #5
0
  public void testLaunch_ValidEnhanced() throws Exception {
    launcher.configure(getConfigPath("valid-enh-launch.conf"));

    launcher.launch(new String[] {});
  }