diff --git a/nalu-plugin-core-web/pom.xml b/nalu-plugin-core-web/pom.xml index e72bd1ba..67418f7b 100644 --- a/nalu-plugin-core-web/pom.xml +++ b/nalu-plugin-core-web/pom.xml @@ -98,44 +98,20 @@ - + org.junit.jupiter - junit-jupiter-api - ${junit-jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-params + junit-jupiter-engine ${junit-jupiter.version} test - + org.junit.platform - junit-platform-runner + junit-platform-suite-api ${junit-jupiter-platform.version} test - - org.junit.jupiter - junit-jupiter-engine - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - - org.hamcrest - hamcrest-core - - - diff --git a/nalu-plugin-core-web/src/test/java/com/github/nalukit/nalu/plugin/core/web/AllTests.java b/nalu-plugin-core-web/src/test/java/com/github/nalukit/nalu/plugin/core/web/AllTests.java index 3fc14e58..ca1a0992 100644 --- a/nalu-plugin-core-web/src/test/java/com/github/nalukit/nalu/plugin/core/web/AllTests.java +++ b/nalu-plugin-core-web/src/test/java/com/github/nalukit/nalu/plugin/core/web/AllTests.java @@ -18,11 +18,8 @@ package com.github.nalukit.nalu.plugin.core.web; import com.github.nalukit.nalu.plugin.core.web.client.NaluPluginCoreWebTest; -import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectClasses; -import org.junit.runner.RunWith; -@RunWith(JUnitPlatform.class) @SelectClasses({ NaluPluginCoreWebTest.class }) public class AllTests { diff --git a/nalu-plugin-elemental2/pom.xml b/nalu-plugin-elemental2/pom.xml index a08d5405..47693aae 100644 --- a/nalu-plugin-elemental2/pom.xml +++ b/nalu-plugin-elemental2/pom.xml @@ -113,13 +113,6 @@ - diff --git a/nalu-plugin-elemento/pom.xml b/nalu-plugin-elemento/pom.xml index 6a8b5b03..ac38003e 100644 --- a/nalu-plugin-elemento/pom.xml +++ b/nalu-plugin-elemento/pom.xml @@ -150,13 +150,6 @@ - diff --git a/nalu-plugin-gwt-processor/pom.xml b/nalu-plugin-gwt-processor/pom.xml index 1761b79b..eb7d0939 100644 --- a/nalu-plugin-gwt-processor/pom.xml +++ b/nalu-plugin-gwt-processor/pom.xml @@ -222,46 +222,22 @@ test + org.junit.jupiter - junit-jupiter-api - ${junit-jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-params + junit-jupiter-engine ${junit-jupiter.version} test - + org.junit.platform - junit-platform-runner + junit-platform-suite-api ${junit-jupiter-platform.version} test - - org.junit.jupiter - junit-jupiter-engine - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - - org.hamcrest - hamcrest-core - - - - diff --git a/nalu-processor/pom.xml b/nalu-processor/pom.xml index d2ff06b5..16dc8ba0 100644 --- a/nalu-processor/pom.xml +++ b/nalu-processor/pom.xml @@ -170,43 +170,20 @@ test + org.junit.jupiter - junit-jupiter-api - ${junit-jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-params + junit-jupiter-engine ${junit-jupiter.version} test - + org.junit.platform - junit-platform-runner + junit-platform-suite-api ${junit-jupiter-platform.version} test - - org.junit.jupiter - junit-jupiter-engine - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - - org.hamcrest - hamcrest-core - - - com.google.elemental2 @@ -280,23 +257,20 @@ org.apache.maven.plugins maven-surefire-plugin ${plugin.version.surfire} - - - unit-tests - - test - - test - - - - - **/Test*.java - **/*Test.java - **/*Tests.java - **/*TestCase.java - - + + + + + + + + + + + + + + org.apache.maven.plugins diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/BlockControllerModel.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/BlockControllerModel.java index c0e0034c..3d3c6d10 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/BlockControllerModel.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/BlockControllerModel.java @@ -20,16 +20,16 @@ public class BlockControllerModel { - private String name; - private ClassNameModel context; - private ClassNameModel controller; - private ClassNameModel componentInterface; - private ClassNameModel component; - private ClassNameModel provider; - private boolean componentCreator; - private ClassNameModel conndition; - private List eventHandlers; - private List eventModels; + private String name; + private ClassNameModel context; + private ClassNameModel controller; + private ClassNameModel componentInterface; + private ClassNameModel component; + private final ClassNameModel provider; + private boolean componentCreator; + private ClassNameModel conndition; + private List eventHandlers; + private List eventModels; public BlockControllerModel(String name, ClassNameModel context, @@ -97,10 +97,6 @@ public ClassNameModel getProvider() { return provider; } - public void setProvider(ClassNameModel provider) { - this.provider = provider; - } - public boolean isComponentCreator() { return componentCreator; } diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/ControllerModel.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/ControllerModel.java index 8cf17239..701f598d 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/ControllerModel.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/model/intern/ControllerModel.java @@ -22,20 +22,20 @@ public class ControllerModel { - private String[] originalRoute; - private List parameters; - private ClassNameModel provider; - private final List parameterAcceptors; - private boolean componentCreator; - private List route; - private String selector; - private ClassNameModel context; - private ClassNameModel controller; - private ClassNameModel componentInterface; - private ClassNameModel component; - private List composites; - private List eventHandlers; - private List eventModels; + private String[] originalRoute; + private List parameters; + private ClassNameModel provider; + private final List parameterAcceptors; + private boolean componentCreator; + private List route; + private String selector; + private ClassNameModel context; + private ClassNameModel controller; + private ClassNameModel componentInterface; + private ClassNameModel component; + private List composites; + private List eventHandlers; + private List eventModels; public ControllerModel() { this.parameterAcceptors = new ArrayList<>(); @@ -148,14 +148,6 @@ public List getParameterAcceptors() { return parameterAcceptors; } - public String getParameterAcceptors(String parameterName) { - Optional optional = this.parameterAcceptors.stream() - .filter(a -> parameterName.equals(a.getParameterName())) - .findFirst(); - return optional.map(ParameterAcceptorModel::getMethodName) - .orElse(null); - } - public ParameterConstraintModel getConstraintModelFor(String parameterName) { Optional optional = this.parameterAcceptors.stream() .filter(a -> parameterName.equals(a.getParameterName())) @@ -237,17 +229,6 @@ private String getShellFromRoute(String route) { return shellOfRoute; } - private boolean matchRouteWithoutShell(String route) { - for (String originalRoute : this.originalRoute) { - String routeWithoutShell = this.getRouteWithoutShell(originalRoute); - String startRouteWithoutShell = this.getRouteWithoutShell(route); - if (routeWithoutShell.equals(startRouteWithoutShell)) { - return true; - } - } - return false; - } - public List getEventHandlers() { return eventHandlers; } diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ConsistenceValidator.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ConsistenceValidator.java index edc0a37f..b50723dc 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ConsistenceValidator.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ConsistenceValidator.java @@ -80,12 +80,12 @@ private void validateStartRoute() // Does the shell of the start route exist? Optional optionalShell = this.metaModel.getShells() .stream() - .map(m -> m.getName()) + .map(ShellModel::getName) .filter(s -> s.equals(this.metaModel.getShellOfStartRoute())) .findFirst(); - if (!optionalShell.isPresent()) { - if (this.metaModel.getModules() - .size() > 0) { + if (optionalShell.isEmpty()) { + if (!this.metaModel.getModules() + .isEmpty()) { this.processingEnvironment.getMessager() .printMessage(Diagnostic.Kind.NOTE, "Nalu-Processor: The shell of the startRoute >>" + @@ -103,9 +103,9 @@ private void validateStartRoute() .stream() .filter(m -> m.match(this.metaModel.getStartRoute())) .findAny(); - if (!optionalRoute.isPresent()) { - if (this.metaModel.getModules() - .size() > 0) { + if (optionalRoute.isEmpty()) { + if (!this.metaModel.getModules() + .isEmpty()) { this.processingEnvironment.getMessager() .printMessage(Diagnostic.Kind.NOTE, "Nalu-Processor: The route of the startRoute >>" + @@ -131,8 +131,8 @@ private void validateStartRoute() private void validateNoShellsDefined() throws ProcessorException { if (!Objects.isNull(metaModel.getApplication())) { - if (metaModel.getShells() - .size() > 0) { + if (!metaModel.getShells() + .isEmpty()) { return; } throw new ProcessorException("Nalu-Processor: No shells defined! Please define (at least) one shell."); diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ControllerAnnotationValidator.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ControllerAnnotationValidator.java index fe6d0ca9..94faafae 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ControllerAnnotationValidator.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ControllerAnnotationValidator.java @@ -145,7 +145,7 @@ private void validateRoute(String route) route = route.substring(1); } // initial routes do not need a validation! - if (route.length() == 0) { + if (route.isEmpty()) { return; } String[] splits = route.split("/"); @@ -153,7 +153,7 @@ private void validateRoute(String route) for (String s : splits) { partCounter++; // handle "//" -> not allowed - if (s.length() == 0) { + if (s.isEmpty()) { throw new ProcessorException("Nalu-Processor: controller >>" + this.controllerElement.getEnclosingElement() .toString() + @@ -213,7 +213,7 @@ private void validateParameterNamesAreUnique(String route) .size() > 1) .map(Map.Entry::getKey) .collect(Collectors.toList()); - if (duplicateParameters.size() > 0) { + if (!duplicateParameters.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("Nalu-Processor: controller >>") .append(this.controllerElement.getEnclosingElement() @@ -255,7 +255,7 @@ private void validateParameters(String[] routes) for (String parameterFromFirstRoute : parametersOfFirstRoute) { compareParameters.remove(parameterFromFirstRoute); } - if (compareParameters.size() > 0) { + if (!compareParameters.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("Nalu-Processor: controller >>") .append(this.controllerElement.getEnclosingElement() @@ -292,7 +292,7 @@ private void searchForDuplicateRoutes(String[] routes) .size() > 1) .map(Map.Entry::getKey) .collect(Collectors.toList()); - if (duplicateRoutes.size() > 0) { + if (!duplicateRoutes.isEmpty()) { StringBuilder sb = new StringBuilder(); sb.append("Nalu-Processor: controller >>") .append(this.controllerElement.getEnclosingElement() diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/LoggerAnnotationValidator.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/LoggerAnnotationValidator.java index bb33bfa9..8042e605 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/LoggerAnnotationValidator.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/LoggerAnnotationValidator.java @@ -106,7 +106,7 @@ public void validate() private TypeElement getLogger(Logger loggerAnnotation) { try { - loggerAnnotation.logger(); + Class> ignore = loggerAnnotation.logger(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror()); diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ShellAnnotationValidator.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ShellAnnotationValidator.java index 89a07ed6..dfd58769 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ShellAnnotationValidator.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/ShellAnnotationValidator.java @@ -131,9 +131,7 @@ public Void visitDeclared(DeclaredType declaredType, Void v) { List typeArguments = declaredType.getTypeArguments(); if (!typeArguments.isEmpty()) { - if (typeArguments.size() > 0) { - result[0] = typeArguments.get(0); - } + result[0] = typeArguments.get(0); } return null; } diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/TrackerAnnotationValidator.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/TrackerAnnotationValidator.java index 96fbdab7..9e591434 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/TrackerAnnotationValidator.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/TrackerAnnotationValidator.java @@ -18,6 +18,7 @@ import com.github.nalukit.nalu.client.application.IsApplication; import com.github.nalukit.nalu.client.application.annotation.Application; import com.github.nalukit.nalu.client.tracker.AbstractTracker; +import com.github.nalukit.nalu.client.tracker.IsTracker; import com.github.nalukit.nalu.client.tracker.annotation.Tracker; import com.github.nalukit.nalu.processor.ProcessorException; import com.github.nalukit.nalu.processor.ProcessorUtils; @@ -110,7 +111,7 @@ public void validate() private TypeElement getTracker(Tracker trackerAnnotation) { try { - trackerAnnotation.value(); + Class ignore = trackerAnnotation.value(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror()); diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/VersionAnnotationValidator.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/VersionAnnotationValidator.java index 61ddd1a3..746c90cd 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/VersionAnnotationValidator.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/validation/VersionAnnotationValidator.java @@ -25,7 +25,6 @@ import javax.annotation.processing.RoundEnvironment; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; -import javax.lang.model.type.MirroredTypeException; import java.util.Set; public class VersionAnnotationValidator { @@ -69,7 +68,6 @@ public void validate() } for (Element element : elementsWithVersionAnnotation) { if (element instanceof TypeElement) { - TypeElement typeElement = (TypeElement) element; // @Version can only be used on a interface if (!versionElement.getKind() .isInterface()) { @@ -93,16 +91,6 @@ public void validate() } } - private TypeElement getVersion(Version versionAnnotation) { - try { - versionAnnotation.value(); - } catch (MirroredTypeException exception) { - return (TypeElement) this.processingEnvironment.getTypeUtils() - .asElement(exception.getTypeMirror()); - } - return null; - } - public static final class Builder { ProcessingEnvironment processingEnvironment; diff --git a/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/AllTests.java b/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/Tests.java similarity index 63% rename from nalu-processor/src/test/java/com/github/nalukit/nalu/processor/AllTests.java rename to nalu-processor/src/test/java/com/github/nalukit/nalu/processor/Tests.java index 54ae0be6..e3f37cc8 100644 --- a/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/AllTests.java +++ b/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/Tests.java @@ -49,44 +49,42 @@ import com.github.nalukit.nalu.processor.test.VersionTest; import com.github.nalukit.nalu.processor.test.model.intern.ClassNameModelTest; import com.github.nalukit.nalu.processor.test.model.property.PropertiesTest; -import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.Suite; -import org.junit.runner.RunWith; @Suite() @SelectClasses({ ApplicationTest.class, - BlockControllerTest.class, - ClassNameModelTest.class, - CompositeCreatorTest.class, - CompositeTest.class, - CompositesTest.class, - ConsistenceTest.class, - ControllerCreatorTest.class, - ControllerModelTest.class, - ControllerTest.class, - ErrorPopUpControllerTest.class, - EventHandlerTest.class, - EventHandlerBlockControllerTest.class, - EventHandlerCompositeTest.class, - EventHandlerControllerTest.class, - EventHandlerErrorPopUpControllerTest.class, - EventHandlerHandlerTest.class, - EventHandlerPopUpControllerTest.class, - EventHandlerShellTest.class, - FiltersTest.class, - HandlerTest.class, - LoggerTest.class, - MetaModelTest.class, - ModuleTest.class, - ParameterConstraintRuleTest.class, - ParameterConstraintTest.class, - PopUpControllerCreatorTest.class, - PopUpFiltersTest.class, - PropertiesTest.class, - ShellCreatorTest.class, - ShellTest.class, - TrackerTest.class, - VersionTest.class }) -public class AllTests { + BlockControllerTest.class, + ClassNameModelTest.class, + CompositeCreatorTest.class, + CompositeTest.class, + CompositesTest.class, + ConsistenceTest.class, + ControllerCreatorTest.class, + ControllerModelTest.class, + ControllerTest.class, + ErrorPopUpControllerTest.class, + EventHandlerTest.class, + EventHandlerBlockControllerTest.class, + EventHandlerCompositeTest.class, + EventHandlerControllerTest.class, + EventHandlerErrorPopUpControllerTest.class, + EventHandlerHandlerTest.class, + EventHandlerPopUpControllerTest.class, + EventHandlerShellTest.class, + FiltersTest.class, + HandlerTest.class, + LoggerTest.class, + MetaModelTest.class, + ModuleTest.class, + ParameterConstraintRuleTest.class, + ParameterConstraintTest.class, + PopUpControllerCreatorTest.class, + PopUpFiltersTest.class, + PropertiesTest.class, + ShellCreatorTest.class, + ShellTest.class, + TrackerTest.class, + VersionTest.class }) +public class Tests { } diff --git a/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/test/VersionTest.java b/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/test/VersionTest.java index cd34d0b8..536bc761 100644 --- a/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/test/VersionTest.java +++ b/nalu-processor/src/test/java/com/github/nalukit/nalu/processor/test/VersionTest.java @@ -21,13 +21,13 @@ import com.google.testing.compile.CompilationSubject; import com.google.testing.compile.JavaFileObjects; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; import java.util.Arrays; import java.util.Collections; import static com.google.testing.compile.Compiler.javac; -@SuppressWarnings("serial") public class VersionTest { @Test diff --git a/nalu/pom.xml b/nalu/pom.xml index aeec886b..7d0b8c8f 100644 --- a/nalu/pom.xml +++ b/nalu/pom.xml @@ -86,45 +86,26 @@ ${gwt-regexp.version} - - - org.junit.jupiter - junit-jupiter-api - ${junit-jupiter.version} - test - + + org.junit.jupiter - junit-jupiter-params + junit-jupiter-engine ${junit-jupiter.version} test - + org.junit.platform - junit-platform-runner + junit-platform-suite-api ${junit-jupiter-platform.version} test - org.junit.jupiter - junit-jupiter-engine - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - - org.hamcrest - hamcrest-core - - - - + org.hamcrest + hamcrest-all + ${hamcrest.version} + diff --git a/nalu/src/test/java/com/github/nalukit/nalu/AllTests.java b/nalu/src/test/java/com/github/nalukit/nalu/AllTests.java index 2762023c..ddfbde4c 100644 --- a/nalu/src/test/java/com/github/nalukit/nalu/AllTests.java +++ b/nalu/src/test/java/com/github/nalukit/nalu/AllTests.java @@ -27,10 +27,8 @@ import com.github.nalukit.nalu.client.internal.route.RouterHashImplTest; import com.github.nalukit.nalu.client.internal.validation.RouteValidationTest; import com.github.nalukit.nalu.client.util.NaluUtilsTest; -import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.Suite; -import org.junit.runner.RunWith; @Suite() @SelectClasses({ NaluTest.class, diff --git a/pom.xml b/pom.xml index 05bab867..a6783fec 100644 --- a/pom.xml +++ b/pom.xml @@ -98,6 +98,7 @@ 1.0.0-RC1 1.0.0-RC1 2.11.0 + 1.3 2.2 ${java.home}/bin/javadoc 1.13.0