001package org.apache.maven.scm.provider.vss.commands.status;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 * http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.maven.scm.ScmFileSet;
023import org.apache.maven.scm.ScmTestCase;
024import org.apache.maven.scm.manager.ScmManager;
025import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils;
026import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
027import org.apache.maven.scm.repository.ScmRepository;
028import org.codehaus.plexus.util.cli.Commandline;
029
030import java.io.File;
031
032/**
033 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
034 *
035 */
036public class VssStatusCommandTest
037    extends ScmTestCase
038{
039    private ScmManager scmManager;
040
041    public void setUp()
042        throws Exception
043    {
044        super.setUp();
045
046        scmManager = getScmManager();
047    }
048
049    public void testCommandLine()
050        throws Exception
051    {
052        ScmRepository repository = scmManager
053            .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" );
054        ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) );
055        VssStatusCommand command = new VssStatusCommand();
056        Commandline cl = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet );
057        String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar );
058        assertCommandLine( ssPath + "ss Diff $D:/myProject -Yusername,password -R -I-", fileSet.getBasedir(), cl );
059    }
060}