Tabnine Logo
SshEffectorTasks.requirePidFromFileRunning
Code IndexAdd Tabnine to your IDE (free)

How to use
requirePidFromFileRunning
method
in
org.apache.brooklyn.core.effector.ssh.SshEffectorTasks

Best Java code snippets using org.apache.brooklyn.core.effector.ssh.SshEffectorTasks.requirePidFromFileRunning (Showing top 5 results out of 315)

origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testRequirePidFromFileOnSuccess() throws IOException {
  File f = File.createTempFile("testBrooklynPid", ".pid");
  Files.write( (""+getMyPid()).getBytes(), f );
  ProcessTaskWrapper<?> t = submit(SshEffectorTasks.requirePidFromFileRunning(f.getPath()));
  
  t.getTask().getUnchecked();
}
origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testRequirePidFromFileOnSuccessAcceptsWildcards() throws IOException {
  File f = File.createTempFile("testBrooklynPid", ".pid");
  Files.write( (""+getMyPid()).getBytes(), f );
  ProcessTaskWrapper<?> t = submit(SshEffectorTasks.requirePidFromFileRunning(f.getPath()+"*"));
  
  t.getTask().getUnchecked();
}
origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testRequirePidFromFileOnFailure() throws IOException {
  File f = File.createTempFile("testBrooklynPid", ".pid");
  Files.write( "99999".getBytes(), f );
  ProcessTaskWrapper<?> t = submit(SshEffectorTasks.requirePidFromFileRunning(f.getPath()));
  
  setExpectingFailure();
  try {
    t.getTask().getUnchecked();
  } catch (Exception e) {
    log.info("The error if required PID is not found is: "+e);
    clearExpectedFailure();
    Assert.assertTrue(e.toString().contains("Process with PID"), "Expected nice clue in error but got: "+e);
    Assert.assertEquals(t.getExitCode(), (Integer)1);
  }
  checkExpectedFailure();
}
origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testRequirePidFromFileOnFailureNoSuchFile() throws IOException {
  ProcessTaskWrapper<?> t = submit(SshEffectorTasks.requirePidFromFileRunning("/path/does/not/exist/SADVQW"));
  
  setExpectingFailure();
  try {
    t.getTask().getUnchecked();
  } catch (Exception e) {
    log.info("The error if required PID is not found is: "+e);
    clearExpectedFailure();
    Assert.assertTrue(e.toString().contains("Process with PID"), "Expected nice clue in error but got: "+e);
    Assert.assertEquals(t.getExitCode(), (Integer)1);
  }
  checkExpectedFailure();
}
origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testRequirePidFromFileOnFailureTooManyFiles() throws IOException {
  ProcessTaskWrapper<?> t = submit(SshEffectorTasks.requirePidFromFileRunning("/*"));
  
  setExpectingFailure();
  try {
    t.getTask().getUnchecked();
  } catch (Exception e) {
    log.info("The error if required PID is not found is: "+e);
    clearExpectedFailure();
    Assert.assertTrue(e.toString().contains("Process with PID"), "Expected nice clue in error but got: "+e);
    Assert.assertEquals(t.getExitCode(), (Integer)2);
  }
  checkExpectedFailure();
}
org.apache.brooklyn.core.effector.sshSshEffectorTasksrequirePidFromFileRunning

Javadoc

task which fails if the pid in the given file is not running (or if there is no such PID file); method accepts wildcards so long as they match a single file on the remote end (fails if 0 or 2+ matching files)

Popular methods of SshEffectorTasks

  • ssh
  • put
  • isPidFromFileRunning
    as #codePidFromFileRunning(String) but returning boolean
  • codePidRunning
    task which returns 0 if pid is running
  • isPidRunning
    as #codePidRunning(Integer) but returning boolean
  • codePidFromFileRunning
    task which returns 0 if pid in the given file is running; method accepts wildcards so long as they m
  • getSshFlags
    extracts the values for the main brooklyn.ssh.config.* config keys (i.e. those declared in ConfigKey
  • requirePidRunning
    task which fails if the given PID is not running
  • fetch

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JLabel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now