use of com.tngtech.archunit.core.domain.JavaClasses in project hazelcast by hazelcast.
the class CsvSerializableTest method serializable_classes_should_have_valid_serialVersionUID.
@Test
public void serializable_classes_should_have_valid_serialVersionUID() {
String basePackage = CsvReadFileFnProvider.class.getPackage().getName();
JavaClasses classes = new ClassFileImporter().withImportOption(onlyCurrentModule()).importPackages(basePackage);
ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes);
}
use of com.tngtech.archunit.core.domain.JavaClasses in project hazelcast by hazelcast.
the class CdcDebeziumSerializableTest method serializable_classes_should_have_valid_serialVersionUID.
@Test
public void serializable_classes_should_have_valid_serialVersionUID() {
String basePackage = DebeziumCdcSources.class.getPackage().getName();
JavaClasses classes = new ClassFileImporter().withImportOption(onlyCurrentModule()).importPackages(basePackage);
ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes);
}
use of com.tngtech.archunit.core.domain.JavaClasses in project ArchUnit by TNG.
the class ArchUnitRunner method runChild.
@Override
protected void runChild(ArchTestExecution child, RunNotifier notifier) {
if (child.ignore()) {
notifier.fireTestIgnored(describeChild(child));
} else {
notifier.fireTestStarted(describeChild(child));
Class<?> testClass = getTestClass().getJavaClass();
JavaClasses classes = cache.get().getClassesToAnalyzeFor(testClass, new JUnit4ClassAnalysisRequest(testClass));
child.evaluateOn(classes).notify(notifier);
notifier.fireTestFinished(describeChild(child));
}
}
use of com.tngtech.archunit.core.domain.JavaClasses in project ArchUnit by TNG.
the class ClassCacheTest method get_all_classes_by_LocationProvider.
@Test
public void get_all_classes_by_LocationProvider() {
JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, new TestAnalysisRequest().withPackagesRoots(ClassCacheTest.class).withLocationProviders(TestLocationProviderOfClass_String.class, TestLocationProviderOfClass_Rule.class));
assertThatTypes(classes).contain(String.class, Rule.class, getClass());
classes = cache.getClassesToAnalyzeFor(TestClassWithLocationProviderUsingTestClass.class, analyzeLocation(LocationOfClass.Provider.class));
assertThatTypes(classes).contain(String.class);
assertThatTypes(classes).doNotContain(getClass());
}
use of com.tngtech.archunit.core.domain.JavaClasses in project ArchUnit by TNG.
the class ClassCacheTest method filters_urls.
@Test
public void filters_urls() {
JavaClasses classes = cache.getClassesToAnalyzeFor(TestClass.class, new TestAnalysisRequest().withImportOptions(TestFilterForJUnitJars.class));
assertThat(classes).isNotEmpty();
for (JavaClass clazz : classes) {
assertThat(clazz.getPackageName()).doesNotContain("tngtech");
assertThat(clazz.getPackageName()).contains("junit");
}
}
Aggregations