package com.perforce.maven.scm.provider.p4.util; import org.junit.Assert; import org.junit.Test; public class P4UrlParserTest { @Test public void testUrlWithEnvHost() { String p4PortEnv = System.getenv( P4ScmUrl.P4PORT_KEY ); if ( p4PortEnv == null ) { return; } P4ScmUrl p4ScmUrl = P4ScmUrl.parse( "scm:p4://depot/project" ); Assert.assertEquals( "//depot/project", p4ScmUrl.getPath() ); Assert.assertNotNull( p4ScmUrl.getHost() ); } @Test public void testUrlWithSystemPropertyHost() { // this prevents concurrent junit test String currentP4PortProp = System.getProperty( P4ScmUrl.P4PORT_KEY ); try { System.setProperty( P4ScmUrl.P4PORT_KEY, "host:3111" ); P4ScmUrl p4ScmUrl = P4ScmUrl.parse( "scm:p4:ssl:host://depot/project" ); Assert.assertEquals( "//depot/project", p4ScmUrl.getPath() ); Assert.assertEquals( "host", p4ScmUrl.getHost() ); Assert.assertNull( p4ScmUrl.getProtocol() ); Assert.assertEquals( 3111, p4ScmUrl.getPort() ); } finally { if ( currentP4PortProp != null ) { System.setProperty( P4ScmUrl.P4PORT_KEY, currentP4PortProp ); } } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 11616 | dantran | Honor P4USER env | ||
#6 | 11513 | dantran |
Allow .. (dotdot) notation inside the SCM URL. needed to by buildnumber-maven-plugin walk up the tree from a submodule SCM URL |
||
#5 | 11512 | dantran |
Allow .. (dotdot) notation inside the SCM URL. needed to by buildnumber-maven-plugin walk up the tree from a submodule SCM URL |
||
#4 | 9678 | dantran | add p4maven-settings test | ||
#3 | 9632 | dantran |
- use groupId:artifactId:version to test release automation - Implment p4maven-settings.xml's p4Port field |
||
#2 | 9628 | dantran | better P4ScmUrl parser | ||
#1 | 9590 | dantran |
- add option to fail tag when it already exist - add P4ScmUrl parser test - cleanup |