Search in sources :

Example 1 with Settings

use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.

the class ClearCaseScmProviderRepositoryTest method testParsingUrlClearCaseUCMAutoConfigWithElement.

public void testParsingUrlClearCaseUCMAutoConfigWithElement() throws ScmRepositoryException {
    Settings settings = new Settings();
    settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM);
    String delimiter = "|";
    String loadPath = "/ua/sub/project";
    String vobName = "pvob_alliance";
    String streamName = "INT_COMMUN_V1.0";
    String elementName = "/main/element/LATEST";
    String url = "load " + loadPath + delimiter + vobName + delimiter + streamName + delimiter + elementName;
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertNull(repository.getConfigSpec());
    assertTrue(repository.isAutoConfigSpec());
    assertNotNull(repository.getViewName("bla"));
    assertEquals(loadPath, repository.getLoadDirectory());
    assertEquals(streamName, repository.getStreamName());
    assertEquals(vobName, repository.getVobName());
    assertEquals(elementName, repository.getElementName());
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Example 2 with Settings

use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.

the class ClearCaseScmProviderRepositoryTest method testParsingUrlWithoutViewName.

public void testParsingUrlWithoutViewName() throws ScmRepositoryException {
    Settings settings = new Settings();
    String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt";
    String url = configSpecPath;
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertEquals(new File(configSpecPath).getPath(), repository.getConfigSpec().getPath());
    assertNotNull(repository.getViewName("15"));
    assertTrue(repository.getViewName("15").indexOf("15") != -1);
    assertNull(repository.getLoadDirectory());
    assertNull(repository.getStreamName());
    assertNull(repository.getVobName());
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) File(java.io.File) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Example 3 with Settings

use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.

the class ClearCaseScmProviderRepositoryTest method testAutoConfigSpecWithColon.

public void testAutoConfigSpecWithColon() throws Exception {
    Settings settings = new Settings();
    String url = "my_view_name:load /VOB/some/dir";
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertNull(repository.getConfigSpec());
    assertTrue(repository.isAutoConfigSpec());
    assertEquals("my_view_name", repository.getViewName("bla"));
    assertEquals("/VOB/some/dir", repository.getLoadDirectory());
    assertNull(repository.getStreamName());
    assertNull(repository.getVobName());
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Example 4 with Settings

use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.

the class ClearCaseScmProviderRepositoryTest method testParsingUrlClearCaseUCMWithoutViewnameWithColon.

public void testParsingUrlClearCaseUCMWithoutViewnameWithColon() throws ScmRepositoryException {
    Settings settings = new Settings();
    settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM);
    String delimiter = ":";
    String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt";
    String vobName = "pvob_alliance";
    String streamName = "INT_COMMUN_V1.0";
    String url = configSpecPath + delimiter + vobName + delimiter + streamName;
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertEquals(new File(configSpecPath).getPath(), repository.getConfigSpec().getPath());
    assertNotNull(repository.getViewName("bla"));
    assertNull(repository.getLoadDirectory());
    assertEquals(streamName, repository.getStreamName());
    assertEquals(vobName, repository.getVobName());
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) File(java.io.File) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Example 5 with Settings

use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.

the class ClearCaseScmProviderRepositoryTest method testAutoConfigSpecWithPipe.

public void testAutoConfigSpecWithPipe() throws Exception {
    Settings settings = new Settings();
    String url = "my_view_name|load /VOB/some/dir";
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertNull(repository.getConfigSpec());
    assertTrue(repository.isAutoConfigSpec());
    assertEquals("my_view_name", repository.getViewName("bla"));
    assertEquals("/VOB/some/dir", repository.getLoadDirectory());
    assertNull(repository.getStreamName());
    assertNull(repository.getVobName());
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Aggregations

Settings (org.apache.maven.scm.providers.clearcase.settings.Settings)14 DefaultLog (org.apache.maven.scm.log.DefaultLog)12 File (java.io.File)7 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ClearcaseXpp3Reader (org.apache.maven.scm.providers.clearcase.settings.io.xpp3.ClearcaseXpp3Reader)1 Commandline (org.codehaus.plexus.util.cli.Commandline)1 XmlPullParserException (org.codehaus.plexus.util.xml.pull.XmlPullParserException)1