@Test public void getNextRunNumber() { LOG.info( "\n===RunDaoTest.getNextRunNumber===\n" ); List<Runner> runners = ESSuiteTest.runnerDao.getRunners( ESSuiteTest.USER_1, ESSuiteTest.COMMIT_ID_2, ESSuiteTest.MODULE_ID_2 ); int nextRunNumber = ESSuiteTest.runDao.getNextRunNumber( ESSuiteTest.COMMIT_ID_2 ); assertEquals( 3, nextRunNumber ); }
public int getNextRunNumber( String commitId ) { Collection<Run> runs = getRuns( commitId ); int maxRunNumber = 0; for( Run run: runs ) { if( run.getRunNumber() > maxRunNumber ) { maxRunNumber = run.getRunNumber(); } } return maxRunNumber + 1; }
RunDao extends Dao { public int getNextRunNumber( String commitId ) { Collection<Run> runs = getRuns( commitId ); int maxRunNumber = 0; for( Run run: runs ) { if( run.getRunNumber() > maxRunNumber ) { maxRunNumber = run.getRunNumber(); } } return maxRunNumber + 1; } }
RunDao extends Dao { public int getNextRunNumber( String commitId ) { Collection<Run> runs = getRuns( commitId ); int maxRunNumber = 0; for( Run run: runs ) { if( run.getRunNumber() > maxRunNumber ) { maxRunNumber = run.getRunNumber(); } } return maxRunNumber + 1; } @Inject  RunDao( IElasticSearchClient elasticSearchClient ); }
RunDao extends Dao { public int getNextRunNumber( String commitId ) { Collection<Run> runs = getRuns( commitId ); int maxRunNumber = 0; for( Run run: runs ) { if( run.getRunNumber() > maxRunNumber ) { maxRunNumber = run.getRunNumber(); } } return maxRunNumber + 1; } @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 int getNextRunNumber( String commitId ) { Collection<Run> runs = getRuns( commitId ); int maxRunNumber = 0; for( Run run: runs ) { if( run.getRunNumber() > maxRunNumber ) { maxRunNumber = run.getRunNumber(); } } return maxRunNumber + 1; } @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; }