use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class FulltextQueryBuilderTest method test.
private void test(final String fileName) throws Exception {
final String queryString = load("fulltext/query/" + fileName + ".json");
final PropertyTree dslExpression = readJson(queryString);
final QueryBuilder builder = new FulltextQueryBuilder(dslExpression.getSet("fulltext")).create();
assertJson("fulltext/result/" + fileName + ".json", builder.toString());
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class InQueryBuilderTest method test.
private void test(final String fileName) throws Exception {
final String queryString = load("in/query/" + fileName + ".json");
final PropertyTree dslExpression = readJson(queryString);
final QueryBuilder builder = new InQueryBuilder(dslExpression.getSet("in")).create();
assertJson("in/result/" + fileName + ".json", builder.toString());
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class LikeQueryBuilderTest method test.
private void test(final String fileName) throws Exception {
final String queryString = load("like/query/" + fileName + ".json");
final PropertyTree dslExpression = readJson(queryString);
final QueryBuilder builder = new LikeQueryBuilder(dslExpression.getSet("like")).create();
assertJson("like/result/" + fileName + ".json", builder.toString());
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class RepoDumperTest method binaries_with_versions.
@Test
public void binaries_with_versions() throws Exception {
final BinaryReference ref1 = BinaryReference.from("fisk");
final BinaryReference ref2 = BinaryReference.from("fisk2");
final PropertyTree data = new PropertyTree();
data.addBinaryReference("myBinaryRef", ref1);
final Node node1 = createNode(CreateNodeParams.create().parent(NodePath.ROOT).name("myName").data(data).attachBinary(ref1, ByteSource.wrap("myBinaryData".getBytes())).build());
final AttachedBinary originalBinary = node1.getAttachedBinaries().getByBinaryReference(ref1);
final Node updatedNode = updateNode(UpdateNodeParams.create().id(node1.id()).editor((e) -> {
}).attachBinary(ref2, ByteSource.wrap("myOtherBinaryData".getBytes())).build());
final AttachedBinary updateBinary = updatedNode.getAttachedBinaries().getByBinaryReference(ref1);
final TestDumpWriter writer = new TestDumpWriter();
doDump(writer);
assertTrue(writer.getBinaries().contains(BlobKey.from(originalBinary.getBlobKey())));
assertTrue(writer.getBinaries().contains(BlobKey.from(updateBinary.getBlobKey())));
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class PathMatchQueryBuilderTest method test.
private void test(final String fileName) throws Exception {
final String queryString = load("pathMatch/query/" + fileName + ".json");
final PropertyTree dslExpression = readJson(queryString);
final QueryBuilder builder = new PathMatchQueryBuilder(dslExpression.getSet("pathMatch")).create();
assertJson("pathMatch/result/" + fileName + ".json", builder.toString());
}
Aggregations