├── mw ├── .travis.yml ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .rultor.yml ├── .gitignore ├── stereotype.check.plugin.test ├── .checkstyle ├── src │ ├── main │ │ └── java │ │ │ └── info │ │ │ └── novatec │ │ │ └── ita │ │ │ └── check │ │ │ ├── testoutsideapplication │ │ │ ├── util │ │ │ │ └── NotToCheckUtil.java │ │ │ └── jaxws │ │ │ │ └── handler │ │ │ │ └── WSSUsernameTokenProducer.java │ │ │ └── testclasses │ │ │ ├── core │ │ │ └── fwk │ │ │ │ ├── common │ │ │ │ ├── ul │ │ │ │ │ ├── View.java │ │ │ │ │ └── ViewStereotype.java │ │ │ │ ├── util │ │ │ │ │ ├── Util.java │ │ │ │ │ ├── copy │ │ │ │ │ │ └── ObjectUtil.java │ │ │ │ │ └── DateUtil.java │ │ │ │ ├── init │ │ │ │ │ └── InitFunction.java │ │ │ │ ├── bl │ │ │ │ │ ├── bo │ │ │ │ │ │ └── BusinessOperation.java │ │ │ │ │ └── is │ │ │ │ │ │ ├── IntegrationService.java │ │ │ │ │ │ └── IntegrationServiceStereotype.java │ │ │ │ └── exception │ │ │ │ │ └── interceptor │ │ │ │ │ └── BusinessServiceExceptionInterceptor.java │ │ │ │ ├── api │ │ │ │ ├── ts │ │ │ │ │ └── TechnicalService.java │ │ │ │ ├── bl │ │ │ │ │ └── bs │ │ │ │ │ │ ├── BusinessService.java │ │ │ │ │ │ └── ApiBusinessService.java │ │ │ │ └── data │ │ │ │ │ └── dto │ │ │ │ │ └── Pojo.java │ │ │ │ ├── shared │ │ │ │ └── VersionTs.java │ │ │ │ └── main │ │ │ │ └── ts │ │ │ │ └── VersionTsBean.java │ │ │ └── app1 │ │ │ ├── main │ │ │ ├── data │ │ │ │ ├── dto │ │ │ │ │ ├── Sample.java │ │ │ │ │ ├── SampleNoBaseClassDto.java │ │ │ │ │ ├── SampleDtoExtendsSampleNoDto.java │ │ │ │ │ ├── SampleDtoExtendsSampleDto.java │ │ │ │ │ └── SampleDto.java │ │ │ │ └── entity │ │ │ │ │ ├── SampleEntityWithoutBaseclass.java │ │ │ │ │ ├── SampleEntity.java │ │ │ │ │ ├── common │ │ │ │ │ └── BaseEntity.java │ │ │ │ │ ├── CustomerConcern.java │ │ │ │ │ └── AdditionalOperation.java │ │ │ ├── bl │ │ │ │ ├── bs │ │ │ │ │ ├── SampleTest.java │ │ │ │ │ ├── SampleBsBean.java │ │ │ │ │ └── StreamBsBean.java │ │ │ │ ├── is │ │ │ │ │ ├── tf │ │ │ │ │ │ ├── Sample.java │ │ │ │ │ │ ├── BaseTf.java │ │ │ │ │ │ ├── SampleApplicationScoped.java │ │ │ │ │ │ ├── SampleTfExtendsSampleTf.java │ │ │ │ │ │ ├── SampleTfExtendsSampleNoTf.java │ │ │ │ │ │ ├── SampleWithWrongDepencencyTf.java │ │ │ │ │ │ └── SampleTf.java │ │ │ │ │ ├── SampleNoStereotype.java │ │ │ │ │ ├── SampleWithoutAnnotationIs.java │ │ │ │ │ ├── SampleWithoutInterfaceIs.java │ │ │ │ │ ├── SampleIs.java │ │ │ │ │ ├── SampleWithoutPostfix.java │ │ │ │ │ ├── SampleWithInnerClassIs.java │ │ │ │ │ ├── DependencyIs.java │ │ │ │ │ ├── Sample2Interfaces2Is.java │ │ │ │ │ ├── Sample2InterfacesIs.java │ │ │ │ │ ├── SampleWithDependencyOutsideApplicationIs.java │ │ │ │ │ ├── SampleWithPackageNamesIs.java │ │ │ │ │ └── SampleIsWithPackageNames.java │ │ │ │ ├── bo │ │ │ │ │ ├── SampleBo.java │ │ │ │ │ ├── SampleReferencingAttributeBo.java │ │ │ │ │ ├── SampleReferencingParameterBo.java │ │ │ │ │ ├── SampleReferencingReturnBo.java │ │ │ │ │ ├── SampleReferencingVarBo.java │ │ │ │ │ └── sub │ │ │ │ │ │ ├── SampleReferencingAttributeOtherPackageBo.java │ │ │ │ │ │ ├── SampleReferencingReturnOtherPackageBo.java │ │ │ │ │ │ ├── SampleReferencingParameterOtherPackageBo.java │ │ │ │ │ │ └── SampleReferencingVarOtherPackageBo.java │ │ │ │ └── wrong │ │ │ │ │ └── SampleWrongPackageIs.java │ │ │ ├── ul │ │ │ │ ├── App1TypedViewStereotype.java │ │ │ │ └── wt │ │ │ │ │ └── test │ │ │ │ │ ├── SampleCoreView.java │ │ │ │ │ ├── SampleApp1View.java │ │ │ │ │ ├── SampleViewContainsView.java │ │ │ │ │ └── SampleContainsTransformerView.java │ │ │ └── init │ │ │ │ ├── SampleNoStartupIf.java │ │ │ │ └── SampleIf.java │ │ │ └── shared │ │ │ └── bl │ │ │ └── bs │ │ │ ├── SampleNoInterfaceBs.java │ │ │ ├── SampleBs.java │ │ │ └── SampleApiBs.java │ └── test │ │ ├── resources │ │ ├── stereotype-dependency-not-allowed-in-override-override.xml │ │ ├── stereotype-dependency-allowed-in-override-fail-override.xml │ │ ├── stereotypeSufficientRemovedByOverride-override.xml │ │ ├── stereotype_invalidXML.xml │ │ ├── stereotypeSufficientRemovedByOverride.xml │ │ ├── duplicate-stereotype.xml │ │ ├── stereotypeNotMinimumSufficient.xml │ │ ├── stereotype-allowoverride-extend-override.xml │ │ ├── stereotype-dependency-allowed-in-override-fail.xml │ │ ├── stereotype-dependency-not-allowed-in-override.xml │ │ ├── stereotypeWithoutExcludedClass.xml │ │ ├── dependencyDuplicateFrom.xml │ │ ├── stereotype-allowoverride-override.xml │ │ ├── stereotypeCycle.xml │ │ ├── stereotype-allowoverride-extend.xml │ │ └── stereotype-allowoverride.xml │ │ └── java │ │ └── info │ │ └── novatec │ │ └── ita │ │ └── check │ │ ├── ClassInfoTest.java │ │ ├── config │ │ └── AnnotationOverrideTest.java │ │ └── AbstractStereotypeCheckTest.java └── pom.xml ├── stereotype.check.plugin ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.xml ├── src │ └── main │ │ ├── resources │ │ ├── info │ │ │ └── novatec │ │ │ │ └── ita │ │ │ │ └── check │ │ │ │ ├── checkstyle-metadata.properties │ │ │ │ └── checkstyle-metadata.xml │ │ ├── checkstyle_packages.xml │ │ ├── checkstyle-stereotype-override.xsd │ │ └── checkstyle-stereotype.xsd │ │ └── java │ │ └── info │ │ └── novatec │ │ └── ita │ │ └── check │ │ └── config │ │ ├── ConfigurationName.java │ │ ├── OverrideMode.java │ │ ├── StereotypeIdentifier.java │ │ ├── StereotypeCondition.java │ │ ├── AnnotationConfiguration.java │ │ ├── StereotypeCheckConfiguration.java │ │ └── DependencyConfiguration.java ├── AST-GUI.launch └── pom.xml ├── stereotype.check.feature ├── build.properties └── pom.xml ├── stereotype.check.repository ├── category.xml └── pom.xml ├── scrt ├── settings.xml.asc ├── pubring.gpg.asc └── secring.gpg.asc └── README.md /mw: -------------------------------------------------------------------------------- 1 | mvnw -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | after_success: 7 | - ./mvnw coveralls:report 8 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NovatecConsulting/stereotype-check/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip -------------------------------------------------------------------------------- /.rultor.yml: -------------------------------------------------------------------------------- 1 | docker: 2 | image: "yegor256/java8" 3 | decrypt: 4 | settings.xml: "repo/scrt/settings.xml.asc" 5 | pubring.gpg: "repo/scrt/pubring.gpg.asc" 6 | secring.gpg: "repo/scrt/secring.gpg.asc" 7 | release: 8 | script: | 9 | mvn org.eclipse.tycho:tycho-versions-plugin:set-version "-DnewVersion=${tag}" 10 | git commit -am "${tag}" 11 | mvn clean deploy --settings /home/r/settings.xml 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | *.class 3 | .gradletasknamecache 4 | build 5 | 6 | #Defaults 7 | #ignore thumbnails created by windows 8 | Thumbs.db 9 | #Ignore files build by Visual Studio 10 | *.obj 11 | *.exe 12 | *.pdb 13 | *.user 14 | *.aps 15 | *.pch 16 | *.vspscc 17 | *_i.c 18 | *_p.c 19 | *.ncb 20 | *.suo 21 | *.tlb 22 | *.tlh 23 | *.bak 24 | *.cache 25 | *.ilk 26 | *.log 27 | [Bb]in 28 | [Dd]ebug*/ 29 | *.lib 30 | *.sbr 31 | obj/ 32 | [Rr]elease*/ 33 | _ReSharper*/ 34 | [Tt]est[Rr]esult* 35 | *.jar 36 | .gradle 37 | repo 38 | target 39 | .project 40 | .settings 41 | .classpath 42 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /stereotype.check.plugin/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Stereotype-Check-Plugin 4 | Bundle-SymbolicName: stereotype.check.plugin;singleton:=true 5 | Bundle-Version: 4.0.0 6 | Bundle-ClassPath: . 7 | Bundle-Vendor: http://novatec-gmbh.de 8 | Export-Package: info.novatec.ita.check 9 | Require-Bundle: net.sf.eclipsecs.checkstyle;bundle-version="7.3.0", 10 | net.sf.eclipsecs.core;bundle-version="7.3.0", 11 | net.sf.eclipsecs.ui;bundle-version="7.3.0" 12 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 13 | Import-Package: org.apache.commons.lang3;version="3.1.0", 14 | org.eclipse.core.resources, 15 | org.eclipse.jdt.core.dom, 16 | org.eclipse.jface.resource, 17 | org.eclipse.jface.text, 18 | org.eclipse.swt.graphics, 19 | org.eclipse.ui 20 | Bundle-ActivationPolicy: lazy 21 | -------------------------------------------------------------------------------- /stereotype.check.feature/build.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright 2016 NovaTec Consulting GmbH 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ############################################################################### 16 | bin.includes = feature.xml 17 | -------------------------------------------------------------------------------- /stereotype.check.plugin/build.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright 2016 NovaTec Consulting GmbH 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ############################################################################### 16 | source.. = src/main/java 17 | output.. = target/classes/ 18 | bin.includes = plugin.xml,\ 19 | META-INF/,\ 20 | ., 21 | -------------------------------------------------------------------------------- /stereotype.check.plugin/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/resources/info/novatec/ita/check/checkstyle-metadata.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright 2016 NovaTec Consulting GmbH 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ############################################################################### 16 | StereotypeCheck.name = Stereotype Check 17 | StereotypeCheck.desc = Checks common architectural stereotypes 18 | -------------------------------------------------------------------------------- /stereotype.check.plugin/AST-GUI.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /stereotype.check.repository/category.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testoutsideapplication/util/NotToCheckUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | *     http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testoutsideapplication.util; 17 | 18 | import info.novatec.ita.check.testclasses.app1.main.data.entity.SampleEntity; 19 | 20 | public class NotToCheckUtil { 21 | 22 | SampleEntity entity; 23 | } 24 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/ul/View.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.ul; 17 | 18 | /** 19 | * Interface of the stereotype view. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface View { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/util/Util.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.util; 17 | 18 | /** 19 | * Interface of the stereotype util. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface Util { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/ul/ViewStereotype.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.ul; 17 | 18 | /** 19 | * Annotation of the stereotype view. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public @interface ViewStereotype { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/api/ts/TechnicalService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.api.ts; 17 | 18 | /** 19 | * Interface of the stereotype technical service. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface TechnicalService { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/init/InitFunction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.init; 17 | 18 | /** 19 | * Interface of the stereotype init function. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface InitFunction { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-dependency-not-allowed-in-override-override.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/api/bl/bs/BusinessService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.api.bl.bs; 17 | 18 | /** 19 | * Interface of the stereotype business service. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface BusinessService { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/dto/Sample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.dto; 17 | 18 | /** 19 | * This class is used by subclasses and has no postfix belonging to a 20 | * stereotype. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | */ 24 | public class Sample { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/bl/bo/BusinessOperation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.bl.bo; 17 | 18 | /** 19 | * Interface of the stereotype business operation. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface BusinessOperation { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-dependency-allowed-in-override-fail-override.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/bl/is/IntegrationService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.bl.is; 17 | 18 | /** 19 | * Interface of the stereotype integration service. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public interface IntegrationService { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /scrt/settings.xml.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | 3 | hQEMA5qETcGag5w6AQf9FrHdpRA+VAtR2SjZRYPz/Y0T5SXN+bfWxEPsUwPwL8Ua 4 | rTB77TOglut/mbNdHni2aE4IFPFJnQ+3aq7NH8fQoW4zFLhAFOYgo9PfuOfYPqR0 5 | tDUwEasFfAsCY39KJGCt6+lwqBsZThGa1zWbucfvUB1YIIqSpjyFkn9iNXNBbltw 6 | Ph2biIziu/6cY/3siASCRJv3XT9So3rdLiK2v9XoFRl5sI1AemcjDdoR4EZLgRmq 7 | c6oYFpugWeZ5Q5hvWa+Je+ey+EM0RHlXa7YFcCeN6Jj56nLO6BYn/mmu48/zx3E5 8 | 4xJX7Dmifjypvst4PndpD/4CeCZwNaSlOGVLBOFPr9LpASl88nay0Zx8G6NJ7Pz1 9 | WTrA1mtmWrcVOa24lZPkhEEno+uRnFTSdV5kxixLpW6SKGoBBXdGfOugcPo/yHIi 10 | j6JcxgFbw5ZBf9NI35w0gT9zlQ93lUm2Wjn+QWgFwxPeydxH465bBsh6asb4MIgI 11 | stGGlK51eTOdgGpYWkhc762LqNCzcKGAM04IG2ZiG//pOjwn6+F2FfSS6KI9JbR1 12 | hg8aT9qWi72HHgbVtSEUFbOVS8HYCY+EG2gof4O2T5YuRwn8DIIJg40OpvHsgDCR 13 | tRyXXgU+WciQUrvXyjKAVTi0AKbADYsj0s1c6bRBcTgj+mQelLbP9HZA3DZAfoVn 14 | 4aq6VLy+mjWoRh39HkbtCCe/weAiylbRkgv3kOZ/ykPVezi2YttQB7sZ0iPw0rOL 15 | QBGS5Ij7oU/0K7+LLxIX47fprpv9XmTa5ye4wTdPfTyUnMbwHB6S39r4O/A5A6al 16 | 2kzw/chEaWiyurO42/a6kDui5FNlKeodnzJZsWD+MK8rTZHbvWOHtIWVPTl9iPfY 17 | 5QAdZ/CEYgNDdbD+LrslBAmpMMyuY2mOwJgza7U7obyeFekz3ykPyGFBKmbopeaT 18 | TvFEhoJE/YpOC4sdt6SWLNh35GZIlgv6IPXz2OC1vg+x1ijtNiL36L9CDyo3rY71 19 | TaYtOMOBpm0VnS0GWdB6WsgCnfs= 20 | =9cjQ 21 | -----END PGP MESSAGE----- 22 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bs/SampleTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bs; 17 | 18 | /** 19 | * This valid class ends to Test. All classes that ends to "Test" are ignored by 20 | * the check. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public class SampleTest { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/dto/SampleNoBaseClassDto.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.dto; 17 | 18 | /** 19 | * This invalid class does not extend the base class defined by its stereotype. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public class SampleNoBaseClassDto { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/bl/is/IntegrationServiceStereotype.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.bl.is; 17 | 18 | /** 19 | * Annotation of the stereotype integration service 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public @interface IntegrationServiceStereotype { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/Sample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | /** 19 | * Base class of {@link SampleTfExtendsSampleNoTf}, which does not have the 20 | * postfix of the base class. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public class Sample { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/api/data/dto/Pojo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.api.data.dto; 17 | 18 | /** 19 | * Base class for the stereotype entity and dto. Therefore both stereotypes must 20 | * be define its base class as "necessary". 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public class Pojo { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/ConfigurationName.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | /** 19 | * The possible elements of a {@link StereotypeConfiguration} are defined by the 20 | * checkstyle-stereotype.xsd as subelement of the stereotype tag. 21 | */ 22 | public enum ConfigurationName { 23 | postfix, baseclassname, baseclass, interfacename, INTERFACE, ANNOTATIONNAME, ANNOTATION; 24 | } -------------------------------------------------------------------------------- /stereotype.check.feature/pom.xml: -------------------------------------------------------------------------------- 1 | 16 | 19 | 4.0.0 20 | 21 | info.novatec.ita 22 | stereotype.check 23 | 4.0.0 24 | 25 | stereotype.check.feature 26 | eclipse-feature 27 | 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/BaseTf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | import org.apache.commons.collections4.Transformer; 19 | 20 | /** 21 | * The valid class is abstract. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | public abstract class BaseTf implements Transformer { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/api/bl/bs/ApiBusinessService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.api.bl.bs; 17 | 18 | /** 19 | * Application specific interface of the stereotype business service used to 20 | * test the override mechanism. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public interface ApiBusinessService { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/dto/SampleDtoExtendsSampleNoDto.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.dto; 17 | 18 | /** 19 | * This invalid class extends a class, which does not belong to the same 20 | * stereotype. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public class SampleDtoExtendsSampleNoDto extends Sample { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/shared/bl/bs/SampleNoInterfaceBs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.shared.bl.bs; 17 | 18 | import javax.ejb.Remote; 19 | 20 | /** 21 | * This invalid interface does not extends the interface of its stereotype. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | @Remote 27 | public interface SampleNoInterfaceBs { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/exception/interceptor/BusinessServiceExceptionInterceptor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.exception.interceptor; 17 | 18 | /** 19 | * Interceptor used by the stereotype business service bean. 20 | * 21 | * @author Volker Koch (NovaTec Consulting GmbH) 22 | * 23 | */ 24 | public class BusinessServiceExceptionInterceptor { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testoutsideapplication/jaxws/handler/WSSUsernameTokenProducer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testoutsideapplication.jaxws.handler; 17 | 18 | /** 19 | * Class that is not part of the application. Referencing this class should not 20 | * result in a validation error. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public class WSSUsernameTokenProducer { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/util/copy/ObjectUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.util.copy; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.util.DateUtil; 19 | 20 | /** 21 | * Helper class to test the bug described in {@link DateUtil}. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | public class ObjectUtil { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/ul/App1TypedViewStereotype.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.ul; 17 | 18 | /** 19 | * This annotation is a application specific annotation that is used in the 20 | * application app1 to override the stereotype definition of view. 21 | * 22 | * @author Volker Koch (NovaTec Consulting GmbH) 23 | * 24 | */ 25 | public @interface App1TypedViewStereotype { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/entity/SampleEntityWithoutBaseclass.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.entity; 17 | 18 | import javax.persistence.Entity; 19 | 20 | /** 21 | * This invalid class does not extend the base class of its stereotype. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | @Entity 27 | public class SampleEntityWithoutBaseclass { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotypeSufficientRemovedByOverride-override.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleNoStereotype.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | /** 19 | * This class is in a package which belongs to stereotype, but the stereotype 20 | * defines the package name as "necessary". Therefore the class can be placed in 21 | * this package. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | public class SampleNoStereotype { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/shared/VersionTs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.shared; 17 | 18 | import javax.ejb.Remote; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.api.ts.TechnicalService; 21 | 22 | /** 23 | * Valid interface for its stereotype. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Remote 29 | public interface VersionTs extends TechnicalService { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/resources/checkstyle_packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/shared/bl/bs/SampleBs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.shared.bl.bs; 17 | 18 | import javax.ejb.Remote; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.api.bl.bs.BusinessService; 21 | 22 | /** 23 | * This is a valid interface belonging to a stereotype. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Remote 29 | public interface SampleBs extends BusinessService { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/entity/SampleEntity.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.entity; 17 | 18 | import javax.persistence.Entity; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.api.data.dto.Pojo; 21 | 22 | /** 23 | * This valid class extends the base class of this stereotype. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Entity 29 | public class SampleEntity extends Pojo { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/init/SampleNoStartupIf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.init; 17 | 18 | import javax.ejb.Singleton; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.common.init.InitFunction; 21 | 22 | /** 23 | * This invalid class has two missing annotation. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Singleton 29 | public class SampleNoStartupIf implements InitFunction { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/entity/common/BaseEntity.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.entity.common; 17 | 18 | import javax.persistence.Entity; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.api.data.dto.Pojo; 21 | 22 | /** 23 | * This valid class extends a base class of the stereotype. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Entity 29 | public class BaseEntity extends Pojo { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/SampleBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * Valid class without dependencies 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | */ 28 | @LocalBean 29 | @Stateless 30 | public class SampleBo implements BusinessOperation { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleWithoutAnnotationIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | 20 | /** 21 | * This invalid class has a missing annotation, which is defined by its 22 | * stereotype. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | * 26 | */ 27 | public class SampleWithoutAnnotationIs implements IntegrationService { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/entity/CustomerConcern.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.entity; 17 | 18 | import javax.persistence.Entity; 19 | 20 | import info.novatec.ita.check.testclasses.app1.main.data.entity.common.BaseEntity; 21 | 22 | /** 23 | * This valid class is a base class defined by its stereotype. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Entity 29 | public class CustomerConcern extends BaseEntity { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleWithoutInterfaceIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 19 | 20 | /** 21 | * This invalid class does not implement the interface defined by the 22 | * stereotype. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | * 26 | */ 27 | @IntegrationServiceStereotype 28 | public class SampleWithoutInterfaceIs { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/dto/SampleDtoExtendsSampleDto.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.dto; 17 | 18 | /** 19 | * This valid class extends a valid class of the same stereotype. The stereotype 20 | * defines a sufficient postfix. Therefore the base class defined by the 21 | * stereotype must not be extended directly. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | public class SampleDtoExtendsSampleDto extends SampleDto { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 20 | 21 | /** 22 | * Valid class used mainly by the reader checks. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | */ 26 | @IntegrationServiceStereotype 27 | public class SampleIs implements IntegrationService { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/entity/AdditionalOperation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.entity; 17 | 18 | import javax.persistence.Entity; 19 | 20 | /** 21 | * This invalid class extends a class, which is not defined to be a base class 22 | * of the stereotype. The override mechanism also does not define the base class 23 | * as valid. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @Entity 29 | public class AdditionalOperation extends CustomerConcern { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/init/SampleIf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.init; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Singleton; 20 | import javax.ejb.Startup; 21 | 22 | import info.novatec.ita.check.testclasses.core.fwk.common.init.InitFunction; 23 | 24 | /** 25 | * This valid class has three sufficient annotations. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @Singleton 31 | @Startup 32 | @LocalBean 33 | public class SampleIf implements InitFunction { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/SampleApplicationScoped.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | import javax.enterprise.context.ApplicationScoped; 19 | 20 | /** 21 | * This valid class, which belongs to no stereotype, uses a annotation of a 22 | * stereotype. The annotation of the stereotype is not marked as "sufficient". 23 | * therefore the class can use the annotation. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @ApplicationScoped 29 | public class SampleApplicationScoped { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/ul/wt/test/SampleCoreView.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.ul.wt.test; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.View; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.ViewStereotype; 20 | 21 | /** 22 | * In application app1 the annotation of the stereotype view is overridden. The 23 | * central annotation can also be used. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @ViewStereotype 29 | public class SampleCoreView implements View { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/wrong/SampleWrongPackageIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.wrong; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 20 | 21 | /** 22 | * This invalid class is in a package not defined by its stereotype. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | */ 26 | @IntegrationServiceStereotype 27 | public class SampleWrongPackageIs implements IntegrationService { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleWithoutPostfix.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 20 | 21 | /** 22 | * This invalid class has no postfix, as defined by its stereotype. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | * 26 | */ 27 | @IntegrationServiceStereotype 28 | public class SampleWithoutPostfix implements IntegrationService { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/ul/wt/test/SampleApp1View.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.ul.wt.test; 17 | 18 | import info.novatec.ita.check.testclasses.app1.main.ul.App1TypedViewStereotype; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.View; 20 | 21 | /** 22 | * In application app1 the annotation of the stereotype view is overridden. The 23 | * application specific annotation can be used. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @App1TypedViewStereotype 29 | public class SampleApp1View implements View { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/SampleReferencingAttributeBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed attribute dependency to another class. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | */ 28 | @LocalBean 29 | @Stateless 30 | public class SampleReferencingAttributeBo implements BusinessOperation { 31 | 32 | SampleBo wrongDependency; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype_invalidXML.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/shared/bl/bs/SampleApiBs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.shared.bl.bs; 17 | 18 | import javax.ejb.Remote; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.api.bl.bs.ApiBusinessService; 21 | 22 | /** 23 | * This class is used to check the override mechanism. Depending on the 24 | * override-file of the application app1 the interface can extends from an 25 | * application specific interface or not. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @Remote 31 | public interface SampleApiBs extends ApiBusinessService { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/SampleReferencingParameterBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed method parameter dependency to another class. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | */ 28 | @LocalBean 29 | @Stateless 30 | public class SampleReferencingParameterBo implements BusinessOperation { 31 | 32 | void wrongDependency(SampleBo bo) { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleWithInnerClassIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 20 | 21 | /** 22 | * This valid class has a inner class which is ignored by the check. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | * 26 | */ 27 | @IntegrationServiceStereotype 28 | public class SampleWithInnerClassIs implements IntegrationService { 29 | 30 | class Innerclass { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/SampleReferencingReturnBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed method return type dependency to another class. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | * 28 | */ 29 | @LocalBean 30 | @Stateless 31 | public class SampleReferencingReturnBo implements BusinessOperation { 32 | 33 | SampleBo wrongDependency() { 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/SampleTfExtendsSampleTf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | import javax.enterprise.context.ApplicationScoped; 19 | 20 | /** 21 | * This subclasses does not implement the interface defined by the stereotype 22 | * directly. The interface is specified by its base class. The sufficient 23 | * postfix is used by base class. Therefore the check can be sure, that the base 24 | * class implements the interface. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | */ 28 | @ApplicationScoped 29 | public class SampleTfExtendsSampleTf extends SampleTf { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/SampleTfExtendsSampleNoTf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | import javax.enterprise.context.ApplicationScoped; 19 | 20 | /** 21 | * This subclasses does not implement the interface defined by the stereotype 22 | * directly. The interface is specified by its base class. The sufficient 23 | * postfix is not used by base class. Therefore the check cannot be sure, that 24 | * the base class implements the interface. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | */ 28 | @ApplicationScoped 29 | public class SampleTfExtendsSampleNoTf extends Sample { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/SampleReferencingVarBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed local variable dependency to another class. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | * 28 | */ 29 | @LocalBean 30 | @Stateless 31 | public class SampleReferencingVarBo implements BusinessOperation { 32 | 33 | void wrongDependency() { 34 | SampleBo bo = new SampleBo(); 35 | bo.toString(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/data/dto/SampleDto.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.data.dto; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.api.data.dto.Pojo; 19 | 20 | /** 21 | * The subclasses of this class does not extends the base class defined by the 22 | * stereotype directly. The base class is specified by this class. If the 23 | * sufficient postfix of this class is the same as the postfix of the subclass, 24 | * the subclass can be sure, that this class extends the base class. Otherwise 25 | * this class will be invalid. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | */ 29 | public class SampleDto extends Pojo { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/resources/info/novatec/ita/check/checkstyle-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | %ArchitectureCheck.desc 26 | 27 | The filename where the stereotypes are defined 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/sub/SampleReferencingAttributeOtherPackageBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo.sub; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed attribute dependency to another class with full 25 | * qualified classname. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @LocalBean 31 | @Stateless 32 | public class SampleReferencingAttributeOtherPackageBo implements 33 | BusinessOperation { 34 | 35 | info.novatec.ita.check.testclasses.app1.main.bl.bo.SampleBo wrongDependency; 36 | } 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bs/SampleBsBean.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bs; 17 | 18 | import javax.ejb.Stateless; 19 | import javax.interceptor.Interceptors; 20 | 21 | import info.novatec.ita.check.testclasses.app1.shared.bl.bs.SampleBs; 22 | import info.novatec.ita.check.testclasses.core.fwk.common.exception.interceptor.BusinessServiceExceptionInterceptor; 23 | 24 | /** 25 | * This valid class has two annotations needed by its stereotype. One of the 26 | * them has parameters. 27 | * 28 | * @author Volker Koch (NovaTec Consulting GmbH) 29 | * 30 | */ 31 | @Stateless 32 | @Interceptors(BusinessServiceExceptionInterceptor.class) 33 | public class SampleBsBean implements SampleBs { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/DependencyIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.app1.main.bl.is.tf.SampleTf; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 20 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 21 | 22 | /** 23 | * This class has a valid dependency to a class of another stereotype. 24 | * 25 | * @author Volker Koch (NovaTec Consulting GmbH) 26 | * 27 | */ 28 | @IntegrationServiceStereotype 29 | public class DependencyIs implements IntegrationService { 30 | 31 | public void a() { 32 | SampleTf tf = new SampleTf(); 33 | tf.toString(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/sub/SampleReferencingReturnOtherPackageBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo.sub; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed method return type dependency to another class 25 | * with full qualified classname. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @LocalBean 31 | @Stateless 32 | public class SampleReferencingReturnOtherPackageBo implements BusinessOperation { 33 | 34 | info.novatec.ita.check.testclasses.app1.main.bl.bo.SampleBo wrongDependency() { 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/sub/SampleReferencingParameterOtherPackageBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo.sub; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed method parameter dependency to another class with 25 | * full qualified classname. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @LocalBean 31 | @Stateless 32 | public class SampleReferencingParameterOtherPackageBo implements 33 | BusinessOperation { 34 | 35 | void doit( 36 | info.novatec.ita.check.testclasses.app1.main.bl.bo.SampleBo wrongDependency) { 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/ul/wt/test/SampleViewContainsView.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.ul.wt.test; 17 | 18 | import javax.inject.Inject; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.View; 21 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.ViewStereotype; 22 | 23 | /** 24 | * This view injects another view which is allowed in the central file 25 | * stereotype-dependency-not-allowed-in-override.xml but not in the project specific file 26 | * stereotype-dependency-not-allowed-in-override-override.xml 27 | * 28 | * @author Volker Koch (NovaTec Consulting GmbH) 29 | */ 30 | @ViewStereotype 31 | public class SampleViewContainsView implements View{ 32 | 33 | @Inject 34 | SampleCoreView otherView; 35 | } 36 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bs/StreamBsBean.java: -------------------------------------------------------------------------------- 1 | package info.novatec.ita.check.testclasses.app1.main.bl.bs; 2 | 3 | import javax.ejb.Stateless; 4 | import javax.interceptor.Interceptors; 5 | 6 | import org.springframework.restdocs.payload.FieldDescriptor; 7 | import static org.springframework.restdocs.snippet.Attributes.key; 8 | import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; 9 | 10 | import info.novatec.ita.check.testclasses.app1.shared.bl.bs.SampleBs; 11 | import info.novatec.ita.check.testclasses.core.fwk.common.exception.interceptor.BusinessServiceExceptionInterceptor; 12 | 13 | @Stateless 14 | @Interceptors(BusinessServiceExceptionInterceptor.class) 15 | public class StreamBsBean implements SampleBs { 16 | 17 | protected static FieldDescriptor prefixed(String prefix, FieldDescriptor descriptor) { 18 | FieldDescriptor prefixed = fieldWithPath(prefix + descriptor.getPath()); 19 | prefixed.type(descriptor.getType()); 20 | prefixed.description(descriptor.getDescription()); 21 | if (descriptor.isOptional()) { 22 | prefixed.optional(); 23 | } 24 | if (descriptor.isIgnored()) { 25 | prefixed.ignored(); 26 | } 27 | //Works with stereotype check 28 | // for (Entry attributes : descriptor.getAttributes().entrySet()) { 29 | // prefixed.attributes(key(attributes.getKey()).value(attributes.getValue())); 30 | // } 31 | //Nullpointer with stereotype check 32 | descriptor.getAttributes().forEach((key, value) -> { 33 | prefixed.attributes(key(key).value(value)); 34 | }); 35 | return prefixed; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/main/ts/VersionTsBean.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.main.ts; 17 | 18 | import javax.ejb.Singleton; 19 | import javax.ejb.Startup; 20 | import javax.interceptor.Interceptors; 21 | 22 | import info.novatec.ita.check.testclasses.core.fwk.common.exception.interceptor.BusinessServiceExceptionInterceptor; 23 | import info.novatec.ita.check.testclasses.core.fwk.shared.VersionTs; 24 | 25 | /** 26 | * This valid class is annotated with Interceptors and one of the needed other 27 | * annotations of the stereotype. 28 | * 29 | * @author Volker Koch (NovaTec Consulting GmbH) 30 | * 31 | */ 32 | @Singleton 33 | @Startup 34 | @Interceptors(BusinessServiceExceptionInterceptor.class) 35 | public class VersionTsBean implements VersionTs { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotypeSufficientRemovedByOverride.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/Sample2Interfaces2Is.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import java.io.Serializable; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 22 | 23 | /** 24 | * This valid class implements more than one interfaces. One of them is 25 | * necessary for its stereotype. The IntegrationService is the first interface. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @IntegrationServiceStereotype 31 | public class Sample2Interfaces2Is implements IntegrationService, Serializable { 32 | 33 | /** SUID */ 34 | private static final long serialVersionUID = 1L; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/Sample2InterfacesIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import java.io.Serializable; 19 | 20 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 22 | 23 | /** 24 | * This valid class implements more than one interfaces. One of them is 25 | * necessary for its stereotype. The IntegrationService is the second interface. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @IntegrationServiceStereotype 31 | public class Sample2InterfacesIs implements Serializable, IntegrationService { 32 | 33 | /** SUID */ 34 | private static final long serialVersionUID = 1L; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/duplicate-stereotype.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/SampleWithWrongDepencencyTf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | import javax.enterprise.context.ApplicationScoped; 19 | 20 | import org.apache.commons.collections4.Transformer; 21 | 22 | import info.novatec.ita.check.testclasses.app1.main.bl.is.DependencyIs; 23 | 24 | /** 25 | * This invalid class has a dependency to a class from another stereotype, which 26 | * is not allowed. 27 | * 28 | * @author Volker Koch (NovaTec Consulting GmbH) 29 | * 30 | */ 31 | @ApplicationScoped 32 | public class SampleWithWrongDepencencyTf implements Transformer { 33 | 34 | @Override 35 | public Object transform(Object input) { 36 | DependencyIs dependencyIs = new DependencyIs(); 37 | dependencyIs.toString(); 38 | return null; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotypeNotMinimumSufficient.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/bo/sub/SampleReferencingVarOtherPackageBo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.bo.sub; 17 | 18 | import javax.ejb.LocalBean; 19 | import javax.ejb.Stateless; 20 | 21 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.bo.BusinessOperation; 22 | 23 | /** 24 | * This class has a disallowed local variable dependency to another class with 25 | * full qualified classname. 26 | * 27 | * @author Volker Koch (NovaTec Consulting GmbH) 28 | * 29 | */ 30 | @LocalBean 31 | @Stateless 32 | public class SampleReferencingVarOtherPackageBo implements BusinessOperation { 33 | 34 | void doit() { 35 | info.novatec.ita.check.testclasses.app1.main.bl.bo.SampleBo wrongDependency = new info.novatec.ita.check.testclasses.app1.main.bl.bo.SampleBo(); 36 | wrongDependency.toString(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleWithDependencyOutsideApplicationIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype; 20 | import info.novatec.ita.check.testoutsideapplication.jaxws.handler.WSSUsernameTokenProducer; 21 | 22 | /** 23 | * This valid class has a dependency to a class, which may be a stereotype, but 24 | * the class is not in a package that belongs to the checked application. 25 | * 26 | * @author Volker Koch (NovaTec Consulting GmbH) 27 | * 28 | */ 29 | @IntegrationServiceStereotype 30 | public class SampleWithDependencyOutsideApplicationIs implements 31 | IntegrationService { 32 | 33 | public WSSUsernameTokenProducer getProducer() { 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/tf/SampleTf.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is.tf; 17 | 18 | import javax.enterprise.context.ApplicationScoped; 19 | 20 | import org.apache.commons.collections4.Transformer; 21 | 22 | /** 23 | * The subclasses of this base class does not implement the interface defined by 24 | * the stereotype directly. The interface is specified by this base class. If 25 | * the sufficient postfix of the base class is the same as the postfix of the 26 | * subclass, the subclass can be sure, that the base class implements the 27 | * interface. Otherwise the base class will be invalid. 28 | * 29 | * @author Volker Koch (NovaTec Consulting GmbH) 30 | */ 31 | @ApplicationScoped 32 | public class SampleTf implements Transformer { 33 | 34 | @Override 35 | public Object transform(Object input) { 36 | return null; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleWithPackageNamesIs.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | 20 | /** 21 | * This valid class uses full qualified classname. 22 | * 23 | * @author Volker Koch (NovaTec Consulting GmbH) 24 | * 25 | */ 26 | @info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype 27 | public class SampleWithPackageNamesIs 28 | implements 29 | info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService { 30 | 31 | public void a( 32 | info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService b) { 33 | IntegrationService integrationService = new info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService() { 34 | 35 | }; 36 | integrationService.toString(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/ul/wt/test/SampleContainsTransformerView.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.ul.wt.test; 17 | 18 | import javax.inject.Inject; 19 | 20 | import info.novatec.ita.check.testclasses.app1.main.bl.is.tf.SampleTf; 21 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.View; 22 | import info.novatec.ita.check.testclasses.core.fwk.common.ul.ViewStereotype; 23 | 24 | /** 25 | * This view injects a transformer which is not allowed in the central file 26 | * stereotype-dependency-allowed-in-override-fail.xml but the project 27 | * specific file stereotype-dependency-allowed-in-override-fail-override.xml 28 | * allows this. This configuration is not allowed. 29 | * 30 | * @author Volker Koch (NovaTec Consulting GmbH) 31 | */ 32 | @ViewStereotype 33 | public class SampleContainsTransformerView implements View { 34 | 35 | @Inject 36 | SampleTf sampleTf; 37 | } 38 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/core/fwk/common/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.core.fwk.common.util; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.util.copy.ObjectUtil; 19 | 20 | /** 21 | * Valid class that implements the interface of the stereotype and imports a 22 | * class that has the postfix stereotype, which is the same string as the name 23 | * of the implemented interface. This constellation results in a solved bug, 24 | * that the class does not implements the interface. To get the full qualified 25 | * classname of {@link Util} all imports are scanned an the ObjectUtil class was 26 | * found, because the match is done by import.endsWith("Util") instead of 27 | * import.endsWith(".Util"). 28 | * 29 | * @author Volker Koch (NovaTec Consulting GmbH) 30 | * 31 | */ 32 | public class DateUtil implements Util { 33 | 34 | ObjectUtil util = new ObjectUtil(); 35 | } 36 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/java/info/novatec/ita/check/ClassInfoTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | *     http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.Test; 21 | 22 | /** 23 | * Tests for {@link ClassInfo}. 24 | */ 25 | public class ClassInfoTest { 26 | @Test 27 | public void getFullClassNameWithPackage() { 28 | 29 | ClassInfo classInfo = new ClassInfo(); 30 | classInfo.setClassName("Classname", null); 31 | classInfo.setPackageName("package1.package2"); 32 | 33 | String fullClassName = classInfo.getFullClassName(); 34 | 35 | assertThat(fullClassName).isEqualTo("package1.package2.Classname"); 36 | } 37 | 38 | @Test 39 | public void getFullClassNameWithOutPackage() { 40 | 41 | ClassInfo classInfo = new ClassInfo(); 42 | classInfo.setClassName("Classname", null); 43 | classInfo.setPackageName(null); 44 | 45 | String fullClassName = classInfo.getFullClassName(); 46 | 47 | assertThat(fullClassName).isEqualTo("Classname"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/main/java/info/novatec/ita/check/testclasses/app1/main/bl/is/SampleIsWithPackageNames.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.testclasses.app1.main.bl.is; 17 | 18 | import info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService; 19 | 20 | /** 21 | * This invalid class has not the correct postfix. In addition all names of the 22 | * classes are full qualified. 23 | * 24 | * @author Volker Koch (NovaTec Consulting GmbH) 25 | * 26 | */ 27 | @info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationServiceStereotype 28 | public class SampleIsWithPackageNames 29 | implements 30 | info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService { 31 | 32 | public void a( 33 | info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService b) { 34 | IntegrationService integrationService = new info.novatec.ita.check.testclasses.core.fwk.common.bl.is.IntegrationService() { 35 | 36 | }; 37 | integrationService.toString(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/OverrideMode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | /** 19 | * If an annotation or a base class or an interface is marked with allowoveride in the central 20 | * configuration file, a project specific configuration file can define how 21 | * the override is done. 22 | * 23 | * @author Volker Koch (volker.koch@novatec-gmbh.de) 24 | * 25 | */ 26 | public enum OverrideMode { 27 | /** 28 | * The original annotation is ignored and only the annotations from the 29 | * local file are used. 30 | */ 31 | replace, 32 | /** the original annotation must not be defined again in the local file. */ 33 | extend; 34 | 35 | /** 36 | * Get the {@link OverrideMode} from its name. If the name is null the 37 | * {@link OverrideMode#replace} is returned. 38 | * 39 | * @param name 40 | * The name of the {@link OverrideMode}. 41 | * @return An {@link OverrideMode}. 42 | */ 43 | public static OverrideMode valueOfWithDefault(String name) { 44 | if (name != null) { 45 | return valueOf(name); 46 | } 47 | return replace; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/StereotypeIdentifier.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | /** Primary key of a {@link StereotypeConfiguration}. */ 19 | public class StereotypeIdentifier { 20 | 21 | /** The ID. Can be null if not read from configuration file */ 22 | private String id; 23 | 24 | /** 25 | * Creates a new primary key for a {@link StereotypeConfiguration}. 26 | * 27 | * @param id 28 | * The id. 29 | * @return The new key. 30 | */ 31 | public static StereotypeIdentifier of(String id) { 32 | return new StereotypeIdentifier(id); 33 | } 34 | 35 | private StereotypeIdentifier(String id) { 36 | this.id = id; 37 | } 38 | 39 | /** {@inheritDoc} */ 40 | @Override 41 | public boolean equals(Object obj) { 42 | if (obj == null || !(obj instanceof StereotypeIdentifier)) { 43 | return false; 44 | } 45 | return id != null && id.equals(((StereotypeIdentifier) obj).id); 46 | } 47 | 48 | /** {@inheritDoc} */ 49 | @Override 50 | public int hashCode() { 51 | return id != null ? id.hashCode() : super.hashCode(); 52 | } 53 | 54 | /** {@inheritDoc} */ 55 | @Override 56 | public String toString() { 57 | return id; 58 | } 59 | } -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-allowoverride-extend-override.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 42 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-dependency-allowed-in-override-fail.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-dependency-not-allowed-in-override.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotypeWithoutExcludedClass.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/StereotypeCondition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | /** 19 | * All possible conditions a part (annotation, postfix etc.) of a stereotype 20 | * definition can have. If a part of a stereotype definition is marked as 21 | * sufficient, this means that if a class conforms to this part, the class 22 | * belongs to the stereotype. In this case the class must have all other parts. 23 | * 24 | * E.g. If a class has a sufficient postfix Dto and the stereotype has necessary 25 | * interface Pojo, the class must implement this interface. If a class 26 | * implements the interface Pojo but has a postfix Other the class does not 27 | * belong to this stereotype. 28 | * 29 | * A stereotype definition must have one sufficient condition and one of the 30 | * sufficient conditions must be the postfix or package-name. This is necessary 31 | * to check the dependencies by analyzing the full qualified classname of an 32 | * import. 33 | * 34 | * @author Volker Koch (volker.koch@novatec-gmbh.de) 35 | * 36 | */ 37 | public enum StereotypeCondition { 38 | 39 | sufficient, necessary; 40 | 41 | /** 42 | * @param condition 43 | * the condition 44 | * @return true if the condition is sufficient and the condition is true. 45 | */ 46 | public boolean isSufficent(boolean condition) { 47 | if (this == sufficient) { 48 | return condition; 49 | } 50 | return false; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/dependencyDuplicateFrom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-allowoverride-override.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotypeCycle.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /stereotype.check.repository/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 4.0.0 22 | 23 | info.novatec.ita 24 | stereotype.check 25 | 4.0.0 26 | 27 | stereotype.check.repository 28 | eclipse-repository 29 | 30 | 31 | 32 | 33 | 34 | org.apache.maven.wagon 35 | wagon-ftp 36 | 2.10 37 | 38 | 39 | 40 | 41 | org.codehaus.mojo 42 | wagon-maven-plugin 43 | 1.0 44 | 45 | 46 | upload-assembly 47 | deploy 48 | 49 | upload 50 | 51 | 52 | www.novatec-gmbh.de 53 | ${project.build.directory}/repository 54 | www.novatec-gmbh.de 55 | stereotype-check 56 | 57 | 58 | 59 | 60 | 61 | org.eclipse.tycho.extras 62 | tycho-p2-extras-plugin 63 | ${tycho-version} 64 | 65 | 66 | mirror 67 | prepare-package 68 | 69 | mirror 70 | 71 | 72 | 73 | 74 | http://www.novatec-gmbh.de/updatesite/ita/stereotype-check 75 | p2 76 | 77 | 78 | ${project.build.directory}/repository 79 | true 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /stereotype.check.plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 16 | 19 | 4.0.0 20 | 21 | info.novatec.ita 22 | stereotype.check 23 | 4.0.0 24 | 25 | stereotype.check.plugin 26 | eclipse-plugin 27 | 28 | 29 | 30 | 31 | org.jacoco 32 | jacoco-maven-plugin 33 | 34 | 35 | 36 | prepare-agent 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | deploy_maven 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-source-plugin 52 | 3.0.1 53 | 54 | 55 | attach-sources 56 | 57 | jar-no-fork 58 | 59 | 60 | 61 | 62 | 63 | org.apache.maven.plugins 64 | maven-javadoc-plugin 65 | 2.10.4 66 | 67 | 68 | attach-javadocs 69 | 70 | jar 71 | 72 | 73 | 74 | 75 | 76 | org.sonatype.plugins 77 | nexus-staging-maven-plugin 78 | 79 | 80 | maven-gpg-plugin 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | com.puppycrawl.tools 90 | checkstyle 91 | 92 | 93 | org.apache.commons 94 | commons-lang3 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-allowoverride-extend.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 55 | 56 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | 69 | 70 | 73 | 76 | 77 | 78 | 79 | 80 | 83 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/java/info/novatec/ita/check/config/AnnotationOverrideTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import java.io.File; 21 | 22 | import org.junit.Test; 23 | 24 | import info.novatec.ita.check.AbstractStereotypeCheckTest; 25 | import info.novatec.ita.check.config.OverrideMode; 26 | import info.novatec.ita.check.config.StereotypeCheckConfiguration; 27 | import info.novatec.ita.check.config.StereotypeCheckReader; 28 | import info.novatec.ita.check.config.StereotypeConfiguration; 29 | import info.novatec.ita.check.config.StereotypeIdentifier; 30 | 31 | /** 32 | * Tests to check the override behavior of annotations. 33 | * 34 | * @author Volker Koch (NovaTec Consulting GmbH) 35 | * 36 | */ 37 | public class AnnotationOverrideTest extends AbstractStereotypeCheckTest { 38 | 39 | /** 40 | * Checks that a annotationname is overridden by {@link OverrideMode#replace} 41 | * . 42 | * 43 | * @throws Exception 44 | * in case of an unexpected test execution 45 | */ 46 | @Test 47 | public void annotationnameIsOverriddenByReplace() throws Exception { 48 | StereotypeCheckConfiguration config = StereotypeCheckReader 49 | .read(new File("src/test/resources/stereotype-allowoverride.xml")); 50 | 51 | StereotypeConfiguration view = config.getStereotypeConfig().get(StereotypeIdentifier.of("view")); 52 | assertThat(view).isNotNull(); 53 | assertThat(view.getAnnotationNamesAsString()) 54 | .isEqualTo("info.novatec.ita.check.testclasses.app1.main.ul.App1TypedViewStereotype"); 55 | } 56 | 57 | /** 58 | * Checks that a annotation is overridden by {@link OverrideMode#replace}. 59 | * 60 | * @throws Exception 61 | * in case of an unexpected test execution. 62 | */ 63 | @Test 64 | public void annotationIsOverriddenByReplace() throws Exception { 65 | StereotypeCheckConfiguration config = StereotypeCheckReader 66 | .read(new File("src/test/resources/stereotype-allowoverride.xml")); 67 | StereotypeConfiguration view2 = config.getStereotypeConfig().get(StereotypeIdentifier.of("view2")); 68 | assertThat(view2).isNotNull(); 69 | assertThat(view2.getAnnotationNamesAsString()) 70 | .isEqualTo("info.novatec.ita.check.testclasses.app1.main.ul.App1TypedViewStereotype2"); 71 | } 72 | 73 | /** 74 | * Checks that a annotation that is overrideable is not overridden. 75 | * 76 | * @throws Exception 77 | * in case of an unexpected test execution. 78 | */ 79 | @Test 80 | public void annotationIsNotOverridden() throws Exception { 81 | StereotypeCheckConfiguration config = StereotypeCheckReader 82 | .read(new File("src/test/resources/stereotype-allowoverride.xml")); 83 | StereotypeConfiguration viewNotOverridden = config.getStereotypeConfig() 84 | .get(StereotypeIdentifier.of("viewNotOverridden")); 85 | assertThat(viewNotOverridden).isNotNull(); 86 | assertThat(viewNotOverridden.getAnnotationNamesAsString()) 87 | .isEqualTo("info.novatec.ita.check.testclasses.core.fwk.common.ul.ViewStereotype3"); 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /scrt/pubring.gpg.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | Version: GnuPG v2 3 | 4 | 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 64 | yBeQ4XdsPIeq/evgqOhRxovEPC7d 65 | =ZduE 66 | -----END PGP MESSAGE----- 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stereotype Checker Readme 2 | 3 | 4 | ## Status 5 | [![Build Status](https://travis-ci.org/NovaTecConsulting/stereotype-check.svg?branch=master)](https://travis-ci.org/NovaTecConsulting/stereotype-check) 6 | [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) 7 | [![Coverage Status](https://coveralls.io/repos/github/NovaTecConsulting/stereotype-check/badge.svg?branch=master)](https://coveralls.io/github/NovaTecConsulting/stereotype-check?branch=master) 8 | [![Dependency Status](https://www.versioneye.com/user/projects/583807d6e7cea00029198ced/badge.svg?style=flat)](https://www.versioneye.com/user/projects/583807d6e7cea00029198ced) 9 | 10 | ##[Wiki](https://github.com/NovaTecConsulting/stereotype-check/wiki) 11 | ### [Installation Guide](https://github.com/NovaTecConsulting/stereotype-check/wiki/Installation-Guide) 12 | ### [Configuration Guide](https://github.com/NovaTecConsulting/stereotype-check/wiki/Configuration-Guide) 13 | 14 | ## Build your own version of the Plugin 15 | 16 | ### Installation of Eclipse Checkstyle Plugin 17 | 18 | In order to get the stereotype checker plugin running in eclipse, an appropriate checkstyle plugin version has to be installed. 19 | 20 | * Therefore download the correct update-site from [Sourceforge](https://sourceforge.net/projects/eclipse-cs/files/Eclipse%20Checkstyle%20Plug-in/) 21 | * Add the local update site. "Help -> Install new Software -> Add" 22 | - Name: Local Eclipse Checkstyle Update Site 23 | - Click "Archive" and choose the downloaded zip file 24 | 25 | ### Build the Stereotype Check Plugin 26 | * Build the plugin and create an update site using Maven: `mvn clean install` 27 | 28 | ### Install the Stereotype Check Plugin 29 | 30 | To be able to check the project with checkstyle, the stereotype checker must be installed to the current eclipse installation. Follow these steps to achieve this: 31 | * Install the plugin from there via "Help -> Install new Software" 32 | - Select Add.. annd then Local... 33 | - Select the directory relative to the project root `./stereotype.check.repository/target/repository` 34 | - Select the created plugin and install it. 35 | 36 | ### Configure the Stereotype check Plugin 37 | 38 | Activate checkstyle for your project e.g. the "stereotype check.plugin.test" which contains many classes with problems. 39 | * Open the properties of your project and select Checkstyle 40 | * Add a new or change your Local Check Configuration 41 | * In the list of the known modules select "Other/Stereotype Check" and press Add... 42 | * You have to provide a configuration file. If the project is "stereotype check.plugin.test" you can use "${config_loc}/checkstyle-stereotype.xml" 43 | * TODO description of the configuration file 44 | 45 | --SNIPPET FROM StereotypeCondition 46 | All possible conditions a part (annotation, postfix etc.) of a stereotype 47 | definition can have. If a part of a stereotype definition is marked as 48 | sufficient, this means that if a class conforms to this part, the class 49 | belongs to the stereotype. In this case the class must have all other parts. 50 | 51 | E.g. If a class has a sufficient postfix Dto and the stereotype has necessary 52 | interface Pojo, the class must implement this interface. If a class 53 | implements the interface Pojo but has a postfix Other the class does not 54 | belong to this stereotype. 55 | 56 | A stereotype definition must have one sufficient condition and one of the 57 | sufficient conditions must be the postfix or package-name. This is necessary 58 | to check the dependencies by analyzing the full qualified classname of an 59 | import. 60 | --END 61 | 62 | 63 | 64 | ### Debug the Eclipse Plugin 65 | 66 | Sometimes it is helpfull to be able to debug the eclipse plugin. Some prerequisites have to be fulfilled to do this: 67 | 68 | * Install the Eclipse Plug-In Development Tools if not already done 69 | - "Help -> Install new Software" 70 | - Choose "The Eclipse Project Updates - http://download.eclipse.org/eclipse/updates/4.5" or add it, if not present 71 | - Choose "Eclipse Plug-in Development Environment" and install it 72 | 73 | To actually debug the plugin select "Debug as -> Eclipse Application" from the context menu of the "stereotype.check.plugin" project 74 | 75 | 76 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/resources/checkstyle-stereotype-override.xsd: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 59 | 61 | 62 | 63 | 64 | 65 | 66 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 76 | 78 | 79 | 80 | 81 | 82 | 83 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/AnnotationConfiguration.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | import java.util.HashSet; 19 | import java.util.Set; 20 | 21 | /** 22 | * This class holds the configuration of the annotations for a stereotype. One 23 | * (or more) of the annotations in this configuration must be used in the class 24 | * that belongs to a stereotype. 25 | * 26 | * @author Volker Koch (volker.koch@novatec-gmbh.de) 27 | */ 28 | public class AnnotationConfiguration { 29 | 30 | /** The full qualified names of the annotations a stereotype must have. */ 31 | private Set annotationNames = new HashSet<>(); 32 | 33 | /** Are the annotations sufficient or necessary for the stereotype. */ 34 | private StereotypeCondition annotationNameCondition; 35 | 36 | /** 37 | * @return The full qualified names of the annotations a stereotype must 38 | * have. 39 | */ 40 | public Set getAnnotationNames() { 41 | return annotationNames; 42 | } 43 | 44 | /** 45 | * Add a full qualified name of an annotation a stereotype must have. 46 | * 47 | * @param annotationName 48 | * full qualified name of an annotation, if null nothing is 49 | * added. 50 | */ 51 | void addAnnotationName(String annotationName) { 52 | if (annotationName != null) { 53 | this.annotationNames.add(annotationName); 54 | } 55 | } 56 | 57 | /** 58 | * @return the condition for the annotations. 59 | */ 60 | public StereotypeCondition getAnnotationNameCondition() { 61 | return annotationNameCondition; 62 | } 63 | 64 | /** 65 | * Set the condition of the annotations. 66 | * 67 | * @param annotationNameCondition 68 | * the condition 69 | */ 70 | void setAnnotationnameCondition(StereotypeCondition annotationNameCondition) { 71 | this.annotationNameCondition = annotationNameCondition; 72 | } 73 | 74 | /** 75 | * Check if the annotation is present is in the class, is the annotation 76 | * sufficient. 77 | * 78 | * @param hasAnnotation 79 | * is the annotation present 80 | * @return true if the condition is sufficient and the annotation is 81 | * present. 82 | */ 83 | public boolean isAnnotationNameSufficent(boolean hasAnnotation) { 84 | if (annotationNameCondition != null) { 85 | return annotationNameCondition.isSufficent(hasAnnotation); 86 | } 87 | return false; 88 | } 89 | 90 | @Override 91 | public int hashCode() { 92 | final int prime = 31; 93 | int result = 1; 94 | result = prime * result + ((annotationNameCondition == null) ? 0 : annotationNameCondition.hashCode()); 95 | result = prime * result + ((annotationNames == null) ? 0 : annotationNames.hashCode()); 96 | return result; 97 | } 98 | 99 | @Override 100 | public boolean equals(Object obj) { 101 | if (this == obj) 102 | return true; 103 | if (obj == null) 104 | return false; 105 | if (getClass() != obj.getClass()) 106 | return false; 107 | AnnotationConfiguration other = (AnnotationConfiguration) obj; 108 | if (annotationNameCondition != other.annotationNameCondition) 109 | return false; 110 | if (annotationNames == null) { 111 | if (other.annotationNames != null) 112 | return false; 113 | } else if (!annotationNames.equals(other.annotationNames)) 114 | return false; 115 | return true; 116 | } 117 | 118 | @Override 119 | public String toString() { 120 | return "AnnotationConfiguration [annotationNames=" + annotationNames + ", annotationNameCondition=" 121 | + annotationNameCondition + "]"; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /scrt/secring.gpg.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | Version: GnuPG v2 3 | 4 | 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 70 | O8vBv671 71 | =kq84 72 | -----END PGP MESSAGE----- 73 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/resources/checkstyle-stereotype.xsd: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 10 | 12 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 71 | 73 | 74 | 75 | 76 | 77 | 78 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 88 | 90 | 91 | 92 | 93 | 94 | 95 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/java/info/novatec/ita/check/AbstractStereotypeCheckTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import java.io.ByteArrayInputStream; 21 | import java.io.File; 22 | import java.io.IOException; 23 | import java.io.InputStreamReader; 24 | import java.io.LineNumberReader; 25 | import java.util.Arrays; 26 | 27 | import com.puppycrawl.tools.checkstyle.BaseFileSetCheckTestSupport; 28 | import com.puppycrawl.tools.checkstyle.Checker; 29 | import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 30 | import com.puppycrawl.tools.checkstyle.TreeWalker; 31 | import com.puppycrawl.tools.checkstyle.api.Configuration; 32 | 33 | public class AbstractStereotypeCheckTest extends BaseFileSetCheckTestSupport { 34 | 35 | /** 36 | * Get the project relative path to the .java file of the given class 37 | * 38 | * @param clazz 39 | * class 40 | * @return project relative path to the .java file 41 | * 42 | */ 43 | protected String getPath(Class clazz) throws IOException { 44 | return new File("src/main/java/" + clazz.getName().replaceAll("\\.", "/") + ".java").getCanonicalPath(); 45 | } 46 | 47 | /** 48 | * Create a default configuration from ("src/test/resources/stereotype.xml") 49 | * to execute to stereotype check checkstyle plugin. 50 | * 51 | * @return The configuration. 52 | */ 53 | protected DefaultConfiguration createDefaultConfig() { 54 | return createConfig("src/test/resources/stereotype.xml"); 55 | } 56 | 57 | /** 58 | * Create a configuration to execute to stereotype check checkstyle plugin. 59 | * 60 | * @param configFilename 61 | * The project relative path to the configuration file used by 62 | * the stereotype check. 63 | * @return The configuration. 64 | */ 65 | protected DefaultConfiguration createConfig(String configFilename) { 66 | DefaultConfiguration main = createCheckConfig(TreeWalker.class); 67 | final DefaultConfiguration checkConfig = createCheckConfig(StereotypeCheck.class); 68 | checkConfig.addAttribute("file", configFilename); 69 | main.addChild(checkConfig); 70 | return main; 71 | } 72 | 73 | /* 74 | * (non-Javadoc) 75 | * 76 | * @see com.puppycrawl.tools.checkstyle.BaseCheckTestSupport#verify(com. 77 | * puppycrawl.tools.checkstyle.Checker, java.io.File[], java.lang.String, 78 | * java.lang.String[]) 79 | */ 80 | protected void verify(Checker checker, File[] processedFiles, String messageFileName, String... expectedErrorTexts) 81 | throws Exception { 82 | this.stream.flush(); 83 | int numberOfErrors = checker.process(Arrays.asList(processedFiles)); 84 | 85 | LineNumberReader errors = new LineNumberReader( 86 | new InputStreamReader(new ByteArrayInputStream(this.stream.toByteArray()))); 87 | 88 | for (int i = 0; i < expectedErrorTexts.length; ++i) { 89 | String actual = errors.readLine(); 90 | assertThat(actual).as("error message %s", i).contains(expectedErrorTexts[i]); 91 | } 92 | 93 | assertThat(numberOfErrors).as("got unexpected error count with error message: %s", errors.readLine()) 94 | .isEqualTo(expectedErrorTexts.length); 95 | 96 | checker.destroy(); 97 | } 98 | 99 | protected void verify(Configuration aConfig, String fileName, String expected) throws Exception { 100 | verify(createChecker(aConfig), fileName, fileName, expected); 101 | } 102 | 103 | protected void verify(Checker c, String processedFilename, String messageFileName, String expected) 104 | throws Exception { 105 | verify(c, new File[] { new File(processedFilename) }, messageFileName, expected); 106 | } 107 | 108 | protected void verify(Checker c, File[] processedFiles, String messageFileName, String expected) throws Exception { 109 | String[] expectedAsArray; 110 | if (expected == null) { 111 | expectedAsArray = new String[] {}; 112 | } else { 113 | expectedAsArray = new String[] { expected }; 114 | } 115 | verify(c, processedFiles, messageFileName, expectedAsArray); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/StereotypeCheckConfiguration.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | import java.util.Map; 19 | import java.util.Set; 20 | import java.util.regex.Pattern; 21 | 22 | /** 23 | * This class holds all configuration informations from the stereotype check 24 | * configuration file. 25 | * 26 | * @author Volker Koch (volker.koch@novatec-gmbh.de) 27 | * 28 | */ 29 | public class StereotypeCheckConfiguration { 30 | 31 | /** 32 | * The package names checked by the stereotype check. Classes outside this 33 | * packages and its subpackages are ignored 34 | */ 35 | private final Set applicationPackageNames; 36 | 37 | /** 38 | * The set of regular expressions of classes that are excluded from the 39 | * check. 40 | */ 41 | private final Set excludedClasses; 42 | 43 | /** 44 | * The map of all allowed dependencies. Maps from a stereotype-name to list 45 | * of allowed stereotypes. All strings in the map must match a key of the 46 | * {@link #stereotypeConfig}. 47 | */ 48 | private final Map dependencies; 49 | 50 | /** 51 | * The stereotypes. The key is the name of the stereotype. 52 | */ 53 | private final Map stereotypeConfig; 54 | 55 | /** 56 | * Constructor 57 | * 58 | * @param applicationPackageNames 59 | * he package names checked by the stereotype check. 60 | * @param dependencies 61 | * The map of all dependencies. 62 | * @param stereotypeConfig 63 | * The stereotypes. 64 | */ 65 | StereotypeCheckConfiguration(Set applicationPackageNames, Set excludedClasses, 66 | Map dependencies, 67 | Map stereotypeConfig) { 68 | this.applicationPackageNames = applicationPackageNames; 69 | this.excludedClasses = excludedClasses; 70 | this.dependencies = dependencies; 71 | this.stereotypeConfig = stereotypeConfig; 72 | } 73 | 74 | /** 75 | * Checks if the given full qualified classname starts with one of the 76 | * {@link #applicationPackageNames}. 77 | * 78 | * @param classNameWithPackage 79 | * the full qualified classname 80 | * @return true if the classname starts with one of the 81 | * {@link #applicationPackageNames}. 82 | */ 83 | public boolean isInApplicationPackage(String classNameWithPackage) { 84 | if (classNameWithPackage == null) { 85 | return false; 86 | } 87 | if (applicationPackageNames.size() == 0) { 88 | return true; 89 | } 90 | for (String packageName : applicationPackageNames) { 91 | if (classNameWithPackage.startsWith(packageName)) { 92 | return true; 93 | } 94 | } 95 | return false; 96 | } 97 | 98 | /** 99 | * Is the classname an annotation or interface or baseclass referenced in a 100 | * stereotype. 101 | * 102 | * @param classNameWithPackage 103 | * the full qualified classname 104 | * @return true if the classname an annotation or interface or baseclass 105 | * referenced in a stereotype. 106 | */ 107 | public boolean isPartOfAnyStereotype(String classNameWithPackage) { 108 | for (StereotypeConfiguration config : stereotypeConfig.values()) { 109 | if (config.isPartOfStereotype(classNameWithPackage)){ 110 | return true; 111 | } 112 | } 113 | return false; 114 | } 115 | 116 | /** 117 | * @return The map of all allowed dependencies. Maps from a stereotype-name 118 | * to list of allowed stereotypes. All strings in the map must match 119 | * a key of the {@link #stereotypeConfig}. 120 | */ 121 | public Map getDependencies() { 122 | return dependencies; 123 | } 124 | 125 | /** 126 | * @return The stereotypes. The key is the name of the stereotype. 127 | */ 128 | public Map getStereotypeConfig() { 129 | return stereotypeConfig; 130 | } 131 | 132 | /** 133 | * @return the excludedClasses 134 | */ 135 | public Set getExcludedClasses() { 136 | return excludedClasses; 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/src/test/resources/stereotype-allowoverride.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /stereotype.check.plugin/src/main/java/info/novatec/ita/check/config/DependencyConfiguration.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 NovaTec Consulting GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | package info.novatec.ita.check.config; 17 | 18 | import java.util.HashMap; 19 | import java.util.HashSet; 20 | import java.util.Map; 21 | import java.util.Set; 22 | 23 | /** 24 | * The configuration of a stereotype that has outgoing dependencies to other 25 | * stereotypes. Each outgoing dependency stereotype can be marked as allowed or 26 | * disallowed. If a stereotype is not in the list of the outgoing stereotypes it 27 | * is implicitly disallowed. 28 | * 29 | * @author Volker Koch (volker.koch@novatec-gmbh.de) 30 | * 31 | */ 32 | public class DependencyConfiguration { 33 | 34 | /** Stereotype-Id of the stereotype that has outgoing dependencies. */ 35 | private final StereotypeIdentifier from; 36 | /** 37 | * Map that hold all outgoing stereotypes that are allowed (value=true) and some 38 | * stereotype that are explicitly disallowed by overriding. All other 39 | * stereotypes are implicitly disallowed. 40 | */ 41 | private Map outgoingDependencies = new HashMap<>(); 42 | 43 | /** 44 | * Creates a new {@link DependencyConfiguration} 45 | * 46 | * @param from 47 | * Stereotype-Id of the source of the dependency 48 | */ 49 | public DependencyConfiguration(StereotypeIdentifier from) { 50 | this.from = from; 51 | } 52 | 53 | /** 54 | * @return the {@link #from} 55 | */ 56 | public StereotypeIdentifier getFrom() { 57 | return from; 58 | } 59 | 60 | /** 61 | * Add dependency {@link #from} to the given Stereotype. 62 | * 63 | * @param to 64 | * the Stereotype 65 | * @param isAllowed 66 | * if the dependency is not allowed provide the string "false". In all other cases it is true. 67 | */ 68 | public void addTo(StereotypeIdentifier to, String isAllowed) { 69 | boolean allowed = !"false".equalsIgnoreCase(isAllowed); 70 | outgoingDependencies.put(to, allowed); 71 | } 72 | 73 | /** 74 | * Is a dependency from Stereotype {@link #from} to the given Stereotype 75 | * allowed. 76 | * 77 | * @param to 78 | * the Stereotype to check. 79 | * @return true if explicitly allowed otherwise false. 80 | */ 81 | public boolean isAllowed(StereotypeIdentifier to) { 82 | Boolean allowed = outgoingDependencies.get(to); 83 | return allowed != null ? allowed : false; 84 | } 85 | 86 | /** 87 | * @return all dependencies that are allowed 88 | */ 89 | public Set getAllowedToDependencies() { 90 | Set allowed = new HashSet<>(); 91 | for (StereotypeIdentifier to : outgoingDependencies.keySet()) { 92 | if (isAllowed(to)) { 93 | allowed.add(to); 94 | } 95 | } 96 | return allowed; 97 | } 98 | 99 | /** 100 | * Merges this {@link DependencyConfiguration} with the given. 101 | *

