@Test public void testShaFromOrdinalQuery() { List<Map<String, Object>> result; Commit branchCommit = prepareCommit("sha", 0); Commit anotherCommit = prepareCommit("another", 4); result = persistence.query(queries.shaFromOrdinalQuery(projectId, 0, 1)); assertTrue(result.isEmpty()); int firstBranchID = insertBranch(projectId, 4, originCommit, mergedIntoCommit); int secondBranchID = insertBranch(projectId, 5, mergedIntoCommit, originCommit); result = persistence.query(queries.mergedBranchIdQuery(projectId, mergedIntoCommit)); assertEquals(firstBranchID, result.get(0).get("id")); result = persistence.query(queries.mergedBranchIdQuery(projectId, originCommit)); assertEquals(secondBranchID, result.get(0).get("id")); persistence.execute(queries.branchCommitInsertionQuery(projectId, 4, branchCommit.sha, 0)); persistence.execute(queries.branchCommitInsertionQuery(projectId, 4, anotherCommit.sha, 1)); result = persistence.query(queries.mergedBranchIdQuery(projectId, mergedIntoCommit)); assertEquals(firstBranchID, result.get(0).get("id")); }
@Override public String shaFromOrdinalQuery(int projectId, int branchId, int ordinal) { return shaFromOrdinalQuery(projectId, branchId, ordinal, false); }
JDBCBranchQueries extends JDBCQueriesHelper implements BranchQueries { @Override public String shaFromOrdinalQuery(int projectId, int branchId, int ordinal) { return shaFromOrdinalQuery(projectId, branchId, ordinal, false); } }
JDBCBranchQueries extends JDBCQueriesHelper implements BranchQueries { @Override public String shaFromOrdinalQuery(int projectId, int branchId, int ordinal) { return shaFromOrdinalQuery(projectId, branchId, ordinal, false); } JDBCBranchQueries(CommitQueries commitQueries, SmellQueries smellQueries); }
JDBCBranchQueries extends JDBCQueriesHelper implements BranchQueries { @Override public String shaFromOrdinalQuery(int projectId, int branchId, int ordinal) { return shaFromOrdinalQuery(projectId, branchId, ordinal, false); } JDBCBranchQueries(CommitQueries commitQueries, SmellQueries smellQueries); @Override String branchInsertionStatement(int projectId, int ordinal, Commit parentCommit, Commit mergedInto); @Override String branchCommitInsertionQuery(int projectId, int branchOrdinal, String commitSha, int ordinal); @Override String idFromOrdinalQueryStatement(int projectId, int branchOrdinal); String idFromCommitQueryStatement(int projectId, Commit commit); @Override String parentCommitSmellsQuery(int projectId, int branchId, String smellType); @Override String lastCommitSmellsQuery(int projectId, Commit merge, String smellType); @Override String mergedBranchIdQuery(int projectId, Commit commit); @Override String shaFromOrdinalQuery(int projectId, int branchId, int ordinal); @Override String shaFromOrdinalQuery(int projectId, int branchId, int ordinal, boolean paprikaOnly); @Override String parentCommitIdQuery(int projectId, int branchId); @Override String parentCommitShaQuery(int projectId, int branchId); @Override String lastCommitShaQuery(int projectId, int branchId); @Override String lastCommitIdQuery(int projectId, int branchId); @Override String commitOrdinalQuery(int projectId, int branchId, Commit commit); }
JDBCBranchQueries extends JDBCQueriesHelper implements BranchQueries { @Override public String shaFromOrdinalQuery(int projectId, int branchId, int ordinal) { return shaFromOrdinalQuery(projectId, branchId, ordinal, false); } JDBCBranchQueries(CommitQueries commitQueries, SmellQueries smellQueries); @Override String branchInsertionStatement(int projectId, int ordinal, Commit parentCommit, Commit mergedInto); @Override String branchCommitInsertionQuery(int projectId, int branchOrdinal, String commitSha, int ordinal); @Override String idFromOrdinalQueryStatement(int projectId, int branchOrdinal); String idFromCommitQueryStatement(int projectId, Commit commit); @Override String parentCommitSmellsQuery(int projectId, int branchId, String smellType); @Override String lastCommitSmellsQuery(int projectId, Commit merge, String smellType); @Override String mergedBranchIdQuery(int projectId, Commit commit); @Override String shaFromOrdinalQuery(int projectId, int branchId, int ordinal); @Override String shaFromOrdinalQuery(int projectId, int branchId, int ordinal, boolean paprikaOnly); @Override String parentCommitIdQuery(int projectId, int branchId); @Override String parentCommitShaQuery(int projectId, int branchId); @Override String lastCommitShaQuery(int projectId, int branchId); @Override String lastCommitIdQuery(int projectId, int branchId); @Override String commitOrdinalQuery(int projectId, int branchId, Commit commit);  }