use of org.apache.tools.ant.Project in project exist by eXist-db.
the class ServerTaskTest method backupRestore.
@Test
public void backupRestore() throws IOException {
final Project project = buildFileRule.getProject();
final Path backupDir = temporaryFolder.newFolder().toPath();
project.setProperty(PROP_ANT_TEST_DATA_BACKUP_DIR, backupDir.toAbsolutePath().toString());
buildFileRule.executeTarget("backup");
buildFileRule.executeTarget("restore");
}
use of org.apache.tools.ant.Project in project exist by eXist-db.
the class XmldbTaskTest method extract.
@Test
public void extract() throws IOException {
final Path tmpFile = temporaryFolder.newFile().toPath();
final Project project = buildFileRule.getProject();
project.setProperty(PROP_ANT_TEST_DATA_TEST_COLLECTION, TEST_COLLECTION_NAME);
project.setProperty(PROP_ANT_TEST_DATA_TEST_RESOURCE, TEST_RESOURCE_NAME);
project.setProperty(PROP_ANT_TEST_DATA_TMP_FILE, tmpFile.toAbsolutePath().toString());
buildFileRule.executeTarget("extract");
assertTrue(Files.exists(tmpFile));
}
use of org.apache.tools.ant.Project in project exist by eXist-db.
the class XmldbTaskTest method xpath.
@Test
public void xpath() {
final Project project = buildFileRule.getProject();
project.setProperty(PROP_ANT_TEST_DATA_TEST_COLLECTION, TEST_COLLECTION_NAME);
buildFileRule.executeTarget("xpath");
final String result = project.getProperty(PROP_ANT_TEST_DATA_RESULT);
assertEquals("world", result.trim());
}
use of org.apache.tools.ant.Project in project exist by eXist-db.
the class XmldbTaskTest method exists.
@Test
public void exists() {
final Project project = buildFileRule.getProject();
project.setProperty(PROP_ANT_TEST_DATA_TEST_COLLECTION, TEST_COLLECTION_NAME);
project.setProperty(PROP_ANT_TEST_DATA_TEST_RESOURCE, TEST_RESOURCE_NAME);
buildFileRule.executeTarget("exists");
final String result = project.getProperty(PROP_ANT_TEST_DATA_RESULT);
assertTrue(Boolean.parseBoolean(result));
}
use of org.apache.tools.ant.Project in project exist by eXist-db.
the class XmldbTaskTest method list.
@Test
public void list() {
final Project project = buildFileRule.getProject();
project.setProperty(PROP_ANT_TEST_DATA_TEST_COLLECTION, TEST_COLLECTION_NAME);
buildFileRule.executeTarget("list");
final String result = project.getProperty(PROP_ANT_TEST_DATA_RESULT);
assertThat(result, allOf(containsString(TEST_RESOURCE_NAME), containsString(BIN_TEST_RESOURCE_NAME)));
}
Aggregations