Codota Logo
ExecCmdAsserts
Code IndexAdd Codota to your IDE (free)

How to use
ExecCmdAsserts
in
org.apache.brooklyn.util.core.internal.ssh

Best Java code snippets using org.apache.brooklyn.util.core.internal.ssh.ExecCmdAsserts (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: org.apache.brooklyn/brooklyn-core

public static void assertExecContains(ExecCmd actual, String expectedCmdRegex) {
  assertExecContains(actual, expectedCmdRegex, null);
}

origin: org.apache.brooklyn/brooklyn-core

public static void assertExecSatisfies(ExecCmd actual, Predicate<? super ExecCmd> expected) {
  assertExecSatisfies(actual, expected, null);
}

origin: org.apache.brooklyn/brooklyn-core

public static void assertExecHasOnlyOnce(List<ExecCmd> actuals, String expectedCmd) {
  assertExecHasExactly(actuals, expectedCmd, 1);
}
origin: org.apache.brooklyn/brooklyn-software-base

@Test
public void testAllCmds() throws Exception {
  app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class)
      .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand")
      .configure(VanillaSoftwareProcess.INSTALL_COMMAND, "installCommand")
      .configure(VanillaSoftwareProcess.POST_INSTALL_COMMAND, "postInstallCommand")
      .configure(VanillaSoftwareProcess.PRE_CUSTOMIZE_COMMAND, "preCustomizeCommand")
      .configure(VanillaSoftwareProcess.CUSTOMIZE_COMMAND, "customizeCommand")
      .configure(VanillaSoftwareProcess.POST_CUSTOMIZE_COMMAND, "postCustomizeCommand")
      .configure(VanillaSoftwareProcess.PRE_LAUNCH_COMMAND, "preLaunchCommand")
      .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand")
      .configure(VanillaSoftwareProcess.POST_LAUNCH_COMMAND, "postLaunchCommand")
      .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "checkRunningCommand")
      .configure(VanillaSoftwareProcess.STOP_COMMAND, "stopCommand"));
  app.start(ImmutableList.of(loc));
  assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of(
      "preInstallCommand", "installCommand", "postInstallCommand", 
      "preCustomizeCommand", "customizeCommand", "postCustomizeCommand", 
      "preLaunchCommand", "launchCommand", "postLaunchCommand", 
      "checkRunningCommand"));
  
  app.stop();
  assertExecContains(RecordingSshTool.getLastExecCmd(), "stopCommand");
}
origin: org.apache.brooklyn/brooklyn-software-base

assertExecsSatisfy(RecordingSshTool.getExecCmds(), ImmutableList.of(
    Predicates.and(ExecCmdPredicates.containsCmd("preInstallCommand"), ExecCmdPredicates.containsEnv(expectedEnv)),
    Predicates.and(ExecCmdPredicates.containsCmd("installCommand"), ExecCmdPredicates.containsEnv(expectedEnv)),
assertExecSatisfies(
    RecordingSshTool.getLastExecCmd(),
    Predicates.and(ExecCmdPredicates.containsCmd("stopCommand"), ExecCmdPredicates.containsEnv(expectedEnv)));
origin: org.apache.brooklyn/brooklyn-software-base

@Test
public void testSkipInstallation() throws Exception {
  app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class)
      .configure(VanillaSoftwareProcess.SKIP_INSTALLATION, true)
      .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand")
      .configure(VanillaSoftwareProcess.INSTALL_COMMAND, "installCommand")
      .configure(VanillaSoftwareProcess.POST_INSTALL_COMMAND, "postInstallCommand")
      .configure(VanillaSoftwareProcess.PRE_CUSTOMIZE_COMMAND, "preCustomizeCommand")
      .configure(VanillaSoftwareProcess.CUSTOMIZE_COMMAND, "customizeCommand")
      .configure(VanillaSoftwareProcess.POST_CUSTOMIZE_COMMAND, "postCustomizeCommand")
      .configure(VanillaSoftwareProcess.PRE_LAUNCH_COMMAND, "preLaunchCommand")
      .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand")
      .configure(VanillaSoftwareProcess.POST_LAUNCH_COMMAND, "postLaunchCommand")
      .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "checkRunningCommand")
      .configure(VanillaSoftwareProcess.STOP_COMMAND, "stopCommand"));
  app.start(ImmutableList.of(loc));
  assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of(
      "preCustomizeCommand", "customizeCommand", "postCustomizeCommand", 
      "preLaunchCommand", "launchCommand", "postLaunchCommand", 
      "checkRunningCommand"));
  
  assertExecsNotContains(RecordingSshTool.getExecCmds(), ImmutableList.of(
      "preInstallCommand", "installCommand", "postInstallCommand"));
}
origin: org.apache.brooklyn/brooklyn-software-base

  @Test
  public void testCmdNotInheritedFromParentOfSoftwareProcess() throws Exception {
    app.config().set(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand");
    app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class)
        .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand"));
    app.start(ImmutableList.of(loc));

    // since app does not define it, the child *should* run it
    assertExecHasOnlyOnce(RecordingSshTool.getExecCmds(), "preInstallCommand");
    assertExecHasOnlyOnce(RecordingSshTool.getExecCmds(), "launchCommand");
  }
}
origin: org.apache.brooklyn/brooklyn-software-base

    .get();
assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of(
    "checkRunningCommand", "stopCommand",  
    "preLaunchCommand", "launchCommand", "postLaunchCommand", 
origin: org.apache.brooklyn/brooklyn-core

public static void assertExecsNotContains(List<? extends ExecCmd> actuals, List<String> expectedNotCmdRegexs) {
  for (ExecCmd actual : actuals) {
    assertExecNotContains(actual, expectedNotCmdRegexs);
  }
}

origin: org.apache.brooklyn/brooklyn-camp

createStartWaitAndLogApplication(yaml);
ExecCmd cmd = ExecCmdAsserts.findExecContaining(RecordingSshTool.getExecCmds(), "myLaunchCmd");
assertEquals(cmd.env.get("KEY_IN_SUPER"), "myDefaultVal", "cmd="+cmd);
assertEquals(cmd.env.get("KEY_IN_SUB"), "myBoringVal", "cmd="+cmd);
origin: org.apache.brooklyn/brooklyn-software-base

@Test
public void testSkipEntityStartIfRunningWhenAlreadyRunning() throws Exception {
  app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class)
      .configure(VanillaSoftwareProcess.SKIP_ENTITY_START_IF_RUNNING, true)
      .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand")
      .configure(VanillaSoftwareProcess.INSTALL_COMMAND, "installCommand")
      .configure(VanillaSoftwareProcess.POST_INSTALL_COMMAND, "postInstallCommand")
      .configure(VanillaSoftwareProcess.PRE_CUSTOMIZE_COMMAND, "preCustomizeCommand")
      .configure(VanillaSoftwareProcess.CUSTOMIZE_COMMAND, "customizeCommand")
      .configure(VanillaSoftwareProcess.POST_CUSTOMIZE_COMMAND, "postCustomizeCommand")
      .configure(VanillaSoftwareProcess.PRE_LAUNCH_COMMAND, "preLaunchCommand")
      .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand")
      .configure(VanillaSoftwareProcess.POST_LAUNCH_COMMAND, "postLaunchCommand")
      .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "checkRunningCommand")
      .configure(VanillaSoftwareProcess.STOP_COMMAND, "stopCommand"));
  app.start(ImmutableList.of(loc));
  assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of(
      "checkRunningCommand"));
  
  assertExecsNotContains(RecordingSshTool.getExecCmds(), ImmutableList.of(
      "launchCommand"));
}
origin: org.apache.brooklyn/brooklyn-software-base

@Test
public void testCmdNotInheritedByChildrenOfSoftwareProcess() throws Exception {
  app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class)
      .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand")
      .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "parentLaunchCommand")
      .configure(VanillaSoftwareProcess.CHILDREN_STARTABLE_MODE, ChildStartableMode.FOREGROUND)
      .child(EntitySpec.create(VanillaSoftwareProcess.class)
          .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "childLaunchCommand")));
  app.start(ImmutableList.of(loc));
  assertExecHasOnlyOnce(RecordingSshTool.getExecCmds(), "childLaunchCommand");
  assertExecHasOnlyOnce(RecordingSshTool.getExecCmds(), "preInstallCommand");
}
origin: org.apache.brooklyn/brooklyn-software-base

app.start(ImmutableList.of(loc));
assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of(
    "checkRunningCommand",
    "preInstallCommand", "installCommand", "postInstallCommand", 
origin: org.apache.brooklyn/brooklyn-core

public static void assertExecsContain(List<ExecCmd> actuals, List<String> expectedCmds) {
  String errMsg = "actuals="+actuals+"; expected="+expectedCmds;
  assertTrue(actuals.size() >= expectedCmds.size(), "actualSize="+actuals.size()+"; expectedSize="+expectedCmds.size()+"; "+errMsg);
  for (int i = 0; i < expectedCmds.size(); i++) {
    assertExecContains(actuals.get(i), expectedCmds.get(i), errMsg);
  }
}
origin: org.apache.brooklyn/brooklyn-core

public static void assertExecsSatisfy(List<ExecCmd> actuals, List<? extends Predicate<? super ExecCmd>> expectedCmds) {
  String errMsg = "actuals="+actuals+"; expected="+expectedCmds;
  assertTrue(actuals.size() >= expectedCmds.size(), "actualSize="+actuals.size()+"; expectedSize="+expectedCmds.size()+"; "+errMsg);
  for (int i = 0; i < expectedCmds.size(); i++) {
    assertExecSatisfies(actuals.get(i), expectedCmds.get(i), errMsg);
  }
}
origin: org.apache.brooklyn/brooklyn-core

public static void assertExecHasNever(List<ExecCmd> actuals, String expectedCmd) {
  assertExecHasExactly(actuals, expectedCmd, 0);
}
org.apache.brooklyn.util.core.internal.sshExecCmdAsserts

Most used methods

  • assertExecContains
  • assertExecSatisfies
  • assertExecHasExactly
  • assertExecHasOnlyOnce
  • assertExecNotContains
  • assertExecsContain
  • assertExecsNotContains
  • assertExecsSatisfy
  • findExecContaining

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Runner (org.openjdk.jmh.runner)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now