diff --git a/src/main/java/com/devonfw/sample/archunit/componentb/logic/C4PositiveTest.java b/src/main/java/com/devonfw/sample/archunit/componentb/logic/C4PositiveTest.java new file mode 100644 index 0000000..8c4e9f9 --- /dev/null +++ b/src/main/java/com/devonfw/sample/archunit/componentb/logic/C4PositiveTest.java @@ -0,0 +1,5 @@ +package com.devonfw.sample.archunit.componentb.logic; + +public class C4PositiveTest { + //Demo class. C4ViolationServiceLayerOfComponentbDependsOnLogicLayer class can depend on this class. +} diff --git a/src/main/java/com/devonfw/sample/archunit/componentb/service/C3ViolationServiceLayerOfComponentbDependsOnServiceLayerOfComponentTask.java b/src/main/java/com/devonfw/sample/archunit/componentb/service/C3ViolationServiceLayerOfComponentbDependsOnServiceLayerOfComponentTask.java new file mode 100644 index 0000000..7e9a5d5 --- /dev/null +++ b/src/main/java/com/devonfw/sample/archunit/componentb/service/C3ViolationServiceLayerOfComponentbDependsOnServiceLayerOfComponentTask.java @@ -0,0 +1,7 @@ +package com.devonfw.sample.archunit.componentb.service; + +import com.devonfw.sample.archunit.task.service.TaskService; + +public class C3ViolationServiceLayerOfComponentbDependsOnServiceLayerOfComponentTask { + TaskService taskService; // noncompliant +} diff --git a/src/main/java/com/devonfw/sample/archunit/componentb/service/C4ViolationServiceLayerOfComponentbDependsOnLogicLayerOfComponentTask.java b/src/main/java/com/devonfw/sample/archunit/componentb/service/C4ViolationServiceLayerOfComponentbDependsOnLogicLayerOfComponentTask.java new file mode 100644 index 0000000..0a1cb45 --- /dev/null +++ b/src/main/java/com/devonfw/sample/archunit/componentb/service/C4ViolationServiceLayerOfComponentbDependsOnLogicLayerOfComponentTask.java @@ -0,0 +1,26 @@ +package com.devonfw.sample.archunit.componentb.service; + +import com.devonfw.sample.archunit.componentb.logic.C4PositiveTest; +import com.devonfw.sample.archunit.general.common.ApplicationEntity; +import com.devonfw.sample.archunit.general.logic.AbstractUc; +import com.devonfw.sample.archunit.task.common.TaskItem; +import com.devonfw.sample.archunit.task.logic.UcDeleteTaskItem; + +public class C4ViolationServiceLayerOfComponentbDependsOnLogicLayerOfComponentTask { + // Forbidden dependency covered + UcDeleteTaskItem ucDeleteTaskItem; // noncompliant (different components logic layer) + + // Forbidden dependencies uncovered + + TaskItem taskItem; // noncompliant (wont violate C4 test. Should be caught by other rules) + + //TaskItemEntity taskItemEntity; // noncompliant (wont violate C4 test. Should be caught by layer rules) + + // Allowed dependencies + C4PositiveTest c4PositiveTest; // compliant (same components logic layer) + + ApplicationEntity applicationEntity; // compliant (projects default component) + + AbstractUc abstractUc; // compliant (projects default component) + +}