dion 2004/07/09 05:37:36
Modified: changelog/src/main/org/apache/maven/clearcaselib
ClearcaseChangeLogParser.java
changelog/xdocs changes.xml
Added: changelog/src/test-resources/clearcaselib clearcaselog.txt
changelog/src/test/org/apache/maven/clearcaselib
ClearcaseChangeLogParserTest.java
Log:
changelog.xml author tag in Clearcase contains developer.id.
Revision Changes Path
1.1
maven-plugins/changelog/src/test-resources/clearcaselib/clearcaselog.txt
Index: clearcaselog.txt
===================================================================
NAME:PartyManager\src\java\uk\co\mycompany\corppay\refdata\model\Submission.java
DATE:20040630.145714
COMM:checkin - checkin - Added status constants.
- Activity: Acceptance_Tests_For_Release_to_Instruction_Processor
USER:88888888
NAME:PartyManager\src\java\uk\co\mycompany\util\hibernate
DATE:20040630.143802
COMM:checkin - checkin - Added storing of data.
- Activity: Acceptance_Tests_For_Release_to_Instruction_Processor
USER:55555
NAME:PartyManager\src\java\uk\co\mycompany\corppay\refdata\model\Submission.java
DATE:20040630.143759
COMM:checkin - checkin - Added storing of data.
- Activity: Acceptance_Tests_For_Release_to_Instruction_Processor
USER:martenss
1.5 +1 -1
maven-plugins/changelog/src/main/org/apache/maven/clearcaselib/ClearcaseChangeLogParser.java
Index: ClearcaseChangeLogParser.java
===================================================================
RCS file:
/home/cvs/maven-plugins/changelog/src/main/org/apache/maven/clearcaselib/ClearcaseChangeLogParser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ClearcaseChangeLogParser.java 8 Jul 2004 08:36:51 -0000 1.4
+++ ClearcaseChangeLogParser.java 9 Jul 2004 12:37:36 -0000 1.5
@@ -250,7 +250,7 @@
}
else if (line.startsWith(USER_TAG))
{
- getCurrentLogEntry().setAuthor(line.substring(USER_TAG.length()));
+
getCurrentLogEntry().setAuthor(line.substring(USER_TAG.length()).trim());
// add entry, and set state to get file
addEntry(getCurrentLogEntry(), getCurrentFile());
setStatus(GET_FILE);
1.39 +1 -0 maven-plugins/changelog/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/changelog/xdocs/changes.xml,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- changes.xml 9 Jul 2004 11:53:46 -0000 1.38
+++ changes.xml 9 Jul 2004 12:37:36 -0000 1.39
@@ -26,6 +26,7 @@
</properties>
<body>
<release version="1.7.1-SNAPSHOT" date="in CVS">
+ <action dev="dion" type="fix" issue="MPCHANGELOG-36" due-to="Matt
Read">changelog.xml author tag in Clearcase contains developer.id.</action>
<action dev="dion" type="fix" issue="MPCHANGELOG-34" due-to="Saito
Kazuo">Plugin does not find the password for the CVSROOT in .cvspass if the CVSROOT in
.cvspass is preceded by a "/1".</action>
</release>
<release version="1.7" date="2004-07-08">
1.1
maven-plugins/changelog/src/test/org/apache/maven/clearcaselib/ClearcaseChangeLogParserTest.java
Index: ClearcaseChangeLogParserTest.java
===================================================================
package org.apache.maven.clearcaselib;
/* ====================================================================
* Copyright 2001-2004 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 java.io.FileInputStream;
import java.util.Collection;
import java.util.Iterator;
import junit.framework.TestCase;
import org.apache.maven.changelog.ChangeLogEntry;
/**
*/
public class ClearcaseChangeLogParserTest extends TestCase {
/** the [EMAIL PROTECTED] ClearcaseChangeLogParser}used for testing */
private ClearcaseChangeLogParser instance;
/** file with test results to check against */
private String testFile;
/**
* Create a test with the given name
*
* @param testName
* the name of the test
*/
public ClearcaseChangeLogParserTest(String testName) {
super(testName);
}
/**
* Initialize per test data
*
* @throws Exception
* when there is an unexpected problem
*/
public void setUp() throws Exception {
String baseDir = System.getProperty("basedir");
assertNotNull("The system property basedir was not defined.", baseDir);
testFile = baseDir
+ "/src/test-resources/clearcaselib/clearcaselog.txt";
instance = new ClearcaseChangeLogParser();
}
/**
* Test of parse method
*
* @throws Exception
* when there is an unexpected problem
*/
public void testParse() throws Exception {
FileInputStream fis = new FileInputStream(testFile);
Collection entries = instance.parse(fis);
assertEquals("Wrong number of entries returned", 3, entries.size());
ChangeLogEntry entry = null;
for (Iterator i = entries.iterator(); i.hasNext();) {
entry = (ChangeLogEntry) i.next();
assertTrue("ChangeLogEntry erroneously picked up", entry.toString()
.indexOf("ChangeLogEntry.java") == -1);
}
}
public void testParseCorrectUsername() throws Exception {
// parse the test file
FileInputStream fis = new FileInputStream(testFile);
Collection entries = instance.parse(fis);
// check 8 char usernames are parsed correctly
Iterator i = entries.iterator();
ChangeLogEntry entry = (ChangeLogEntry) i.next();
assertEquals("exactly 8 chars expected", "88888888", entry.getAuthor());
// check < 8 char usernames are parsed correctly
entry = (ChangeLogEntry) i.next();
assertEquals("exactly 5 chars expected", "55555", entry.getAuthor());
}
// Add test methods here, they have to start with 'test' name.
// for example:
// public void testHello() {}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]