@Test public void getListByCommitAndRunNumber() { LOG.info( "\n===RunDaoTest.getListByCommitAndRunNumber===\n" ); int runNumber = 1; List<Run> list = ESSuiteTest.runDao.getList( ESSuiteTest.COMMIT_ID_2, runNumber ); assertEquals( 2, list.size() ); for ( Run run : list ) { LOG.info( run.toString() ); assertTrue( run.getId().equals( ESSuiteTest.RUN_ID_1 ) || run.getId().equals( ESSuiteTest.RUN_ID_4 ) ); } }
public List<Run> getList( String commitId, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "testName", testName.toLowerCase() ) ) .must( termQuery( "commitId", commitId.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute().actionGet(); return toList( response ); }
RunDao extends Dao { public List<Run> getList( String commitId, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "testName", testName.toLowerCase() ) ) .must( termQuery( "commitId", commitId.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute().actionGet(); return toList( response ); } }
RunDao extends Dao { public List<Run> getList( String commitId, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "testName", testName.toLowerCase() ) ) .must( termQuery( "commitId", commitId.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute().actionGet(); return toList( response ); } @Inject  RunDao( IElasticSearchClient elasticSearchClient ); }
RunDao extends Dao { public List<Run> getList( String commitId, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "testName", testName.toLowerCase() ) ) .must( termQuery( "commitId", commitId.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute().actionGet(); return toList( response ); } @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 List<Run> getList( String commitId, String testName ) { BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery() .must( termQuery( "testName", testName.toLowerCase() ) ) .must( termQuery( "commitId", commitId.toLowerCase() ) ); SearchResponse response = getRequest( DAO_INDEX_KEY, DAO_TYPE_KEY ) .setQuery( queryBuilder ) .setSize( MAX_RESULT_SIZE ) .execute().actionGet(); return toList( response ); } @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; }