|
Lines 35-41
Link Here
|
| 35 |
public static Test suite() { |
35 |
public static Test suite() { |
| 36 |
if (true) return new TestSuite(ClassDeltaTests.class); |
36 |
if (true) return new TestSuite(ClassDeltaTests.class); |
| 37 |
TestSuite suite = new TestSuite(ClassDeltaTests.class.getName()); |
37 |
TestSuite suite = new TestSuite(ClassDeltaTests.class.getName()); |
| 38 |
suite.addTest(new ClassDeltaTests("test114")); |
38 |
suite.addTest(new ClassDeltaTests("test49")); |
|
|
39 |
suite.addTest(new ClassDeltaTests("test50")); |
| 40 |
suite.addTest(new ClassDeltaTests("test51")); |
| 39 |
return suite; |
41 |
return suite; |
| 40 |
} |
42 |
} |
| 41 |
|
43 |
|
|
Lines 1130-1138
Link Here
|
| 1130 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
1132 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
| 1131 |
assertNotNull("No delta", delta); |
1133 |
assertNotNull("No delta", delta); |
| 1132 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
1134 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
| 1133 |
assertEquals("Wrong size", 1, allLeavesDeltas.length); |
1135 |
assertEquals("Wrong size", 2, allLeavesDeltas.length); |
| 1134 |
IDelta child = allLeavesDeltas[0]; |
1136 |
IDelta child = allLeavesDeltas[0]; |
| 1135 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
1137 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
|
|
1138 |
assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); |
| 1139 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1140 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
| 1141 |
child = allLeavesDeltas[1]; |
| 1142 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1136 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
1143 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
| 1137 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
1144 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1138 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
1145 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
|
Lines 1152-1158
Link Here
|
| 1152 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
1159 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
| 1153 |
assertNotNull("No delta", delta); |
1160 |
assertNotNull("No delta", delta); |
| 1154 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
1161 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
| 1155 |
assertEquals("Wrong size", 3, allLeavesDeltas.length); |
1162 |
assertEquals("Wrong size", 6, allLeavesDeltas.length); |
| 1156 |
IDelta child = allLeavesDeltas[0]; |
1163 |
IDelta child = allLeavesDeltas[0]; |
| 1157 |
assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); |
1164 |
assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); |
| 1158 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
1165 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
|
Lines 1168-1173
Link Here
|
| 1168 |
assertEquals("Wrong flag", IDelta.EXPANDED_SUPERCLASS_SET, child.getFlags()); |
1175 |
assertEquals("Wrong flag", IDelta.EXPANDED_SUPERCLASS_SET, child.getFlags()); |
| 1169 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
1176 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1170 |
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); |
1177 |
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); |
|
|
1178 |
child = allLeavesDeltas[3]; |
| 1179 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1180 |
assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags()); |
| 1181 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1182 |
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); |
| 1183 |
child = allLeavesDeltas[4]; |
| 1184 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1185 |
assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags()); |
| 1186 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1187 |
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); |
| 1188 |
child = allLeavesDeltas[5]; |
| 1189 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1190 |
assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags()); |
| 1191 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1192 |
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); |
| 1171 |
} |
1193 |
} |
| 1172 |
|
1194 |
|
| 1173 |
/** |
1195 |
/** |
|
Lines 1184-1190
Link Here
|
| 1184 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
1206 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
| 1185 |
assertNotNull("No delta", delta); |
1207 |
assertNotNull("No delta", delta); |
| 1186 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
1208 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
| 1187 |
assertEquals("Wrong size", 3, allLeavesDeltas.length); |
1209 |
assertEquals("Wrong size", 6, allLeavesDeltas.length); |
| 1188 |
IDelta child = allLeavesDeltas[0]; |
1210 |
IDelta child = allLeavesDeltas[0]; |
| 1189 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
1211 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1190 |
assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERCLASS_SET, child.getFlags()); |
1212 |
assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERCLASS_SET, child.getFlags()); |
|
Lines 1197-1202
Link Here
|
| 1197 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
1219 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
| 1198 |
child = allLeavesDeltas[2]; |
1220 |
child = allLeavesDeltas[2]; |
| 1199 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
1221 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
|
|
1222 |
assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); |
| 1223 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1224 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
| 1225 |
child = allLeavesDeltas[3]; |
| 1226 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1227 |
assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); |
| 1228 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1229 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
| 1230 |
child = allLeavesDeltas[4]; |
| 1231 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1232 |
assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); |
| 1233 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1234 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
| 1235 |
child = allLeavesDeltas[5]; |
| 1236 |
assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); |
| 1200 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
1237 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
| 1201 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
1238 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 1202 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
1239 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
|
Lines 2691-2694
Link Here
|
| 2691 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
2728 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 2692 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
2729 |
assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); |
| 2693 |
} |
2730 |
} |
|
|
2731 |
/** |
| 2732 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=224969 |
| 2733 |
*/ |
| 2734 |
public void test115() { |
| 2735 |
deployBundles("test115"); |
| 2736 |
IApiProfile before = getBeforeState(); |
| 2737 |
IApiProfile after = getAfterState(); |
| 2738 |
IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME); |
| 2739 |
assertNotNull("no api component", beforeApiComponent); |
| 2740 |
IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME); |
| 2741 |
assertNotNull("no api component", afterApiComponent); |
| 2742 |
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); |
| 2743 |
assertNotNull("No delta", delta); |
| 2744 |
IDelta[] allLeavesDeltas = collectLeaves(delta); |
| 2745 |
assertEquals("Wrong size", 2, allLeavesDeltas.length); |
| 2746 |
IDelta child = allLeavesDeltas[0]; |
| 2747 |
assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); |
| 2748 |
assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); |
| 2749 |
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); |
| 2750 |
assertTrue("Is compatible", DeltaProcessor.isCompatible(child)); |
| 2751 |
child = allLeavesDeltas[1]; |
| 2752 |
assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); |
| 2753 |
assertEquals("Wrong flag", IDelta.TYPE, child.getFlags()); |
| 2754 |
assertEquals("Wrong element type", IDelta.API_COMPONENT_ELEMENT_TYPE, child.getElementType()); |
| 2755 |
assertTrue("Is compatible", DeltaProcessor.isCompatible(child)); |
| 2756 |
} |
| 2694 |
} |
2757 |
} |