GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - TNG/ArchUnit: A Java architecture test library, to specify and assert architecture rules in plain Java

BranchesTags
Open more actions menu

Latest commit

 

History

2,804 Commits
2,804 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
archunit-3rd-party-test
archunit-3rd-party-test
 
 
archunit-example
archunit-example
 
 
archunit-integration-test
archunit-integration-test
 
 
archunit-java-modules-test
archunit-java-modules-test
 
 
archunit-junit
archunit-junit
 
 
archunit-maven-test
archunit-maven-test
 
 
archunit-self-test-library
archunit-self-test-library
 
 
archunit
archunit
 
 
build-steps
build-steps
 
 
buildSrc
buildSrc
 
 
develop
develop
 
 
docs
docs
 
 
gradle
gradle
 
 
licenses
licenses
 
 
logo
logo
 
 
release
release
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
ArchUnit-API.gif
ArchUnit-API.gif
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
DCO
DCO
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
icon.png
icon.png
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

CI Maven Central License

ArchUnit

ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure. ArchUnit's main focus is to automatically test architecture and coding rules, using any plain Java unit testing framework.

An Example

Add the Maven Central dependency to your project

Gradle
testImplementation 'com.tngtech.archunit:archunit:1.5.1'
Maven
<dependency>
    <groupId>com.tngtech.archunit</groupId>
    <artifactId>archunit</artifactId>
    <version>1.5.1</version>
    <scope>test</scope>
</dependency>

Create a test

import com.tngtech.archunit.core.domain.JavaClasses;
import com.tngtech.archunit.core.importer.ClassFileImporter;
import com.tngtech.archunit.lang.ArchRule;

import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;

public class MyArchitectureTest {
    @Test
    public void some_architecture_rule() {
        JavaClasses importedClasses = new ClassFileImporter().importPackages("com.myapp");
    
        ArchRule rule = classes()... // see next section
    
        rule.check(importedClasses);
    }
}

Let the API guide you

ArchUnit Fluent API

Where to look next

For further information, check out the user guide at https://archunit.org or test examples for the current release at ArchUnit Examples.

License

ArchUnit is published under the Apache License 2.0, see https://www.apache.org/licenses/LICENSE-2.0 for details.

It redistributes some third party libraries:

  • ASM (https://asm.ow2.org), under BSD Licence
  • Google Guava (https://github.com/google/guava), under Apache License 2.0

All licenses for ArchUnit and redistributed libraries can be found within the licenses folder.

About

A Java architecture test library, to specify and assert architecture rules in plain Java

archunit.org

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

3.9k stars

Watchers

49 watching

Forks

357 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.