use of org.apache.tools.ant.Location in project ant by apache.
the class MSVSSTest method testHistoryCommandLine3.
/**
* Tests VSSHistory commandline generation with date calculation.
*/
@Test
public void testHistoryCommandLine3() {
// Set up a Timestamp
Tstamp tstamp = new Tstamp();
Location location = new Location("src/etc/testcases/taskdefs/optional/vss/vss.xml");
tstamp.setLocation(location);
tstamp.setProject(project);
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("today");
format.setPattern("HH:mm:ss z");
format.setTimezone("GMT");
Date date = Calendar.getInstance().getTime();
format.execute(project, date, location);
String today = project.getProperty("today");
// Get today's date
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
String expected = sdf.format(date);
// Set up a VSSHistory task
MSVSSHISTORY vssHistory = new MSVSSHISTORY();
vssHistory.setProject(project);
vssHistory.setLogin(VSS_USERNAME);
vssHistory.setToDate(today);
vssHistory.setVsspath(VSS_PROJECT_PATH);
String[] sTestCmdLine = { MSVSS.SS_EXE, MSVSS.COMMAND_HISTORY, DS_VSS_PROJECT_PATH, MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_VERSION_DATE + expected, MSVSS.FLAG_LOGIN + VSS_USERNAME };
commandline = vssHistory.buildCmdLine();
checkCommandLines(sTestCmdLine, commandline.getCommandline());
}
use of org.apache.tools.ant.Location in project ant by apache.
the class TStampTest method setUp.
@Before
public void setUp() {
location = new Location("test.xml");
project = new Project();
tstamp = new Tstamp();
tstamp.setLocation(location);
tstamp.setProject(project);
}
Aggregations