use of com.github.sevntu.checkstyle.ordering.MethodOrder in project methods-distance by sevntu-checkstyle.
the class MethodOrderTest method testOverrideSplit3.
@Test
public void testOverrideSplit3() throws Exception {
final MethodOrder ds = withDefaultConfigOrdering("InputDependenciesOverrideSplit3.java");
assertEquals(0, ds.getOverrideGroupSplitCases());
}
use of com.github.sevntu.checkstyle.ordering.MethodOrder in project methods-distance by sevntu-checkstyle.
the class MethodOrderTest method testDependencies.
@Test
public void testDependencies() throws Exception {
final Configuration dc = createCheckConfig(MethodCallDependencyCheckstyleModule.class);
final MethodOrder ord = invokeCheckAndGetOrdering(dc, "InputDependencies.java");
final Method methodB = ord.getMethodByInitialIndex(1);
final List<Method> dependencies = ord.getMethodDependenciesInAppearanceOrder(methodB);
assertTrue(dependencies.size() == 1);
assertTrue(dependencies.get(0).getSignature().equals("c()"));
final List<Method> dependants = ord.getMethodDependants(methodB);
assertTrue(dependants.size() == 1);
assertTrue(dependants.get(0).getSignature().equals("a()"));
final Method methodD = ord.getMethodByInitialIndex(3);
assertFalse(ord.hasMethodDependants(methodD));
assertFalse(ord.hasMethodDependencies(methodD));
final Method methodA = ord.getMethodByInitialIndex(0);
assertTrue(ord.isMethodDependsOn(methodA, methodB));
assertFalse(ord.isMethodDependsOn(methodA, methodD));
}
use of com.github.sevntu.checkstyle.ordering.MethodOrder in project methods-distance by sevntu-checkstyle.
the class MethodOrderTest method testDeclarationBeforeUsageCases.
@Test
public void testDeclarationBeforeUsageCases() throws Exception {
final MethodOrder ds = withDefaultConfigOrdering("InputDependenciesDeclarationBeforeUsage.java");
assertEquals(2, ds.getDeclarationBeforeUsageCases());
}
use of com.github.sevntu.checkstyle.ordering.MethodOrder in project methods-distance by sevntu-checkstyle.
the class MethodOrderTest method testTotalSumOfMethodDistances2.
@Test
public void testTotalSumOfMethodDistances2() throws Exception {
final MethodOrder ds = withDefaultConfigOrdering("InputDependenciesDistance2.java");
assertEquals(3, ds.getTotalSumOfMethodDistances());
}
use of com.github.sevntu.checkstyle.ordering.MethodOrder in project methods-distance by sevntu-checkstyle.
the class MethodOrderTest method testOverloadSplit2.
@Test
public void testOverloadSplit2() throws Exception {
final MethodOrder ds = withDefaultConfigOrdering("InputDependenciesOverloadSplit2.java");
assertEquals(14, ds.getOverloadGroupsSplitCases());
}
Aggregations