102 | * If the given {@link DependencyConfiguration} has a value for a 103 | * {@link StereotypeIdentifier} it overrides the value in this 104 | * {@link DependencyConfiguration}. 105 | *

106 | * If the given {@link DependencyConfiguration} has a to-stereotype that is 107 | * not part of this {@link DependencyConfiguration} an error is thrown. 108 | * 109 | * @param dependencyConfigurationAdditional 110 | * the {@link DependencyConfiguration} to merge. 111 | */ 112 | public void merge(DependencyConfiguration dependencyConfigurationAdditional) { 113 | if (!from.equals(dependencyConfigurationAdditional.getFrom())) { 114 | throw new IllegalArgumentException("The merge of the central Dependency-Configuration " + from 115 | + " with the additional Dependency-Configuration " + dependencyConfigurationAdditional.getFrom() 116 | + " is not possible"); 117 | } 118 | for (StereotypeIdentifier stereotypeIdOutgoingDependencyOfAdditionalConfig : dependencyConfigurationAdditional.outgoingDependencies.keySet()) { 119 | if (!outgoingDependencies.containsKey(stereotypeIdOutgoingDependencyOfAdditionalConfig)) { 120 | throw new IllegalArgumentException( 121 | "The additional configuration for from dependency " + from + " contains a dependency to " 122 | + stereotypeIdOutgoingDependencyOfAdditionalConfig + " that is not part of the central configuration."); 123 | } 124 | } 125 | outgoingDependencies.putAll(dependencyConfigurationAdditional.outgoingDependencies); 126 | } 127 | 128 | @Override 129 | public String toString() { 130 | return "DependencyConfiguration [from=" + from + ", toAllowed=" + outgoingDependencies + "]"; 131 | } 132 | 133 | } 134 | -------------------------------------------------------------------------------- /stereotype.check.plugin.test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 4.0.0 21 | 22 | info.novatec.ita 23 | stereotype.check 24 | 4.0.0 25 | 26 | stereotype.check.plugin.test 27 | 28 | 29 | 30 | 31 | org.jacoco 32 | jacoco-maven-plugin 33 | 34 | 35 | 36 | prepare-agent 37 | 38 | 39 | 40 | 41 | 42 | org.apache.maven.plugins 43 | maven-antrun-plugin 44 | 45 | 46 | jacoco-report 47 | test 48 | 49 | run 50 | 51 | 52 | 53 | 54 | 56 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 72 | 73 | 74 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-surefire-plugin 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | javax.ejb 104 | javax.ejb-api 105 | 106 | 107 | javax.enterprise 108 | cdi-api 109 | 110 | 111 | javax.persistence 112 | persistence-api 113 | 114 | 115 | org.apache.commons 116 | commons-collections4 117 | 118 | 119 | 120 | 121 | info.novatec.ita 122 | stereotype.check.plugin 123 | ${project.version} 124 | test 125 | 126 | 127 | com.puppycrawl.tools 128 | checkstyle 129 | test 130 | 131 | 132 | org.assertj 133 | assertj-core 134 | test 135 | 136 | 137 | com.puppycrawl.tools 138 | checkstyle 139 | tests 140 | test 141 | 142 | 143 | org.springframework.restdocs 144 | spring-restdocs-mockmvc 145 | 1.1.2.RELEASE 146 | 147 | 148 | junit 149 | junit 150 | test 151 | 152 | 153 | 154 | --------------------------------------------------------------------------------