@Test public void getMap() { LOG.info( "\n===RunDaoTest.getMap===\n" ); Map<String, Run> runs = ESSuiteTest.runDao.getMap( ESSuiteTest.COMMIT_ID_2, 1, ESSuiteTest.TEST_NAME_1 ); assertEquals( 1, runs.size() ); for ( String runId : runs.keySet() ) { LOG.info( "{}: {}", runId, runs.get( runId ) ); assertEquals( ESSuiteTest.RUN_ID_1, runId ); assertEquals( ESSuiteTest.RUN_AVG_TIME_1, ( Long ) runs.get( runId ).getAvgTime() ); } }
public Map<String, Run> getMap( String commitId, int runNumber, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "commitId", commitId.toLowerCase() ) ) .must( termQuery( "runNumber", runNumber ) ) .must( termQuery( "testName", testName.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); HashMap<String, Run> runs = new HashMap<String, Run>(); for ( SearchHit hit : response.getHits().hits() ) { runs.put( hit.getId(), toRun( hit ) ); } return runs; }
RunDao extends Dao { public Map<String, Run> getMap( String commitId, int runNumber, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "commitId", commitId.toLowerCase() ) ) .must( termQuery( "runNumber", runNumber ) ) .must( termQuery( "testName", testName.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); HashMap<String, Run> runs = new HashMap<String, Run>(); for ( SearchHit hit : response.getHits().hits() ) { runs.put( hit.getId(), toRun( hit ) ); } return runs; } }
RunDao extends Dao { public Map<String, Run> getMap( String commitId, int runNumber, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "commitId", commitId.toLowerCase() ) ) .must( termQuery( "runNumber", runNumber ) ) .must( termQuery( "testName", testName.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); HashMap<String, Run> runs = new HashMap<String, Run>(); for ( SearchHit hit : response.getHits().hits() ) { runs.put( hit.getId(), toRun( hit ) ); } return runs; } @Inject  RunDao( IElasticSearchClient elasticSearchClient ); }
RunDao extends Dao { public Map<String, Run> getMap( String commitId, int runNumber, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "commitId", commitId.toLowerCase() ) ) .must( termQuery( "runNumber", runNumber ) ) .must( termQuery( "testName", testName.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); HashMap<String, Run> runs = new HashMap<String, Run>(); for ( SearchHit hit : response.getHits().hits() ) { runs.put( hit.getId(), toRun( hit ) ); } return runs; } @Inject  RunDao( IElasticSearchClient elasticSearchClient ); boolean save( Run run ); boolean delete( Run run ); Run get( String runId ); Map<String, Run> getMap( String commitId, int runNumber, String testName ); Map<String, Run> getMap( String commitId, int runNumber, String testName, Collection<Runner> runners ); List<Run> getAll(); List<Run> getList( String commitId, String testName ); List<Run> getList( String commitId, int runNumber ); List<Run> getList( List<Commit> commits, String testName ); List<Run> getRuns( String runner, String commitId ); Collection<Run> getRuns( String commitId ); Set<String> getTestNames( List<Commit> commits ); int getNextRunNumber( String commitId ); }
RunDao extends Dao { public Map<String, Run> getMap( String commitId, int runNumber, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "commitId", commitId.toLowerCase() ) ) .must( termQuery( "runNumber", runNumber ) ) .must( termQuery( "testName", testName.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); HashMap<String, Run> runs = new HashMap<String, Run>(); for ( SearchHit hit : response.getHits().hits() ) { runs.put( hit.getId(), toRun( hit ) ); } return runs; } @Inject  RunDao( IElasticSearchClient elasticSearchClient ); boolean save( Run run ); boolean delete( Run run ); Run get( String runId ); Map<String, Run> getMap( String commitId, int runNumber, String testName ); Map<String, Run> getMap( String commitId, int runNumber, String testName, Collection<Runner> runners ); List<Run> getAll(); List<Run> getList( String commitId, String testName ); List<Run> getList( String commitId, int runNumber ); List<Run> getList( List<Commit> commits, String testName ); List<Run> getRuns( String runner, String commitId ); Collection<Run> getRuns( String commitId ); Set<String> getTestNames( List<Commit> commits ); int getNextRunNumber( String commitId ); static final String DAO_INDEX_KEY; static final String DAO_TYPE_KEY; }