Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 189   Methods: 5
NCLOC: 32   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MSVSSCREATE.java 0% 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 
 55   
 package org.apache.tools.ant.taskdefs.optional.vss;
 56   
 
 57   
 import org.apache.tools.ant.BuildException;
 58   
 import org.apache.tools.ant.types.Commandline;
 59   
 
 60   
 /**
 61   
  * Creates a new project in Microsoft Visual SourceSafe.
 62   
  * <p>
 63   
  * The following attributes are interpreted:
 64   
  * <table border="1">
 65   
  *   <tr>
 66   
  *     <th>Attribute</th>
 67   
  *     <th>Values</th>
 68   
  *     <th>Required</th>
 69   
  *   </tr>
 70   
  *   <tr>
 71   
  *      <td>login</td>
 72   
  *      <td>username,password</td>
 73   
  *      <td>No</td>
 74   
  *   </tr>
 75   
  *   <tr>
 76   
  *      <td>vsspath</td>
 77   
  *      <td>SourceSafe path of project to be created</td>
 78   
  *      <td>Yes</td>
 79   
  *   </tr>
 80   
  *   <tr>
 81   
  *      <td>ssdir</td>
 82   
  *      <td>directory where <code>ss.exe</code> resides. By default the task
 83   
  *      expects it to be in the PATH.</td>
 84   
  *      <td>No</td>
 85   
  *   </tr>
 86   
  *   <tr>
 87   
  *      <td>quiet</td>
 88   
  *      <td>suppress output (off by default)</td>
 89   
  *      <td>No</td>
 90   
  *   </tr>
 91   
  *   <tr>
 92   
  *      <td>failOnError</td>
 93   
  *      <td>fail if there is an error creating the project (true by default)</td>
 94   
  *      <td>No</td>
 95   
  *   </tr>
 96   
  *   <tr>
 97   
  *      <td>autoresponse</td>
 98   
  *      <td>What to respond with (sets the -I option). By default, -I- is
 99   
  *      used; values of Y or N will be appended to this.</td>
 100   
  *      <td>No</td>
 101   
  *   </tr>
 102   
  *   <tr>
 103   
  *      <td>comment</td>
 104   
  *      <td>The comment to use for this label. Empty or '-' for no comment.</td>
 105   
  *      <td>No</td>
 106   
  *   </tr>
 107   
  *
 108   
  * </table>
 109   
  *
 110   
  * @author Gary S. Weaver
 111   
  * @author Jesse Stockall
 112   
  *
 113   
  * @ant.task name="vsscreate" category="scm"
 114   
  */
 115   
 public class MSVSSCREATE extends MSVSS {
 116   
 
 117   
     /**
 118   
      * Builds a command line to execute ss.
 119   
      * @return     The constructed commandline.
 120   
      */
 121  0
     Commandline buildCmdLine() {
 122  0
         Commandline commandLine = new Commandline();
 123   
 
 124   
         // first off, make sure that we've got a command and a vssdir...
 125  0
         if (getVsspath() == null) {
 126  0
             String msg = "vsspath attribute must be set!";
 127  0
             throw new BuildException(msg, getLocation());
 128   
         }
 129   
 
 130   
         // build the command line from what we got
 131   
         // the format is:
 132   
         // ss Create VSS items [-C] [-H] [-I-] [-N] [-O] [-S] [-Y] [-?]
 133   
         // as specified in the SS.EXE help
 134  0
         commandLine.setExecutable(getSSCommand());
 135  0
         commandLine.createArgument().setValue(COMMAND_CREATE);
 136   
 
 137   
         // VSS items
 138  0
         commandLine.createArgument().setValue(getVsspath());
 139   
         // -C
 140  0
         commandLine.createArgument().setValue(getComment());
 141   
         // -I- or -I-Y or -I-N
 142  0
         commandLine.createArgument().setValue(getAutoresponse());
 143   
         // -O-
 144  0
         commandLine.createArgument().setValue(getQuiet());
 145   
         // -Y
 146  0
         commandLine.createArgument().setValue(getLogin());
 147   
 
 148  0
         return commandLine;
 149   
     }
 150   
 
 151   
     /**
 152   
      * Sets the comment to apply in SourceSafe.; optional.
 153   
      * <p>
 154   
      * If this is null or empty, it will be replaced with "-" which
 155   
      * is what SourceSafe uses for an empty comment.
 156   
      * @param comment The comment to apply in SourceSafe
 157   
      */
 158  0
     public void setComment(String comment) {
 159  0
         super.setInternalComment(comment);
 160   
     }
 161   
 
 162   
     /**
 163   
      * Sets/clears quiet mode; optional, default false.
 164   
      * @param   quiet The boolean value for quiet.
 165   
      */
 166  0
     public final void setQuiet (boolean quiet) {
 167  0
         super.setInternalQuiet(quiet);
 168   
     }
 169   
 
 170   
     /**
 171   
      * Sets behaviour, whether task should fail if there is an error creating
 172   
      * the project.; optional, default true
 173   
      * @param failOnError True if task should fail on any error.
 174   
      */
 175  0
     public final void setFailOnError (boolean failOnError) {
 176  0
         super.setInternalFailOnError(failOnError);
 177   
     }
 178   
 
 179   
     /**
 180   
      * Sets the autoresponce behaviour.; optional.
 181   
      * <p>
 182   
      * Valid options are Y and N.
 183   
      * @param response The auto response value.
 184   
      */
 185  0
     public void setAutoresponse(String response) {
 186  0
         super.setInternalAutoResponse(response);
 187   
     }
 188   
 }
 189