예제 #1
0
 @Test
 public void testMonitoring() throws IOException {
   String listCommand =
       "-p net.sourceforge.seqware.pipeline.plugins.WorkflowStatusChecker -- --tp 1000";
   String listOutput = ITUtility.runSeqWareJar(listCommand, ReturnValue.SUCCESS);
   Log.info(listOutput);
 }
예제 #2
0
 @Test
 public void testLaunchScheduled() throws IOException {
   // launch-scheduled
   String schedCommand =
       "-p net.sourceforge.seqware.pipeline.plugins.WorkflowLauncher -- --launch-scheduled";
   String schedOutput = ITUtility.runSeqWareJar(schedCommand, ReturnValue.SUCCESS);
   Log.info(schedOutput);
 }
예제 #3
0
  @Test
  public void testPackageBundleAndInstallSeparately() throws IOException {

    separateTempDir = Files.createTempDir();
    Log.info("Trying to package archetype at: " + separateTempDir.getAbsolutePath());
    PluginRunner it = new PluginRunner();
    String SEQWARE_VERSION = it.getClass().getPackage().getImplementationVersion();
    Assert.assertTrue("unable to detect seqware version", SEQWARE_VERSION != null);
    Log.info("SeqWare version detected as: " + SEQWARE_VERSION);

    File packageDir = Files.createTempDir();

    // for this test, we're going to create, install and package just one archetype. Doing more
    // seems redundant for this test
    String[] archetypes = {
      "java-workflow" /*, "simplified-ftl-workflow", "legacy-ftl-workflow", "simple-legacy-ftl-workflow"*/
    };
    for (String archetype : archetypes) {
      String workflow = "seqware-archetype-" + archetype;
      // generate and install archetypes to local maven repo
      String command =
          "mvn archetype:generate -DarchetypeCatalog=local -Dpackage=com.seqware.github -DgroupId=com.github.seqware -DarchetypeArtifactId="
              + workflow
              + " -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=com.github.seqware -DartifactId="
              + workflow
              + " -DworkflowDirectoryName="
              + workflow
              + " -DworkflowName="
              + workflow
              + " -DworkflowVersion=1.0-SNAPSHOT -B -Dgoals=install";
      String genOutput = ITUtility.runArbitraryCommand(command, 0, separateTempDir);
      Log.info(genOutput);
      // install the workflows to the database and record their information
      File workflowDir = new File(separateTempDir, workflow);
      File targetDir = new File(workflowDir, "target");
      File bundleDir =
          new File(
              targetDir,
              "Workflow_Bundle_" + workflow + "_1.0-SNAPSHOT_SeqWare_" + SEQWARE_VERSION);

      String packageCommand =
          "-p net.sourceforge.seqware.pipeline.plugins.BundleManager -verbose -- -b "
              + packageDir
              + " -p "
              + bundleDir.getAbsolutePath();
      String packageOutput = ITUtility.runSeqWareJar(packageCommand, ReturnValue.SUCCESS);
      Log.info(packageOutput);

      // locate the zip bundle and then install it
      File zippedBundle = new File(packageDir, bundleDir.getName() + ".zip");
      Assert.assertTrue(
          "zipped bundle " + zippedBundle.getAbsolutePath() + ".zip", zippedBundle.exists());

      String installCommand =
          "-p net.sourceforge.seqware.pipeline.plugins.BundleManager -verbose -- -b "
              + zippedBundle
              + " -i";
      String installOutput = ITUtility.runSeqWareJar(installCommand, ReturnValue.SUCCESS);
      Log.info(installOutput);
    }

    FileUtils.deleteDirectory(packageDir);
  }