use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.
the class ClearCaseScmProviderRepositoryTest method testParsingUrlClearCaseUCMWithPipe.
public void testParsingUrlClearCaseUCMWithPipe() throws ScmRepositoryException {
Settings settings = new Settings();
settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM);
String delimiter = "|";
String viewName = "my_module_view";
String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt";
String vobName = "pvob_alliance";
String streamName = "INT_COMMUN_V1.0";
String url = viewName + delimiter + configSpecPath + delimiter + vobName + delimiter + streamName;
ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
assertEquals(new File(configSpecPath).getPath(), repository.getConfigSpec().getPath());
assertEquals(viewName, repository.getViewName("bla"));
assertNull(repository.getLoadDirectory());
assertEquals(streamName, repository.getStreamName());
assertEquals(vobName, repository.getVobName());
}
use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.
the class ClearCaseScmProviderRepositoryTest method testAutoConfigSpecWithoutViewName.
public void testAutoConfigSpecWithoutViewName() throws Exception {
Settings settings = new Settings();
String url = "load /VOB/some/dir";
ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository(new DefaultLog(), url, settings);
assertNull(repository.getConfigSpec());
assertTrue(repository.isAutoConfigSpec());
assertNotNull(repository.getViewName("15"));
assertTrue(repository.getViewName("15").indexOf("15") != -1);
assertEquals("/VOB/some/dir", repository.getLoadDirectory());
assertNull(repository.getStreamName());
assertNull(repository.getVobName());
}
use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.
the class ClearCaseScmProviderRepositoryTest method testParsingUrlClearCaseUCMWithoutViewnameWithColonAndElement.
public void testParsingUrlClearCaseUCMWithoutViewnameWithColonAndElement() 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 elementName = "/main/element/LATEST";
String url = configSpecPath + delimiter + vobName + delimiter + streamName + delimiter + elementName;
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());
assertEquals(elementName, repository.getElementName());
}
use of org.apache.maven.scm.providers.clearcase.settings.Settings in project maven-scm by apache.
the class ClearCaseChangeLogCommand method createCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
/**
* ClearCase LT version doesn't support the attribut -fmt and -since for command lhistory.
*
* @param workingDirectory
* @param branch
* @param startDate
* @return The command line
*/
public static Commandline createCommandLine(File workingDirectory, ScmBranch branch, Date startDate) {
Commandline command = new Commandline();
command.setExecutable("cleartool");
command.createArg().setValue("lshistory");
command.setWorkingDirectory(workingDirectory.getAbsolutePath());
Settings settings = ClearCaseUtil.getSettings();
String userFormat = StringUtils.isEmpty(settings.getChangelogUserFormat()) ? "" : settings.getChangelogUserFormat();
StringBuilder format = new StringBuilder();
format.append("NAME:%En\\n");
format.append("DATE:%Nd\\n");
format.append("COMM:%-12.12o - %o - %c - Activity: %[activity]p\\n");
format.append("USER:%" + userFormat + "u\\n");
format.append("REVI:%Ln\\n");
command.createArg().setValue("-fmt");
command.createArg().setValue(format.toString());
command.createArg().setValue("-recurse");
command.createArg().setValue("-nco");
if (startDate != null) {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", Locale.ENGLISH);
String start = sdf.format(startDate);
command.createArg().setValue("-since");
command.createArg().setValue(start);
}
if (branch != null && StringUtils.isNotEmpty(branch.getName())) {
command.createArg().setValue("-branch");
command.createArg().setValue(branch.getName());
}
return command;
}
Aggregations