Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#25 Implemented additional Package/NamingRule -violations #44

Draft
wants to merge 40 commits into
base: violations/convention
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6b0cff2
Merge pull request #1 from zichriste/master
moritzLanger Jan 17, 2023
db3baea
Merge pull request #2 from devonfw-sample/master
moritzLanger Jan 19, 2023
c51ba5c
implemeted PackeageRuleTest
moritzLanger Feb 6, 2023
df9194c
Merge pull request #3 from devonfw-sample/master
moritzLanger Feb 6, 2023
96b2a49
implement PackageRuleTest
moritzLanger Feb 6, 2023
6aaafd0
Merge branch 'master' of https://github.com/moritzLanger/archunit
moritzLanger Feb 6, 2023
a43473c
Merge branch 'master' into master
hohwille Feb 7, 2023
aefe838
implemented suggestions/improvements
moritzLanger Feb 9, 2023
963a40d
Merge branch 'master' of https://github.com/moritzLanger/archunit
moritzLanger Feb 9, 2023
2f0591c
removed Println
moritzLanger Feb 9, 2023
1b0cb97
removed 1 Space
moritzLanger Feb 9, 2023
cbee2e6
removed unnessary Import
moritzLanger Feb 9, 2023
fb55de0
added Spaces to message + Capitalised Constant
moritzLanger Feb 13, 2023
84573ff
Fix Point mistake in ROOT_PACKAGE
moritzLanger Feb 13, 2023
b5711fb
fixed minor mistake in DEFAULT_PATTERN
moritzLanger Feb 13, 2023
d58f047
Merge pull request #5 from devonfw-sample/master
moritzLanger Feb 13, 2023
b897be4
Merge pull request #7 from devonfw-sample/master
moritzLanger Feb 14, 2023
80e2553
Merge pull request #8 from devonfw-sample/master
moritzLanger Mar 2, 2023
e7ebcde
Merge pull request #9 from devonfw-sample/master
moritzLanger Mar 20, 2023
ae4a937
Merge pull request #12 from devonfw-sample/master
moritzLanger Mar 27, 2023
228125a
added Violations
moritzLanger Mar 27, 2023
7cb1ffb
Update NamingConventionTest.java
moritzLanger Mar 30, 2023
f02395b
Update NamingConventionTest.java
moritzLanger Mar 30, 2023
802c929
Update NamingConventionTest.java
moritzLanger Mar 30, 2023
4402c4c
Update NamingConventionTest.java
moritzLanger Mar 30, 2023
6bb36e2
Update NamingConventionTest.java
moritzLanger Mar 30, 2023
5d3caa0
revert undesired changes
hohwille Apr 25, 2023
30555bd
Delete NamingConventionTest.java
hohwille Apr 25, 2023
fda081d
Merge branch 'violations/convention' into ViolationIssue25
hohwille Apr 25, 2023
ffef215
Update ApplicationPersistenceEntity.java
hohwille Apr 25, 2023
71e6738
Update ViolationRepository.java
hohwille Apr 25, 2023
50e40e8
Update WrongInterfaceViolationEto.java
hohwille Apr 25, 2023
f5aff54
Update WrongNameRepository.java
hohwille Apr 25, 2023
6fddd89
Update WrongInterfaceViolationEto.java
hohwille Apr 25, 2023
f420328
Update MapperViolation.java
hohwille Apr 25, 2023
f423a29
Update ServiceViolation.java
hohwille Apr 25, 2023
4e86f16
Update UcViolation.java
hohwille Apr 25, 2023
ed0c1cb
Update ViolationEto.java
hohwille Apr 25, 2023
81a5d1c
Update ViolationEntity.java
hohwille Apr 25, 2023
25aa6d6
Update ViolationEntity.java
hohwille Apr 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.devonfw.sample.archunit.violation.common;

import javax.persistence.MappedSuperclass;

import com.devonfw.sample.archunit.general.common.ApplicationEntity;

