Search in sources :

Example 1 with QueryLogicTestHarness

use of datawave.query.testframework.QueryLogicTestHarness in project datawave by NationalSecurityAgency.

the class FacetedQueryLogicTest method querySetUp.

@Before
public void querySetUp() throws IOException {
    log.debug("---------  querySetUp  ---------");
    // Super call to pick up authSet initialization
    super.querySetUp();
    FacetedQueryLogic facetLogic = new FacetedQueryLogic();
    facetLogic.setFacetedSearchType(FacetedSearchType.FIELD_VALUE_FACETS);
    facetLogic.setFacetTableName(QueryTestTableHelper.FACET_TABLE_NAME);
    facetLogic.setFacetMetadataTableName(QueryTestTableHelper.FACET_METADATA_TABLE_NAME);
    facetLogic.setFacetHashTableName(QueryTestTableHelper.FACET_HASH_TABLE_NAME);
    facetLogic.setMaximumFacetGrouping(200);
    facetLogic.setMinimumFacet(1);
    this.logic = facetLogic;
    QueryTestTableHelper.configureLogicToScanTables(this.logic);
    this.logic.setFullTableScanEnabled(false);
    this.logic.setIncludeDataTypeAsField(true);
    this.logic.setIncludeGroupingContext(true);
    this.logic.setDateIndexHelperFactory(new DateIndexHelperFactory());
    this.logic.setMarkingFunctions(new MarkingFunctions.Default());
    this.logic.setMetadataHelperFactory(new MetadataHelperFactory());
    this.logic.setResponseObjectFactory(new DefaultResponseObjectFactory());
    // init must set auths
    testInit();
    SubjectIssuerDNPair dn = SubjectIssuerDNPair.of("userDn", "issuerDn");
    DatawaveUser user = new DatawaveUser(dn, DatawaveUser.UserType.USER, Sets.newHashSet(this.auths.toString().split(",")), null, null, -1L);
    this.principal = new DatawavePrincipal(Collections.singleton(user));
    this.testHarness = new QueryLogicTestHarness(this);
}
Also used : DefaultResponseObjectFactory(datawave.webservice.query.result.event.DefaultResponseObjectFactory) SubjectIssuerDNPair(datawave.security.authorization.SubjectIssuerDNPair) DatawaveUser(datawave.security.authorization.DatawaveUser) QueryLogicTestHarness(datawave.query.testframework.QueryLogicTestHarness) DatawavePrincipal(datawave.security.authorization.DatawavePrincipal) DateIndexHelperFactory(datawave.query.util.DateIndexHelperFactory) MarkingFunctions(datawave.marking.MarkingFunctions) MetadataHelperFactory(datawave.query.util.MetadataHelperFactory) Before(org.junit.Before)

Example 2 with QueryLogicTestHarness

use of datawave.query.testframework.QueryLogicTestHarness in project datawave by NationalSecurityAgency.

the class IndexQueryLogicTest method querySetUp.

@Before
public void querySetUp() throws IOException {
    log.debug("---------  querySetUp  ---------");
    // Super call to pick up authSet initialization
    super.querySetUp();
    this.logic = new IndexQueryLogic();
    QueryTestTableHelper.configureLogicToScanTables(this.logic);
    this.logic.setFullTableScanEnabled(false);
    this.logic.setIncludeDataTypeAsField(true);
    this.logic.setIncludeGroupingContext(true);
    this.logic.setDateIndexHelperFactory(new DateIndexHelperFactory());
    this.logic.setMarkingFunctions(new MarkingFunctions.Default());
    this.logic.setMetadataHelperFactory(new MetadataHelperFactory());
    this.logic.setQueryPlanner(new DefaultQueryPlanner());
    this.logic.setResponseObjectFactory(new DefaultResponseObjectFactory());
    // init must set auths
    testInit();
    SubjectIssuerDNPair dn = SubjectIssuerDNPair.of("userDn", "issuerDn");
    DatawaveUser user = new DatawaveUser(dn, DatawaveUser.UserType.USER, Sets.newHashSet(this.auths.toString().split(",")), null, null, -1L);
    this.principal = new DatawavePrincipal(Collections.singleton(user));
    this.testHarness = new QueryLogicTestHarness(this);
}
Also used : DefaultResponseObjectFactory(datawave.webservice.query.result.event.DefaultResponseObjectFactory) SubjectIssuerDNPair(datawave.security.authorization.SubjectIssuerDNPair) DatawaveUser(datawave.security.authorization.DatawaveUser) QueryLogicTestHarness(datawave.query.testframework.QueryLogicTestHarness) DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner) DatawavePrincipal(datawave.security.authorization.DatawavePrincipal) DateIndexHelperFactory(datawave.query.util.DateIndexHelperFactory) MarkingFunctions(datawave.marking.MarkingFunctions) MetadataHelperFactory(datawave.query.util.MetadataHelperFactory) Before(org.junit.Before)

Aggregations

MarkingFunctions (datawave.marking.MarkingFunctions)2 QueryLogicTestHarness (datawave.query.testframework.QueryLogicTestHarness)2 DateIndexHelperFactory (datawave.query.util.DateIndexHelperFactory)2 MetadataHelperFactory (datawave.query.util.MetadataHelperFactory)2 DatawavePrincipal (datawave.security.authorization.DatawavePrincipal)2 DatawaveUser (datawave.security.authorization.DatawaveUser)2 SubjectIssuerDNPair (datawave.security.authorization.SubjectIssuerDNPair)2 DefaultResponseObjectFactory (datawave.webservice.query.result.event.DefaultResponseObjectFactory)2 Before (org.junit.Before)2 DefaultQueryPlanner (datawave.query.planner.DefaultQueryPlanner)1