Examples of AccuRevCommandLine


Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

   *          the current date and time
   * @return the List of all detected modifications
   */
  public List getModifications(Date lastBuild, Date now) {
    LOG.info("Accurev: getting modifications for " + stream);
    AccurevCommandline hist = AccurevCommand.HIST.create();
    if (runner != null) {
      hist.setRunner(runner);
    }
    hist.setVerbose(verbose);
    hist.setInputParser(this);
    hist.setStream(stream);
    hist.setTransactionRange(new DateTimespec(lastBuild), new DateTimespec(now));
    hist.run();
    return modifications;
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

  }
  /**
   * Tests common "accurev hist" commandline configurations
   */
  public void testCommandLineHist() {
    AccurevCommandline hist;
    fake("accurev_hist_now.txt", 0);
    fake("accurev_hist_now_highest.txt", 0);
    fake("accurev_blank.txt", 1);
    fake("accurev_blank.txt", 1);
    fake("accurev_hist_highest.txt", 0);
    fake("accurev_hist_1-now.txt", 0);
    fake("accurev_syntax_error.txt", 0);
    hist = AccurevCommand.HIST.create(getMockRunner());
    hist.setTransactionRange(DateTimespec.NOW);
    hist.run();
    assertTrue(hist.isSuccess());
    hist = AccurevCommand.HIST.create(getMockRunner());
    hist.setTransactionRange(DateTimespec.NOW, TransactionNumberTimespec.HIGHEST);
    hist.run();
    assertTrue(hist.isSuccess());
    hist = AccurevCommand.HIST.create(getMockRunner());
    hist.setTransactionRange(new TransactionNumberTimespec(0), DateTimespec.NOW);
    hist.run();
    assertFalse(hist.isSuccess());
    hist = AccurevCommand.HIST.create(getMockRunner());
    hist.setTransactionRange(new TransactionNumberTimespec(0));
    hist.run();
    assertFalse(hist.isSuccess());
    hist = AccurevCommand.HIST.create(getMockRunner());
    hist.setTransactionRange(TransactionNumberTimespec.HIGHEST);
    hist.run();
    assertTrue(hist.isSuccess());
    hist = AccurevCommand.HIST.create(getMockRunner());
    hist.setTransactionRange(new TransactionNumberTimespec(1), DateTimespec.NOW);
    hist.run();
    assertTrue(hist.isSuccess());
    try {
      AccurevCommand.HIST.create().setWorkspaceLocalPath("ThisDirectoryIsNotSupposedToExist");
      fail("setWorkspace should throw an exception when the workspace is not valid");
    } catch (CruiseControlException e) {
      // An exception must be thrown.
    }
    hist = AccurevCommand.HIST.create(getMockRunner());
    assertFalse(hist.isSuccess());
    AccurevCommand.HIST.create(getMockRunner());
    hist.addArgument("--thisoptiondoesnotexist");
    hist.run();
    assertFalse(hist.isSuccess());
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

   * Checks the command line is built as expected
   */
  public void testCommandLineBuild() {
    Timespec d1 = new DateTimespec(-24);
    Timespec d2 = new DateTimespec(0);
    AccurevCommandline cmdKeep = AccurevCommand.KEEP.create();
    cmdKeep.selectModified();
    cmdKeep.setTransactionRange(d1, d2);
    cmdKeep.setComment("Automatic keep");
    assertEquals("accurev keep -m -t \"" + d1.toString() + "-" + d2.toString() + "\" -c \"Automatic keep\"",
        cmdKeep.toString());
    AccurevCommandline cmdHist = AccurevCommand.HIST.create();
    cmdHist.setTransactionRange(d1, d2);
    assertEquals("accurev hist -t \"" + d1.toString() + "-" + d2.toString() + "\"", cmdHist.toString());
    Commandline cmdUpdate = AccurevCommand.UPDATE.create();
    assertEquals("accurev update", cmdUpdate.toString());
    Commandline cmdSynctime = AccurevCommand.SYNCTIME.create();
    assertEquals("accurev synctime", cmdSynctime.toString());
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

   * Tests common "accurev keep" commandline configuration
   */
  public void testCommandLineKeep() {
    fake("accurev_keep_nofiles.txt", 0);
    fake("accurev_keep.txt", 0);
    AccurevCommandline keep;
    keep = AccurevCommand.KEEP.create(getMockRunner());
    assertFalse(keep.isSuccess());
    keep = AccurevCommand.KEEP.create(getMockRunner());
    keep.selectModified();
    keep.setComment("Automatic keep");
    keep.setVerbose(true);
    keep.run();
    assertTrue(keep.isSuccess());
    keep = AccurevCommand.KEEP.create(getMockRunner());
    keep.selectModified();
    keep.setComment("Automatic keep");
    keep.setVerbose(true);
    keep.run();
    assertTrue(keep.isSuccess());
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

   * Runs "accurev help" and looks for the support@accurev.com string. parseStream is defined as the
   * parsing callback
   */
  public void testCommandLineParse() {
    fake("accurev_help.txt", 0);
    AccurevCommandline help = AccurevCommand.HELP.create(getMockRunner());
    help.setInputParser(this);
    help.run();
    assertTrue(help.isSuccess());
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

   * Runs "accurev synctime"
   */
  public void testCommandLineSynctime() {
    fake("accurev_synctime.txt", 0);
    // you only have success after run
    AccurevCommandline synctime;
    synctime = AccurevCommand.SYNCTIME.create(getMockRunner());
    assertFalse(synctime.isSuccess());
    synctime = AccurevCommand.SYNCTIME.create(getMockRunner());
    synctime.run();
    assertTrue(synctime.isSuccess());
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

  /**
   * Runs "accurev update" in the default workspace
   */
  public void testCommandLineUpdate() {
    fake("accurev_update.txt", 0);
    AccurevCommandline update;
    update = AccurevCommand.UPDATE.create(getMockRunner());
    assertFalse(update.isSuccess());
    update = AccurevCommand.UPDATE.create(getMockRunner());
    update.run();
    assertTrue(update.isSuccess());
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

  /**
   * Picks the last stream name from a list of streams
   */
  private String getTestStreamName() {
    LineCollector collector = new LineCollector();
    AccurevCommandline show = AccurevCommand.SHOW.create(getMockRunner());
    show.addArgument("wspaces");
    show.setInputParser(collector);
    show.run();
    assertNotNull(collector.lines);
    assertTrue(collector.lines.size() > 1);
    return collector.lines.get(collector.lines.size() - 1).toString().split("[ \t]")[0];
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.sourcecontrols.accurev.AccurevCommandline

  public void bootstrap() throws CruiseControlException {
    if (synctime) {
      runAccurev(AccurevCommand.SYNCTIME.create());
    }
    if (keep) {
      AccurevCommandline cmdKeep = AccurevCommand.KEEP.create();
      cmdKeep.selectModified();
      cmdKeep.setComment("CruiseControl automatic keep");
      runAccurev(cmdKeep);
    }
    runAccurev(AccurevCommand.UPDATE.create());
  }
View Full Code Here

Examples of org.apache.maven.scm.provider.accurev.cli.AccuRevCommandLine

    @Test
    public void testUpstreamChangesIncludedInChangeLog()
        throws Exception
    {

        AccuRevCommandLine accurev = accurevTckTestUtil.getAccuRevCL();

        // UpdatingCopy is a workspace rooted at a substream
        String workingStream = accurevTckTestUtil.getWorkingStream();
        String subStream = accurevTckTestUtil.getDepotName() + "_sub_stream";
        accurev.mkstream( workingStream, subStream );

        ScmRepository mainRepository = getScmRepository();
        ScmProvider provider = getScmManager().getProviderByRepository( mainRepository );

        // Create a workspace at the updating copy location backed by the substream
        ScmBranch branch = new ScmBranch( "sub_stream" );
        provider.checkOut( mainRepository, new ScmFileSet( getUpdatingCopy() ), branch );

        Thread.sleep( 1000 );
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );

        // Make a timestamp that we know are after initial revision but before the second
        Date timeBeforeUpstreamCheckin = new Date(); // Current time

        // pause a couple seconds... [SCM-244]
        Thread.sleep( 2000 );

        // Make a change to the readme.txt and commit the change
        ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" );
        ScmTestCase.makeFile( getWorkingCopy(), "/src/test/java/Test.java", "changed Test.java" );
        CheckInScmResult checkInResult = provider.checkIn( mainRepository, fileSet, "upstream workspace promote" );
        assertTrue( "Unable to checkin changes to the repository", checkInResult.isSuccess() );

        Thread.sleep( 2000 );

        Date timeBeforeDownstreamCheckin = new Date();

        Thread.sleep( 2000 );

        ScmFileSet updateFileSet = new ScmFileSet( getUpdatingCopy() );
        provider.update( mainRepository, updateFileSet );
        ScmTestCase.makeFile( getUpdatingCopy(), "/pom.xml", "changed pom.xml" );
        ScmTestCase.makeFile( getUpdatingCopy(), "/src/test/java/Test.java", "changed again Test.java" );
        checkInResult = provider.checkIn( mainRepository, updateFileSet, "downstream workspace promote" );
        assertTrue( "Unable to checkin changes to the repository", checkInResult.isSuccess() );

        Thread.sleep( 2000 );

        Date timeBeforeDownstreamPromote = new Date();

        List<File> promotedFiles = new ArrayList<File>();
        accurev.promoteStream( subStream, "stream promote", promotedFiles );

        Thread.sleep( 2000 );

        Date timeEnd = new Date();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.