use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class DefaultEdgeEventQueryLogicTest method testManditoryFieldEdgeRelationship.
@Test(expected = IllegalArgumentException.class)
public void testManditoryFieldEdgeRelationship() throws Exception {
Query query = new QueryImpl();
query.setQuery("SOURCE == 'sourceValue' AND SINK == 'targetValue' AND TYPE == 'TEST1' AND ATTRIBUTE1 == 'SOURCE1-SOURCE2'");
logic.getEventQuery(query);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class DefaultEdgeEventQueryLogicTest method testBogusType.
@Test(expected = IllegalArgumentException.class)
public void testBogusType() throws Exception {
Query query = new QueryImpl();
query.setQuery("SOURCE == 'sourceValue' AND SINK == 'targetValue' AND TYPE == 'DOESNTEXIST' AND RELATION == 'REL1-REL2' AND ATTRIBUTE1 == 'SOURCE1-SOURCE2'");
// throws because BLAH1 and BLAH2 aren't in the edge dictionary
logic.getEventQuery(query);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class DefaultEdgeEventQueryLogicTest method testGroupedNumberedField.
@Test
public void testGroupedNumberedField() throws Exception {
Query query = new QueryImpl();
query.setQuery("SOURCE == 'sourceValue' AND SINK == 'targetValue' AND TYPE == 'TEST9' AND RELATION == 'REL1-REL2' AND ATTRIBUTE1 == 'SOURCE1-SOURCE2'");
String transformed = logic.getEventQuery(query);
assertEquals("($1_5_R == 'sourceValue' AND $5_6 == 'targetValue' AND $1_5 == 'enrichValue')", transformed);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class DefaultEdgeEventQueryLogicTest method testEdgesWithPreconditions.
@Test
public void testEdgesWithPreconditions() throws Exception {
Query query = new QueryImpl();
query.setQuery("SOURCE == '$200_1_R' AND SINK == '$200_3_R' AND TYPE == 'TEST10' AND RELATION == 'REL1-REL2'");
String transformed = logic.getEventQuery(query);
assertEquals("($200_1_R == '$200_1_R' AND $200_3_R == '$200_3_R' AND F05_3_R == 'enrichValue' AND ($200_1_R == $123))", transformed);
}
use of datawave.webservice.query.QueryImpl in project datawave by NationalSecurityAgency.
the class DefaultEdgeEventQueryLogicTest method testMultipleSource.
@Test
public void testMultipleSource() throws Exception {
Query query = new QueryImpl();
query.setQuery("SOURCE == 'sourceValue' AND SINK == 'targetValue' AND TYPE == 'TEST2' AND RELATION == 'REL1-REL2' AND ATTRIBUTE1 == 'SOURCE1-SOURCE2'");
String transformed = logic.getEventQuery(query);
assertEquals("(SOURCEFIELD1 == 'sourceValue' AND TARGETFIELD1 == 'targetValue' AND ENRICHFIELD1 == 'enrichValue1') OR (SOURCEFIELD2 == 'sourceValue' AND TARGETFIELD2 == 'targetValue' AND ENRICHFIELD2 == 'enrichValue2')", transformed);
}
Aggregations