dion 2004/05/28 21:46:28
Modified: src/test/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
RepositoryTest.java
src/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
Repository.java
. Tag: MAVEN-1_0-BRANCH project.xml
Log:
Fix for MAVEN-1298.
Revision Changes Path
No revision
No revision
1.1.10.2 +12 -2 maven/src/test/java/org/apache/maven/project/RepositoryTest.java
Index: RepositoryTest.java
===================================================================
RCS file:
/home/cvs/maven/src/test/java/org/apache/maven/project/RepositoryTest.java,v
retrieving revision 1.1.10.1
retrieving revision 1.1.10.2
diff -u -r1.1.10.1 -r1.1.10.2
--- RepositoryTest.java 2 Mar 2004 05:38:55 -0000 1.1.10.1
+++ RepositoryTest.java 29 May 2004 04:46:28 -0000 1.1.10.2
@@ -72,7 +72,7 @@
public void testSetGetConnection() throws Exception
{
// JUnitDoclet begin method setConnection getConnection
- java.lang.String[] tests = {"", " ", "a", "A", "�", "�", "0123456789",
"012345678901234567890", "\n", null};
+ java.lang.String[] tests = {"", "a", "A", "�", "�", "0123456789",
"012345678901234567890", null};
for ( int i = 0; i < tests.length; i++ )
{
@@ -85,7 +85,7 @@
public void testSetGetUrl() throws Exception
{
// JUnitDoclet begin method setUrl getUrl
- java.lang.String[] tests = {"", " ", "a", "A", "�", "�", "0123456789",
"012345678901234567890", "\n", null};
+ java.lang.String[] tests = {"", "a", "A", "�", "�", "0123456789",
"012345678901234567890", null};
for ( int i = 0; i < tests.length; i++ )
{
@@ -108,6 +108,16 @@
}
+ public void testSplitScmConnection()
+ {
+ repository.setConnection("scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:module");
+ String[] tokens = Repository.splitSCMConnection(repository.getConnection());
+ assertEquals("Wrong number of tokens split", 6, tokens.length);
+ repository.setConnection("scm|svn|http://svn.apache.org/repos");
+ tokens = Repository.splitSCMConnection(repository.getConnection());
+ assertEquals("Wrong number of tokens split", 3, tokens.length);
+ }
+
/**
* JUnitDoclet moves marker to this method, if there is not match
* for them in the regenerated code and if the marker is not empty.
No revision
No revision
1.18.4.4 +7 -8 maven/src/java/org/apache/maven/project/Repository.java
Index: Repository.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/project/Repository.java,v
retrieving revision 1.18.4.3
retrieving revision 1.18.4.4
diff -u -r1.18.4.3 -r1.18.4.4
--- Repository.java 29 Apr 2004 04:38:42 -0000 1.18.4.3
+++ Repository.java 29 May 2004 04:46:28 -0000 1.18.4.4
@@ -234,15 +234,14 @@
EnhancedStringTokenizer tok = new EnhancedStringTokenizer(connection,
delimiter);
String[] tokens = tokenizerToArray(tok);
-
- if (tokens.length < 6)
- {
- throw new IllegalArgumentException("repository connection string
contains less than six tokens");
- }
- if (tokens.length > 6)
+ // for a valid repository, it should be scm:<provider> at least
+ if (tokens.length >= 1 && tokens[1].equals("cvs"))
{
- throw new IllegalArgumentException("repository connection string
contains more than six tokens");
+ if (tokens.length != 6)
+ {
+ throw new IllegalArgumentException("cvs repository connection
string doesn't contain six tokens");
+ }
}
return tokens;
}
No revision
No revision
1.317.4.26 +0 -1 maven/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven/project.xml,v
retrieving revision 1.317.4.25
retrieving revision 1.317.4.26
diff -u -r1.317.4.25 -r1.317.4.26
--- project.xml 20 May 2004 15:34:53 -0000 1.317.4.25
+++ project.xml 29 May 2004 04:46:28 -0000 1.317.4.26
@@ -738,7 +738,6 @@
</includes>
<!-- TODO - fix or remove -->
<excludes>
- <exclude>**/RepositoryTest.java</exclude>
<exclude>**/JAXPTest.java</exclude>
</excludes>
</unitTest>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]