Skip to content

Commit

Permalink
Support the matching of @test and @ParamererizedTest methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jan 14, 2025
1 parent 4ade705 commit 0810633
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/gr/uom/java/xmi/UMLOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,9 @@ public double normalizedNameDistance(UMLOperation operation) {
}

public boolean testMethodCheck(UMLOperation operation) {
if(this.hasTestAnnotation() && !operation.hasTestAnnotation() && !operation.containsAssertion())
if(this.hasTestAnnotation() && !operation.hasTestAnnotation() && !operation.hasParameterizedTestAnnotation() && !operation.containsAssertion())
return false;
if(!this.hasTestAnnotation() && !this.containsAssertion() && operation.hasTestAnnotation())
if(!this.hasTestAnnotation() && !this.hasParameterizedTestAnnotation() && !this.containsAssertion() && operation.hasTestAnnotation())
return false;
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gr/uom/java/xmi/diff/UMLClassBaseDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -1561,9 +1561,9 @@ else if(removedOperation.hasTestAnnotation() && addedOperation.hasParameterizedT
}
}
if(!matchingMergeCandidateFound && !matchingSplitCandidateFound) {
if(addedOperation.hasParameterizedTestAnnotation() && !firstMapper.getContainer1().hasParameterizedTestAnnotation()) {
List<List<String>> parameterValues = getParameterValues(addedOperation, modelDiff);
if(addedOperation.hasParameterizedTestAnnotation() && !parameterValues.isEmpty() && !firstMapper.getContainer1().hasParameterizedTestAnnotation()) {
Set<UMLOperationBodyMapper> filteredMapperSet = new LinkedHashSet<UMLOperationBodyMapper>();
List<List<String>> parameterValues = getParameterValues(addedOperation, modelDiff);
List<String> parameterNames = addedOperation.getParameterNameList();
int overallMaxMatchingTestParameters = -1;
Map<Integer, Integer> overallMatchingTestParameters = new LinkedHashMap<Integer, Integer>();
Expand Down

0 comments on commit 0810633

Please sign in to comment.