Search in sources :

Example 6 with Settings

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

the class ClearCaseScmProviderRepositoryTest method testParsingUrlWithColon.

public void testParsingUrlWithColon() throws ScmRepositoryException {
    Settings settings = new Settings();
    String viewName = "my_module_view";
    String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt";
    String url = viewName + ":" + configSpecPath;
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertEquals(new File(configSpecPath).getPath(), repository.getConfigSpec().getPath());
    assertEquals(viewName, repository.getViewName("bla"));
    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 7 with Settings

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

the class ClearCaseCheckOutCommandTest method setUp.

public void setUp() throws Exception {
    super.setUp();
    checkOutCommand = new ClearCaseCheckOutCommand();
    checkOutCommand.setLogger(new DefaultLog());
    settings = new Settings();
    checkOutCommand.setSettings(settings);
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Example 8 with Settings

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

the class ClearCaseUtil method readSettings.

public static Settings readSettings() {
    File settingsFile = new File(settingsDirectory, CLEARCASE_SETTINGS_FILENAME);
    if (!settingsFile.exists()) {
        File scmGlobalDir = new File(System.getProperty("maven.home"), "conf");
        settingsFile = new File(scmGlobalDir, CLEARCASE_SETTINGS_FILENAME);
    }
    if (settingsFile.exists()) {
        ClearcaseXpp3Reader reader = new ClearcaseXpp3Reader();
        try {
            return reader.read(ReaderFactory.newXmlReader(settingsFile));
        } catch (FileNotFoundException e) {
        // nop
        } catch (IOException e) {
        // nop
        } catch (XmlPullParserException e) {
            String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage();
            System.out.println(message);
        }
    }
    return new Settings();
}
Also used : ClearcaseXpp3Reader(org.apache.maven.scm.providers.clearcase.settings.io.xpp3.ClearcaseXpp3Reader) FileNotFoundException(java.io.FileNotFoundException) XmlPullParserException(org.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException) File(java.io.File) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Example 9 with Settings

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

the class ClearCaseScmProviderRepositoryTest method testParsingUrlWithPipe.

public void testParsingUrlWithPipe() throws ScmRepositoryException, IOException {
    Settings settings = new Settings();
    String viewName = "my_module_view";
    String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt";
    String url = viewName + "|" + configSpecPath;
    ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
    assertEquals(new File(configSpecPath).getPath(), repository.getConfigSpec().getPath());
    assertEquals(viewName, repository.getViewName("bla"));
    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 10 with Settings

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

the class ClearCaseScmProviderRepositoryTest method testParsingUrlClearCaseUCMAutoConfig.

public void testParsingUrlClearCaseUCMAutoConfig() 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 url = "load " + loadPath + delimiter + vobName + delimiter + streamName;
    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());
}
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