From ff93b0967e6a5b11490bf40c2e3329b96b2d3753 Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Fri, 26 Mar 2021 16:27:24 +0100 Subject: [PATCH] 2 modified: src/test/java/insertGenerics/TestTPHsAndGenerics.java --- .../insertGenerics/TestTPHsAndGenerics.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/test/java/insertGenerics/TestTPHsAndGenerics.java b/src/test/java/insertGenerics/TestTPHsAndGenerics.java index 2b475bbf..3bf3dee2 100644 --- a/src/test/java/insertGenerics/TestTPHsAndGenerics.java +++ b/src/test/java/insertGenerics/TestTPHsAndGenerics.java @@ -66,7 +66,7 @@ public class TestTPHsAndGenerics { if (fogg.allConstraints.contains((new MethodConstraint("DZP", "ETW", Relation.EXTENDS)))) { classConstraintsTest.add(new ClassConstraint("UD", "DZP", Relation.EXTENDS)); classConstraintsTest.add(new ClassConstraint("DZP", "ETW", Relation.EXTENDS)); - classConstraintsTest.add(new ClassConstraint("ETW", "java/lang/Object", Relation.EXTENDS)); + classConstraintsTest.add(new ClassConstraint("U", "java/lang/Object", Relation.EXTENDS)); lmc.add(new MethodConstraint("AI", "AE", Relation.EXTENDS)); lmc.add(new MethodConstraint("AD", "AI", Relation.EXTENDS)); @@ -80,8 +80,8 @@ public class TestTPHsAndGenerics { lmc = new HashSet<>(); lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS)); methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc); - } - else { + } else { + if (fogg.allConstraints.contains((new MethodConstraint("DZP", "U", Relation.EXTENDS)))) { classConstraintsTest.add(new ClassConstraint("ETW", "DZP", Relation.EXTENDS)); classConstraintsTest.add(new ClassConstraint("DZP", "U", Relation.EXTENDS)); classConstraintsTest.add(new ClassConstraint("ETW", "java/lang/Object", Relation.EXTENDS)); @@ -98,7 +98,29 @@ public class TestTPHsAndGenerics { lmc = new HashSet<>(); lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS)); methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc); + } else { + if (fogg.allConstraints.contains((new MethodConstraint("EIM", "FEA", Relation.EXTENDS)))) { + classConstraintsTest.add(new ClassConstraint("ETW", "DZP", Relation.EXTENDS)); + classConstraintsTest.add(new ClassConstraint("DZP", "U", Relation.EXTENDS)); + classConstraintsTest.add(new ClassConstraint("ETW", "java/lang/Object", Relation.EXTENDS)); + + lmc.add(new MethodConstraint("AI", "AE", Relation.EXTENDS)); + lmc.add(new MethodConstraint("AD", "AI", Relation.EXTENDS)); + lmc.add(new MethodConstraint("AB", "AM", Relation.EXTENDS)); + lmc.add(new MethodConstraint("AE", "java/lang/Object", Relation.EXTENDS)); + lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS)); + methodConstraintsWithPositionTest.put("TPH ABm(TPH ABTPH AD)", lmc); + lmc = new HashSet<>(); + lmc.add(new MethodConstraint("V", "VK", Relation.EXTENDS)); + methodConstraintsWithPositionTest.put("TPH ETWid2(TPH V)", lmc); + lmc = new HashSet<>(); + lmc.add(new MethodConstraint("AM", "java/lang/Object", Relation.EXTENDS)); + methodConstraintsWithPositionTest.put("TPH AIm2(TPH AMTPH AI)", lmc); } + } + + } + Set computedClassCons = new HashSet<>(fogg.classConstraints); Set expectedClassCons = new HashSet<>(classConstraintsTest);