blob: f789ecdedb1df7772874e06d7f139a1115373c61 [file] [log] [blame]
package org.apache.maven.scm.provider.svn.command.changelog;
/*
* Copyright 2003-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;
import java.io.File;
import java.util.Date;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id$
*/
public class SvnChangeLogCommandTest
extends ScmTestCase
{
public void testCommandLine()
throws Exception
{
Date startDate = getDate( 2003, 8, 10, GMT_TIME_ZONE );
Date endDate = getDate( 2003, 9, 10, GMT_TIME_ZONE );
testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, startDate, endDate,
"svn --non-interactive log -v -r \"{2003/09/10 GMT}:{2003/10/10 GMT}\" http://foo.com/svn/trunk" );
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
private void testCommandLine( String scmUrl, String tag, Date startDate, Date endDate, String commandLine )
throws Exception
{
File workingDirectory = getTestFile( "target/svn-update-command-test" );
ScmRepository repository = getScmManager().makeScmRepository( scmUrl );
SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository();
Commandline cl = SvnChangeLogCommand.createCommandLine( svnRepository, workingDirectory, tag, startDate,
endDate );
assertEquals( commandLine, cl.toString() );
}
}