@Test public void handleIntroductionOnly() throws QueryException { addSmell(firstCommit, firstSmell); addSmell(secondCommit, firstSmell); addSmell(secondCommit, secondSmell); mockEndCommit(secondCommit.sha); getAnalysis().query(); debugSmellInsertions(); verify(persistence, times(2)).execute(any()); verify(smellQueries).smellInsertionStatement(projectId, firstSmell); verify(smellQueries).smellInsertionStatement(projectId, secondSmell); verify(persistence, times(5)).addStatements(any()); verify(smellQueries).smellCategoryInsertionStatement(projectId, firstCommit.sha, firstSmell, SmellCategory.PRESENCE); verify(smellQueries).smellCategoryInsertionStatement(projectId, firstCommit.sha, firstSmell, SmellCategory.INTRODUCTION); verify(smellQueries).smellCategoryInsertionStatement(projectId, secondCommit.sha, firstSmell, SmellCategory.PRESENCE); verify(smellQueries).smellCategoryInsertionStatement(projectId, secondCommit.sha, secondSmell, SmellCategory.PRESENCE); verify(smellQueries).smellCategoryInsertionStatement(projectId, secondCommit.sha, secondSmell, SmellCategory.INTRODUCTION); }
@Override public void query() throws QueryException { Smell smell; Commit commit; Map<String, Object> instance; BranchAnalyzer branchAnalyzer = new BranchAnalyzer( projectId, persistence, duplicationChecker, commitQueries, smellQueries ); while (smells.hasNext()) { instance = smells.next(); smell = Smell.fromPaprikaInstance(instance, smellType); commit = Commit.fromInstance(instance); branchAnalyzer.notifyCommit(commit); branchAnalyzer.notifySmell(smell); } branchAnalyzer.notifyEnd(); }
OrdinalSmellTypeAnalysis implements Query { @Override public void query() throws QueryException { Smell smell; Commit commit; Map<String, Object> instance; BranchAnalyzer branchAnalyzer = new BranchAnalyzer( projectId, persistence, duplicationChecker, commitQueries, smellQueries ); while (smells.hasNext()) { instance = smells.next(); smell = Smell.fromPaprikaInstance(instance, smellType); commit = Commit.fromInstance(instance); branchAnalyzer.notifyCommit(commit); branchAnalyzer.notifySmell(smell); } branchAnalyzer.notifyEnd(); } }
OrdinalSmellTypeAnalysis implements Query { @Override public void query() throws QueryException { Smell smell; Commit commit; Map<String, Object> instance; BranchAnalyzer branchAnalyzer = new BranchAnalyzer( projectId, persistence, duplicationChecker, commitQueries, smellQueries ); while (smells.hasNext()) { instance = smells.next(); smell = Smell.fromPaprikaInstance(instance, smellType); commit = Commit.fromInstance(instance); branchAnalyzer.notifyCommit(commit); branchAnalyzer.notifySmell(smell); } branchAnalyzer.notifyEnd(); } OrdinalSmellTypeAnalysis(int projectId, Persistence persistence, Iterator<Map<String, Object>> smells,
                             String smellType, SmellDuplicationChecker duplicationChecker,
                             CommitQueries commitQueries, SmellQueries smellQueries); }
OrdinalSmellTypeAnalysis implements Query { @Override public void query() throws QueryException { Smell smell; Commit commit; Map<String, Object> instance; BranchAnalyzer branchAnalyzer = new BranchAnalyzer( projectId, persistence, duplicationChecker, commitQueries, smellQueries ); while (smells.hasNext()) { instance = smells.next(); smell = Smell.fromPaprikaInstance(instance, smellType); commit = Commit.fromInstance(instance); branchAnalyzer.notifyCommit(commit); branchAnalyzer.notifySmell(smell); } branchAnalyzer.notifyEnd(); } OrdinalSmellTypeAnalysis(int projectId, Persistence persistence, Iterator<Map<String, Object>> smells,
                             String smellType, SmellDuplicationChecker duplicationChecker,
                             CommitQueries commitQueries, SmellQueries smellQueries); @Override void query(); }
OrdinalSmellTypeAnalysis implements Query { @Override public void query() throws QueryException { Smell smell; Commit commit; Map<String, Object> instance; BranchAnalyzer branchAnalyzer = new BranchAnalyzer( projectId, persistence, duplicationChecker, commitQueries, smellQueries ); while (smells.hasNext()) { instance = smells.next(); smell = Smell.fromPaprikaInstance(instance, smellType); commit = Commit.fromInstance(instance); branchAnalyzer.notifyCommit(commit); branchAnalyzer.notifySmell(smell); } branchAnalyzer.notifyEnd(); } OrdinalSmellTypeAnalysis(int projectId, Persistence persistence, Iterator<Map<String, Object>> smells,
                             String smellType, SmellDuplicationChecker duplicationChecker,
                             CommitQueries commitQueries, SmellQueries smellQueries); @Override void query();  }