|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2006, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2006, 2010 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 115-119
Link Here
|
| 115 |
assertEquals(null, cvsUri.getTag()); |
115 |
assertEquals(null, cvsUri.getTag()); |
| 116 |
assertEquals(cvsUri.toURI(), uri); |
116 |
assertEquals(cvsUri.toURI(), uri); |
| 117 |
} |
117 |
} |
|
|
118 |
|
| 119 |
// CVS SCM URL tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=231190 |
| 120 |
public void testRealLifeScmUriWithPde() throws URISyntaxException, CVSException { |
| 121 |
URI uri = new URI("scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core;tag=I20100912-2000"); |
| 122 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 123 |
assertEquals("org.eclipse.team.cvs.core", cvsUri.getPath().toString()); |
| 124 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:dev.eclipse.org:/cvsroot/eclipse"); |
| 125 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 126 |
assertEquals(cvsUri.getTag(), new CVSTag("I20100912-2000", CVSTag.VERSION)); |
| 127 |
} |
| 128 |
|
| 129 |
public void testRealLifeScmUriWithProperTag() throws URISyntaxException, CVSException { |
| 130 |
URI uri = new URI("scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core,version=I20100912-2000"); |
| 131 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 132 |
assertEquals("org.eclipse.team.cvs.core", cvsUri.getPath().toString()); |
| 133 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:dev.eclipse.org:/cvsroot/eclipse"); |
| 134 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 135 |
assertEquals(cvsUri.getTag(), new CVSTag("I20100912-2000", CVSTag.VERSION)); |
| 136 |
} |
| 118 |
|
137 |
|
|
|
138 |
public void testRealLifeScmUriWithoutTag() throws URISyntaxException, CVSException { |
| 139 |
URI uri = new URI("scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core"); |
| 140 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 141 |
assertEquals("org.eclipse.team.cvs.core", cvsUri.getPath().toString()); |
| 142 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:dev.eclipse.org:/cvsroot/eclipse"); |
| 143 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 144 |
assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); |
| 145 |
} |
| 146 |
|
| 147 |
// Example CVS SCM URIs from http://maven.apache.org/scm/cvs.html |
| 148 |
public void testMavenScmUriExampleWithEmptyPassword() throws URISyntaxException, CVSException { |
| 149 |
URI uri = new URI("scm:cvs:pserver:anoncvs:@cvs.apache.org:/cvs/root:module"); |
| 150 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 151 |
assertEquals("module", cvsUri.getPath().toString()); |
| 152 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:anoncvs:@cvs.apache.org:/cvs/root"); |
| 153 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 154 |
assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); |
| 155 |
} |
| 156 |
|
| 157 |
public void testMavenScmUriExampleWithPipe() throws CVSException, URISyntaxException { |
| 158 |
URI uri = new URI("scm:cvs|pserver|username@localhost|C:/Program Files/cvsnt/repositories|module_name"); |
| 159 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 160 |
assertEquals("module_name", cvsUri.getPath().toString()); |
| 161 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:username@localhost:C:/Program Files/cvsnt/repositories"); |
| 162 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 163 |
assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); |
| 164 |
} |
| 165 |
|
| 166 |
public void testMavenScmUriExample() throws URISyntaxException, CVSException { |
| 167 |
URI uri = new URI("scm:cvs:ext:username@cvs.apache.org:/cvs/root:module"); |
| 168 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 169 |
assertEquals("module", cvsUri.getPath().toString()); |
| 170 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":ext:username@cvs.apache.org:/cvs/root"); |
| 171 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 172 |
assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); |
| 173 |
} |
| 174 |
|
| 175 |
// local and sspi methods are not supported |
| 176 |
/* |
| 177 |
public void testMavenScmUriExamplesParse4() throws URISyntaxException, CVSException { |
| 178 |
URI uri = new URI("scm:cvs:local:/cvs/root:module"); |
| 179 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 180 |
assertEquals("module", cvsUri.getPath().toString()); |
| 181 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":local:@dev.eclipse.org:/cvs/root"); |
| 182 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 183 |
assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); |
| 184 |
} |
| 185 |
|
| 186 |
public void testMavenScmUriExamplesParse5() throws URISyntaxException, CVSException { |
| 187 |
URI uri = new URI("scm:cvs:sspi:cvs.apache.org:2222:/cvs/root:module"); |
| 188 |
CVSURI cvsUri = CVSURI.fromUri(uri); |
| 189 |
assertEquals("module", cvsUri.getPath().toString()); |
| 190 |
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":sspi:@cvs.apache.org:2222:/cvs/root"); |
| 191 |
assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); |
| 192 |
assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); |
| 193 |
} |
| 194 |
*/ |
| 195 |
|
| 119 |
} |
196 |
} |