Skip to content

Commit 0810633

Browse files
committed
Support the matching of @test and @ParamererizedTest methods
square/okhttp@4036fa5
1 parent 4ade705 commit 0810633

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/gr/uom/java/xmi/UMLOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,9 @@ public double normalizedNameDistance(UMLOperation operation) {
978978
}
979979

980980
public boolean testMethodCheck(UMLOperation operation) {
981-
if(this.hasTestAnnotation() && !operation.hasTestAnnotation() && !operation.containsAssertion())
981+
if(this.hasTestAnnotation() && !operation.hasTestAnnotation() && !operation.hasParameterizedTestAnnotation() && !operation.containsAssertion())
982982
return false;
983-
if(!this.hasTestAnnotation() && !this.containsAssertion() && operation.hasTestAnnotation())
983+
if(!this.hasTestAnnotation() && !this.hasParameterizedTestAnnotation() && !this.containsAssertion() && operation.hasTestAnnotation())
984984
return false;
985985
return true;
986986
}

src/main/java/gr/uom/java/xmi/diff/UMLClassBaseDiff.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,9 +1561,9 @@ else if(removedOperation.hasTestAnnotation() && addedOperation.hasParameterizedT
15611561
}
15621562
}
15631563
if(!matchingMergeCandidateFound && !matchingSplitCandidateFound) {
1564-
if(addedOperation.hasParameterizedTestAnnotation() && !firstMapper.getContainer1().hasParameterizedTestAnnotation()) {
1564+
List<List<String>> parameterValues = getParameterValues(addedOperation, modelDiff);
1565+
if(addedOperation.hasParameterizedTestAnnotation() && !parameterValues.isEmpty() && !firstMapper.getContainer1().hasParameterizedTestAnnotation()) {
15651566
Set<UMLOperationBodyMapper> filteredMapperSet = new LinkedHashSet<UMLOperationBodyMapper>();
1566-
List<List<String>> parameterValues = getParameterValues(addedOperation, modelDiff);
15671567
List<String> parameterNames = addedOperation.getParameterNameList();
15681568
int overallMaxMatchingTestParameters = -1;
15691569
Map<Integer, Integer> overallMatchingTestParameters = new LinkedHashMap<Integer, Integer>();

0 commit comments

Comments
 (0)