ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/optional/vss MSVSSTest.java
Date Wed, 16 Apr 2003 15:20:24 GMT
jesse       2003/04/16 08:20:24

  Modified:    src/testcases/org/apache/tools/ant/taskdefs/optional/vss
                        MSVSSTest.java
  Log:
  Missed updated testcase in previous commit
  
  Revision  Changes    Path
  1.3       +40 -7     ant/src/testcases/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java
  
  Index: MSVSSTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MSVSSTest.java	10 Feb 2003 14:14:55 -0000	1.2
  +++ MSVSSTest.java	16 Apr 2003 15:20:24 -0000	1.3
  @@ -71,7 +71,7 @@
    *
    * @author Jesse Stockall
    */
  -public class MSVSSTest extends BuildFileTest {
  +public class MSVSSTest extends BuildFileTest implements MSVSSConstants {
   
       private Project project;
       private Commandline commandline;
  @@ -84,6 +84,7 @@
       private static final String LOCAL_PATH = "testdir";
       private static final String SRC_FILE = "Class1.java";
       private static final String SRC_LABEL = "label1";
  +    private static final String LONG_LABEL = "123456789012345678901234567890";
       private static final String SRC_COMMENT = "I fixed a bug";
       private static final String VERSION = "007";
       private static final String DATE = "00-00-00";
  @@ -107,7 +108,6 @@
        */
       protected void setUp()
           throws Exception {
  -        ;
           project = new Project();
           project.setBasedir(".");
       }
  @@ -131,7 +131,7 @@
                   MSVSS.FLAG_OVERRIDE_WORKING_DIR + project.getBaseDir().getAbsolutePath()
                    + File.separator + LOCAL_PATH, MSVSS.FLAG_AUTORESPONSE_DEF,
                   MSVSS.FLAG_RECURSION, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN
  -                 + VSS_USERNAME + "," + VSS_PASSWORD};
  +                 + VSS_USERNAME + "," + VSS_PASSWORD, FLAG_FILETIME_UPDATED, FLAG_SKIP_WRITABLE};
   
           // Set up a VSSGet task
           MSVSSGET vssGet = new MSVSSGET();
  @@ -144,6 +144,12 @@
           vssGet.setDate(DATE);
           vssGet.setLabel(SRC_LABEL);
           vssGet.setVsspath(VSS_PROJECT_PATH);
  +        MSVSS.CurrentModUpdated cmu = new MSVSS.CurrentModUpdated();
  +        cmu.setValue(TIME_UPDATED);
  +        vssGet.setFileTimeStamp(cmu);
  +        MSVSS.WritableFiles wf = new MSVSS.WritableFiles();
  +        wf.setValue(WRITABLE_SKIP);
  +        vssGet.setWritableFiles(wf);
   
           commandline = vssGet.buildCmdLine();
   
  @@ -157,7 +163,7 @@
       }
   
       /**  Tests Label commandline generation.  */
  -    public void testLabelCommandLine() {
  +    public void testLabelCommandLine1() {
           String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH,
                   MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_YES,
                   MSVSS.FLAG_LABEL + SRC_LABEL, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN
  @@ -178,6 +184,26 @@
           checkCommandLines(sTestCmdLine, commandline.getCommandline());
       }
   
  +    /**  Tests Label commandline generation with a label of more than 31 chars.  */
  +    public void testLabelCommandLine2() {
  +        String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH,
  +                MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_DEF,
  +                MSVSS.FLAG_LABEL + LONG_LABEL,
  +                MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD};
  +
  +        // Set up a VSSLabel task
  +        MSVSSLABEL vssLabel = new MSVSSLABEL();
  +        vssLabel.setProject(project);
  +        vssLabel.setComment(SRC_COMMENT);
  +        vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
  +        vssLabel.setLabel(LONG_LABEL + "blahblah");
  +        vssLabel.setVsspath(VSS_PROJECT_PATH);
  +
  +        commandline = vssLabel.buildCmdLine();
  +
  +        checkCommandLines(sTestCmdLine, commandline.getCommandline());
  +    }
  +
       /**
        * Test VSSLabel required attributes.
        */
  @@ -190,7 +216,7 @@
       /**  Tests VSSHistory commandline generation with from label.  */
       public void testHistoryCommandLine1() {
           String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_HISTORY, DS_VSS_PROJECT_PATH,
  -                MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_VERSION_LABEL + SRC_LABEL
  +                MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_VERSION_LABEL + LONG_LABEL
                    + MSVSS.VALUE_FROMLABEL + SRC_LABEL, MSVSS.FLAG_LOGIN + VSS_USERNAME
                    + "," + VSS_PASSWORD, MSVSS.FLAG_OUTPUT + project.getBaseDir().getAbsolutePath()
                    + File.separator + OUTPUT};
  @@ -202,7 +228,7 @@
           vssHistory.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
   
           vssHistory.setFromLabel(SRC_LABEL);
  -        vssHistory.setToLabel(SRC_LABEL);
  +        vssHistory.setToLabel(LONG_LABEL + "blahblah");
           vssHistory.setVsspath(VSS_PROJECT_PATH);
           vssHistory.setRecursive(false);
           vssHistory.setOutput(new File(project.getBaseDir().getAbsolutePath(), OUTPUT));
  @@ -307,7 +333,8 @@
       public void testCheckoutCommandLine() {
           String[] sTestCmdLine = {SS_DIR + File.separator + MSVSS.SS_EXE, MSVSS.COMMAND_CHECKOUT,
                   DS_VSS_PROJECT_PATH, MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_RECURSION,
  -                MSVSS.FLAG_VERSION_DATE + DATE, MSVSS.FLAG_LOGIN + VSS_USERNAME};
  +                MSVSS.FLAG_VERSION_DATE + DATE, MSVSS.FLAG_LOGIN + VSS_USERNAME,
  +                FLAG_FILETIME_MODIFIED, FLAG_NO_GET};
   
           // Set up a VSSCheckOut task
           MSVSSCHECKOUT vssCheckout = new MSVSSCHECKOUT();
  @@ -316,7 +343,12 @@
           vssCheckout.setVsspath(DS_VSS_PROJECT_PATH);
           vssCheckout.setRecursive(true);
           vssCheckout.setDate(DATE);
  +        vssCheckout.setLabel(SRC_LABEL);
           vssCheckout.setSsdir(SS_DIR);
  +        MSVSS.CurrentModUpdated cmu = new MSVSS.CurrentModUpdated();
  +        cmu.setValue(TIME_MODIFIED);
  +        vssCheckout.setFileTimeStamp(cmu);
  +        vssCheckout.setGetLocalCopy(false);
   
           commandline = vssCheckout.buildCmdLine();
   
  @@ -329,6 +361,7 @@
       public void testCheckoutExceptions() {
           configureProject("src/etc/testcases/taskdefs/optional/vss/vss.xml");
           expectSpecificBuildException("vsscheckout.1", "some cause", "vsspath attribute
must be set!");
  +        expectSpecificBuildException("vsscheckout.2", "some cause", "blah is not a legal
value for this attribute");
       }
   
       /**  Tests Add commandline generation.  */
  
  
  

Mime
View raw message