001package org.apache.maven.scm;
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 junit.framework.TestCase;
023
024/**
025 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse </a>
026 * @version $Id: ChangeLogFileTest.java,v 1.1.1.1 2004/04/20 19:05:52 jvanzyl
027 *          Exp $
028 */
029public class ChangeFileTest
030    extends TestCase
031{
032    public void testNewFile()
033    {
034        ChangeFile f = new ChangeFile( "test.java" );
035        assertEquals( "test.java", f.getName() );
036        assertEquals( null, f.getRevision() );
037        assertEquals( "test.java", f.toString() );
038    }
039
040    public void testNewFileRevision()
041    {
042        ChangeFile f = new ChangeFile( "test.java", "1.2.3" );
043        assertEquals( "test.java", f.getName() );
044        assertEquals( "1.2.3", f.getRevision() );
045        assertEquals( "test.java, 1.2.3", f.toString() );
046    }
047
048    public void testNewRevisionFile()
049    {
050        ChangeFile f = new ChangeFile( "test.java", "revision1" );
051        assertEquals( "test.java", f.getName() );
052        assertEquals( "revision1", f.getRevision() );
053        assertEquals( "test.java, revision1", f.toString() );
054    }
055}