Package com.splunk.shuttl.archiver.importexport

Examples of com.splunk.shuttl.archiver.importexport.ShellExecutor


  /**
   * @return {@link CsvImporter} with default construction logic.
   */
  public static CsvImporter create() {
    return new CsvImporter(new SplunkImportTool(), new ShellExecutor(
        Runtime.getRuntime()), new BucketFactory());
  }
View Full Code Here


    public void archiveBucket(LocalBucket bucket) {
      executeArchiveScript(bucket);
    }

    private void executeArchiveScript(LocalBucket bucket) {
      ShellExecutor shellExecutor = ShellExecutor.getInstance();
      Map<String, String> env = getSplunkHomeEnvironment();
      List<String> command = createCommand(bucket);
      int exit = shellExecutor.executeCommand(env, command);
      assertEquals(0, exit);
    }
View Full Code Here

    moveOriginalBucketBackToItsFirstLocation(movedBucketDirectory, bucket);
  }

  private void executeCopyScript(LocalBucket bucket, File copyScript,
      File movedBucketDirectory) {
    ShellExecutor shellExecutor = ShellExecutor.getInstance();
    Map<String, String> env = new HashMap<String, String>();
    env.put("SPLUNK_HOME", new File(splunkHome).getAbsolutePath());
    List<String> command = createCommand(bucket, copyScript,
        movedBucketDirectory, "additional-parameter-to-sleep-the-script");
    int exit = shellExecutor.executeCommand(env, command);
    assertEquals(exit, 0);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Test(expectedExceptions = { TgzImportFailedException.class })
  public void _unsuccessfulImport_throws() {
    ShellExecutor shellExecutor = mock(ShellExecutor.class);
    when(shellExecutor.executeCommand(anyMap(), anyList())).thenReturn(3);
    new TgzImporter(shellExecutor).importBucket(tgzBucket);
  }
View Full Code Here

  }

  private void executeWarmToColdRetryScript(String splunkHome) {
    HashMap<String, String> env = new HashMap<String, String>();
    env.put("SPLUNK_HOME", splunkHome);
    ShellExecutor shellExecutor = ShellExecutor.getInstance();
    int exit = shellExecutor.executeCommand(env,
        asList(getWarmToColdRetryScript(splunkHome).getAbsolutePath()));
    assertEquals(exit, 0);
  }
View Full Code Here

    assertTrue(coldToFrozenRetryScript.canExecute());
    return coldToFrozenRetryScript;
  }

  private void executeCommand(File coldToFrozenRetryScript) {
    ShellExecutor executor = ShellExecutor.getInstance();
    HashMap<String, String> env = new HashMap<String, String>();
    env.put("SPLUNK_HOME", System.getenv("SPLUNK_HOME"));
    int exit = executor.executeCommand(env,
        asList(coldToFrozenRetryScript.getAbsolutePath()));
    assertEquals(exit, 0);
  }
View Full Code Here

  private LocalBucket csvBucket;

  @BeforeMethod
  public void setUp() {
    SplunkImportTool importTool = new SplunkImportTool();
    ShellExecutor shellExecutor = new ShellExecutor(Runtime.getRuntime());
    integratedCsvImporter = new CsvImporter(importTool, shellExecutor,
        new BucketFactory());
    csvBucket = TUtilsBucket.createRealCsvBucket();
  }
View Full Code Here

TOP

Related Classes of com.splunk.shuttl.archiver.importexport.ShellExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.