11package edu .luc .etl .cs313 .android .simplestopwatch .architecture ;
22
3- import com .tngtech .archunit .core .importer .ImportOption ;
4- import com .tngtech .archunit .junit .AnalyzeClasses ;
5- import com .tngtech .archunit .junit .ArchTest ;
6- import com .tngtech .archunit .lang .ArchRule ;
7-
83import static com .tngtech .archunit .lang .syntax .ArchRuleDefinition .classes ;
94
5+ import org .junit .jupiter .api .Test ;
6+
107import com .tngtech .archunit .core .importer .ClassFileImporter ;
118import com .tngtech .archunit .library .dependencies .SlicesRuleDefinition ;
129
1310/**
1411 * Architecture tests to verify structural constraints and design rules.
15- *
12+ *
1613 * @author laufer
1714 */
1815public class PackageDependencyTest {
@@ -21,7 +18,7 @@ public class PackageDependencyTest {
2118 * Verifies that there are no cyclic dependencies between packages.
2219 * Package cycles make code harder to understand, test, and maintain.
2320 */
24- @ ArchTest
21+ @ Test
2522 public void packages_should_be_free_of_cycles () {
2623 final var importedClasses =
2724 new ClassFileImporter ().importPackages ("edu.luc.etl.cs313.android.simplestopwatch" );
@@ -37,7 +34,7 @@ public void packages_should_be_free_of_cycles() {
3734 * Verifies that there are no cyclic dependencies between sub-packages
3835 * at a more granular level (e.g., model.time, model.state, model.clock).
3936 */
40- @ ArchTest
37+ @ Test
4138 public void subpackages_should_be_free_of_cycles () {
4239 final var importedClasses =
4340 new ClassFileImporter ().importPackages ("edu.luc.etl.cs313.android.simplestopwatch" );
@@ -54,11 +51,11 @@ public void subpackages_should_be_free_of_cycles() {
5451 * - Standard Java types (java.., javax..)
5552 * - Types from the common package
5653 * - Other types from model packages
57- *
54+ *
5855 * This ensures the model layer is self-contained and doesn't depend on
5956 * external frameworks or UI-specific code.
6057 */
61- @ ArchTest
58+ @ Test
6259 public void model_should_only_depend_on_java_common_or_model () {
6360 final var importedClasses =
6461 new ClassFileImporter ().importPackages ("edu.luc.etl.cs313.android.simplestopwatch" );
0 commit comments