package org.apache.maven.changelog; /* ==================================================================== * Copyright 2001-2006 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 junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; import java.io.File; /** * Test cases for {@link org.apache.maven.changelog.ChangeLog} * @author Dennis Lundberg * @version $Id: ChangeLogTest.java 170200 2005-05-15 08:24:19 +0200 (sö, 15 maj 2005) brett $ */ public class ChangeLogTest extends TestCase { /** * Create a test with the given name * @param testName the name of the test */ public ChangeLogTest(String testName) { super(testName); } /** * Run the test using the {@link junit.textui.TestRunner} * @param args command line provided arguments */ public static void main(String[] args) { TestRunner.run(suite()); } /** * Create a test suite for this class * @return a {@link junit.framework.TestSuite} for all tests in this class */ public static Test suite() { return new TestSuite( ChangeLogTest.class); } /** * Initialize per test data */ public void setUp() { // instance = new ChangeLog(); // instance.setOutput( new File( "changelog.xml" ) ); // instance.setType( "tag" ); // instance.setTag( "MY_FIRST_TAG,MY_SECOND_TAG" ); // instance.setBasedir( new File( "." ) ); } /** * Test of doExecute method */ public void testDoExecuteColonColon() { ChangeLog instance; instance = new ChangeLog(); instance.setOutput( new File( "./changelog.xml" ) ); instance.setType( "tag" ); instance.setTag( "MY_FIRST_TAG,MY_SECOND_TAG" ); instance.setBasedir( new File( "." ) ); instance.setRepositoryConnection( "scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:site" ); try { instance.doExecute(); } catch ( Exception e ) { fail("Execute failed:" + e.getMessage()); } } /** * Test of doExecute method */ public void testDoExecuteColonVerticalBar() { ChangeLog instance; instance = new ChangeLog(); instance.setOutput( new File( "changelog.xml" ) ); instance.setType( "tag" ); instance.setTag( "MY_FIRST_TAG,MY_SECOND_TAG" ); instance.setBasedir( new File( "." ) ); instance.setRepositoryConnection( "scm:cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|site" ); try { instance.doExecute(); } catch ( Exception e ) { fail("Execute failed:" + e.getMessage()); } } /** * Test of doExecute method */ public void testDoExecuteVerticalBarVerticalBar() { ChangeLog instance; instance = new ChangeLog(); instance.setOutput( new File( "changelog.xml" ) ); instance.setType( "tag" ); instance.setTag( "MY_FIRST_TAG,MY_SECOND_TAG" ); instance.setBasedir( new File( "." ) ); instance.setRepositoryConnection( "scm|svn|http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/changelog/" ); try { instance.doExecute(); } catch ( Exception e ) { fail("Execute failed:" + e.getMessage()); } } }