/**
* Abstract base class for all persistent entities of this app.
*/
// Violation: ApplicationPersistenceEntity has to be be in layer dataaccess
@MappedSuperclass
public abstract class ApplicationPersistenceEntity implements ApplicationEntity {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.devonfw.sample.archunit.violation.common;


import com.devonfw.sample.archunit.general.common.ApplicationEntity;

/**
* {@link ApplicationEntity} for a single task item.
*/
public interface ViolationItem extends ApplicationEntity {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.devonfw.sample.archunit.violation.common;

import org.springframework.data.jpa.repository.JpaRepository;

import com.devonfw.sample.archunit.violation.dataaccess.ViolationEntity;

/**
* Interface for the {@link JpaRepository} giving database access to {@link ViolationEntity}.
*/
// Violation: JpaRepository has to be in layer dataaccess and should be in the same package as the entity.
public interface ViolationRepository extends JpaRepository<ViolationEntity, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.devonfw.sample.archunit.violation.common;


import com.devonfw.sample.archunit.general.common.AbstractEto;

/**
* {@link ViolationItem} implementation as {@link AbstractEto}.
*/
// Violation: ETO for entity interface shall be named «EntityName»Eto (ViolationItemEto)
public class WrongInterfaceViolationEto extends AbstractEto implements ViolationItem {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.devonfw.sample.archunit.violation.common;


import org.springframework.data.jpa.repository.JpaRepository;


import com.devonfw.sample.archunit.violation.dataaccess.ViolationEntity;

/**
* Interface for the {@link JpaRepository} giving database access to {@link ViolationEntity}.
*/
// Violation: JpaRepository interface shall be named «EntityName»Repository (ViolationRepository)
public interface WrongNameRepository extends JpaRepository<ViolationEntity, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.devonfw.sample.archunit.violation.dataaccess;

import org.mapstruct.Mapper;

/**
* {@link Mapper} for {@link com.devonfw.sample.archunit.task.common.TaskItem}.
*/
// Violation: Mapper has to be in logic layer and name has to end with Mapper.
@Mapper(componentModel = "cdi")
public abstract interface MapperViolation {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.devonfw.sample.archunit.violation.dataaccess;

import javax.ws.rs.Path;

/**
* Rest service for task component with {@link com.devonfw.sample.archunit.task.common.TaskList} and
* {@link com.devonfw.sample.archunit.task.common.TaskItem}.
*/
// Violation: REST-Service has to be in service layer and name has to end with "Service".
@Path("/task")
public class ServiceViolation {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.devonfw.sample.archunit.violation.dataaccess;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
import javax.transaction.Transactional;

import com.devonfw.sample.archunit.general.logic.AbstractUc;

/**
* {@link AbstractUc Use-case} to save {@link com.devonfw.sample.archunit.task.common.TaskList}s.
*/
@ApplicationScoped
@Named
@Transactional
// Violation: Use-case has to be in logic layer.
public class UcViolation extends AbstractUc {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.devonfw.sample.archunit.violation.dataaccess;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.devonfw.sample.archunit.general.dataaccess.ApplicationPersistenceEntity;
import com.devonfw.sample.archunit.violation.common.ViolationItem;

/**
* {@link TaskItem} implementation as {@link ApplicationPersistenceEntity}.
*/
@Entity
@Table(name = "VIOLATION")
// Violation: Entity has to be named «EntityName»Entity (ViolationItemEntity).
public class ViolationEntity extends ApplicationPersistenceEntity implements ViolationItem {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.devonfw.sample.archunit.violation.dataaccess;

import com.devonfw.sample.archunit.violation.common.ViolationItem;
import com.devonfw.sample.archunit.general.common.AbstractEto;

/**
* {@link ViolationItem} implementation as {@link AbstractEto}.
*/
// Violation: ETO has to be in common layer.
public class ViolationEto extends AbstractEto implements ViolationItem {
}