@Test public void testBuildQuery() { final String expectedFileQuery = setFileQuery("some* file* query*"); final String expectedModifiedWithin = setModifiedWithin(new Date(), new DateWrapper().addDays(1) .asDate()); final String expectedCreatedWithin = setCreatedWithin(new Date(), new DateWrapper().addMonths(1) .asDate()); final String expectedNegatedFile = setNegatedFileQuery("term1*" + " " + "term2*" + " " + "term3*"); final String expectedMetadataAttributeQuery = setMetadataAttributeQuery( "some* metadata* query*"); final String expectedMetadataValueQuery = setMetadataValueQuery("some* metadata* query*"); final String expectedOwnedBy = setOwnedBy("someuser"); final String expectedFileSizeRange = setFileSizeRange(0.1, 100.78763); final String expectedSharedWith = setSharedWith("some users who were shared with"); String result = new DataSearchQueryBuilder(dsf, userInfoMock).buildFullQuery(); assertTrue(result.contains(expectedFileQuery)); assertTrue(result.contains(expectedModifiedWithin)); assertTrue(result.contains(expectedCreatedWithin)); assertTrue(result.contains(expectedNegatedFile)); assertTrue(result.contains(expectedMetadataAttributeQuery)); assertTrue(result.contains(expectedMetadataValueQuery)); assertTrue(result.contains(expectedOwnedBy)); assertTrue(result.contains(expectedFileSizeRange)); assertTrue(result.contains(expectedSharedWith)); }
public String buildFullQuery() { ownedBy().createdWithin() .file() .fileSizeRange() .metadataAttribute() .metadataValue() .modifiedWithin() .negatedFile() .sharedWith() .taggedWith(); LOG.fine("search query==>" + toString()); return toString(); }
DataSearchQueryBuilder { public String buildFullQuery() { ownedBy().createdWithin() .file() .fileSizeRange() .metadataAttribute() .metadataValue() .modifiedWithin() .negatedFile() .sharedWith() .taggedWith(); LOG.fine("search query==>" + toString()); return toString(); } }
DataSearchQueryBuilder { public String buildFullQuery() { ownedBy().createdWithin() .file() .fileSizeRange() .metadataAttribute() .metadataValue() .modifiedWithin() .negatedFile() .sharedWith() .taggedWith(); LOG.fine("search query==>" + toString()); return toString(); } DataSearchQueryBuilder(DiskResourceQueryTemplate dsf, UserInfo userinfo); }
DataSearchQueryBuilder { public String buildFullQuery() { ownedBy().createdWithin() .file() .fileSizeRange() .metadataAttribute() .metadataValue() .modifiedWithin() .negatedFile() .sharedWith() .taggedWith(); LOG.fine("search query==>" + toString()); return toString(); } DataSearchQueryBuilder(DiskResourceQueryTemplate dsf, UserInfo userinfo); String buildFullQuery(); String taggedWith(); DataSearchQueryBuilder ownedBy(); DataSearchQueryBuilder createdWithin(); DataSearchQueryBuilder file(); DataSearchQueryBuilder fileSizeRange(); String getQuery(); DataSearchQueryBuilder metadataAttribute(); DataSearchQueryBuilder metadataValue(); DataSearchQueryBuilder modifiedWithin(); DataSearchQueryBuilder negatedFile(); DataSearchQueryBuilder sharedWith(); @Override String toString(); Splittable getSimpleQuery(String field, String userEntry); }
DataSearchQueryBuilder { public String buildFullQuery() { ownedBy().createdWithin() .file() .fileSizeRange() .metadataAttribute() .metadataValue() .modifiedWithin() .negatedFile() .sharedWith() .taggedWith(); LOG.fine("search query==>" + toString()); return toString(); } DataSearchQueryBuilder(DiskResourceQueryTemplate dsf, UserInfo userinfo); String buildFullQuery(); String taggedWith(); DataSearchQueryBuilder ownedBy(); DataSearchQueryBuilder createdWithin(); DataSearchQueryBuilder file(); DataSearchQueryBuilder fileSizeRange(); String getQuery(); DataSearchQueryBuilder metadataAttribute(); DataSearchQueryBuilder metadataValue(); DataSearchQueryBuilder modifiedWithin(); DataSearchQueryBuilder negatedFile(); DataSearchQueryBuilder sharedWith(); @Override String toString(); Splittable getSimpleQuery(String field, String userEntry); static final String METADATA_VALUE; static final String METADATA_ATTRIBUTE; static final String FIELDS; static final String QUERY_STRING; static final String LESSER; static final String GREATER; static final String RANGE2; static final String WILDCARD; static final String OR_OPERATOR; static final String DATE_MODIFIED; static final String QUERY2; static final String PATH; static final String METADATA2; static final String NESTED2; static final String HAS_CHILD; static final String FILE_SIZE; static final String LABEL; static final String DATE_CREATED; static final String BOOL; }