MCPcopy
hub / github.com/Col-E/Recaf / testClassInheritance

Method testClassInheritance

src/test/java/me/coley/recaf/SearchTest.java:267–282  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265 }
266
267 @Test
268 public void testClassInheritance() {
269 // Setup search - All implementations of "Expression"
270 SearchCollector collector = SearchBuilder.in(workspace).skipDebug().skipCode()
271 .query(new ClassInheritanceQuery(workspace, "calc/Expression")).build();
272 // Show results
273 Set<String> results = collector.getAllResults().stream()
274 .map(res -> ((ClassResult)res).getName())
275 .collect(Collectors.toSet());
276 assertEquals(5, results.size());
277 assertTrue(results.contains("calc/Parenthesis"));
278 assertTrue(results.contains("calc/Exponent"));
279 assertTrue(results.contains("calc/MultAndDiv"));
280 assertTrue(results.contains("calc/AddAndSub"));
281 assertTrue(results.contains("calc/Constant"));
282 }
283
284 private static void contextEquals(Context<?> context, String owner, String name, String desc) {
285 assertTrue(context instanceof Context.MemberContext);

Callers

nothing calls this directly

Calls 10

inMethod · 0.95
getAllResultsMethod · 0.95
queryMethod · 0.80
skipCodeMethod · 0.80
skipDebugMethod · 0.80
buildMethod · 0.65
getNameMethod · 0.65
mapMethod · 0.45
sizeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected