Skip to content
项目

TNG/ArchUnit-Examples

在 GitHub 查看

关于

ArchUnit 示例(一个用于在纯 Java 中指定和断言架构规则的 Java 架构测试库)

开发工具

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

ArchUnit Examples

This module presents some examples on how to use the latest release of ArchUnit.

The different subprojects demonstrate the type of test support:

  • example-junit4 shows how to use the JUnit 4 test support including the ArchUnitRunner
  • example-junit5 shows how to use the JUnit 5 test support where test classes are simply being picked up by being annotated with @AnalyzeClasses
  • example-junit6 shows how to use the JUnit 6 test support where test classes are simply being picked up by being annotated with @AnalyzeClasses
  • example-plain shows how to use ArchUnit independently of any specific test framework, even though as a runtime environment these tests use JUnit 4 as well

All example rules you find within src/test refer to classes from src/main. These tests are all designed to fail, to demonstrate how production code could violate typical architectural constraints (like layer dependencies).

You can run them

  • with Gradle (using the provided build.gradle scripts):
    ./gradlew test
    
  • with Maven (using the provided pom.xml files in the same directories):
    ./mvnw test 
    
  • or directly from your IDE.

Regarding issues

If you have found any issues with the examples or have any question, please direct them to the main repository instead. This repository is an autogenerated version of the latest released version of https://github.com/TNG/ArchUnit/tree/main/archunit-example (with some simplified project setup for illustration)

探索相关项目

加载中…