@Test public void testValidateArtifact() { assertFalse(validationService.validateArtifactId("proj w spcs")); assertFalse(validationService.validateArtifactId(".")); assertFalse(validationService.validateArtifactId(".name")); assertFalse(validationService.validateArtifactId("name.")); assertTrue(validationService.validateArtifactId("proj-w-hyps")); assertTrue(validationService.validateArtifactId("proj.w.int")); assertTrue(validationService.validateArtifactId("proj.2.123")); }
@Override public boolean validateArtifactId(final String artifactId) { final String[] artifactIdComponents = (artifactId == null ? new String[]{} : artifactId.split("\\.", -1)); final boolean validArtifactId = !(artifactIdComponents.length == 0 || evaluateMavenIdentifiers(artifactIdComponents).containsValue(Boolean.FALSE)); return validArtifactId; }
ValidationServiceImpl implements ValidationService { @Override public boolean validateArtifactId(final String artifactId) { final String[] artifactIdComponents = (artifactId == null ? new String[]{} : artifactId.split("\\.", -1)); final boolean validArtifactId = !(artifactIdComponents.length == 0 || evaluateMavenIdentifiers(artifactIdComponents).containsValue(Boolean.FALSE)); return validArtifactId; } }
ValidationServiceImpl implements ValidationService { @Override public boolean validateArtifactId(final String artifactId) { final String[] artifactIdComponents = (artifactId == null ? new String[]{} : artifactId.split("\\.", -1)); final boolean validArtifactId = !(artifactIdComponents.length == 0 || evaluateMavenIdentifiers(artifactIdComponents).containsValue(Boolean.FALSE)); return validArtifactId; } ValidationServiceImpl(); @Inject  ValidationServiceImpl(final org.uberfire.ext.editor.commons.service.ValidationService validationService,
                                 final PackageNameValidator packageNameValidator,
                                 final ModuleNameValidator moduleNameValidator,
                                 final JavaFileNameValidator javaFileNameValidator,
                                 final Instance<SaveValidator<?>> saveValidatorInstance,
                                 final Instance<CopyValidator<?>> copyValidatorInstance,
                                 final Instance<DeleteValidator<?>> deleteValidatorInstance); }
ValidationServiceImpl implements ValidationService { @Override public boolean validateArtifactId(final String artifactId) { final String[] artifactIdComponents = (artifactId == null ? new String[]{} : artifactId.split("\\.", -1)); final boolean validArtifactId = !(artifactIdComponents.length == 0 || evaluateMavenIdentifiers(artifactIdComponents).containsValue(Boolean.FALSE)); return validArtifactId; } ValidationServiceImpl(); @Inject  ValidationServiceImpl(final org.uberfire.ext.editor.commons.service.ValidationService validationService,
                                 final PackageNameValidator packageNameValidator,
                                 final ModuleNameValidator moduleNameValidator,
                                 final JavaFileNameValidator javaFileNameValidator,
                                 final Instance<SaveValidator<?>> saveValidatorInstance,
                                 final Instance<CopyValidator<?>> copyValidatorInstance,
                                 final Instance<DeleteValidator<?>> deleteValidatorInstance); @Override boolean isProjectNameValid(final String projectName); @Override boolean isPackageNameValid(final String packageName); @Override boolean isFileNameValid(final Path path,
                                   final String fileName); boolean isJavaFileNameValid(final String fileName); @Override boolean isFileNameValid(String fileName); @Override boolean isBranchNameValid(final String branchName); @Override Map<String, Boolean> evaluateJavaIdentifiers(String[] identifiers); @Override Map<String, Boolean> evaluateMavenIdentifiers(String[] identifiers); @Override boolean isTimerIntervalValid(final String timerInterval); @Override boolean validate(final POM pom); @Override boolean validateGroupId(final String groupId); @Override boolean validateArtifactId(final String artifactId); @Override boolean validateGAVVersion(final String version); @Override Collection<ValidationMessage> validateForSave(final Path path,
                                                             final T content); @Override Collection<ValidationMessage> validateForCopy(final Path path,
                                                             final T content); @Override Collection<ValidationMessage> validateForCopy(final Path path); @Override Collection<ValidationMessage> validateForDelete(final Path path,
                                                               final T content); @Override Collection<ValidationMessage> validateForDelete(final Path path); }
ValidationServiceImpl implements ValidationService { @Override public boolean validateArtifactId(final String artifactId) { final String[] artifactIdComponents = (artifactId == null ? new String[]{} : artifactId.split("\\.", -1)); final boolean validArtifactId = !(artifactIdComponents.length == 0 || evaluateMavenIdentifiers(artifactIdComponents).containsValue(Boolean.FALSE)); return validArtifactId; } ValidationServiceImpl(); @Inject  ValidationServiceImpl(final org.uberfire.ext.editor.commons.service.ValidationService validationService,
                                 final PackageNameValidator packageNameValidator,
                                 final ModuleNameValidator moduleNameValidator,
                                 final JavaFileNameValidator javaFileNameValidator,
                                 final Instance<SaveValidator<?>> saveValidatorInstance,
                                 final Instance<CopyValidator<?>> copyValidatorInstance,
                                 final Instance<DeleteValidator<?>> deleteValidatorInstance); @Override boolean isProjectNameValid(final String projectName); @Override boolean isPackageNameValid(final String packageName); @Override boolean isFileNameValid(final Path path,
                                   final String fileName); boolean isJavaFileNameValid(final String fileName); @Override boolean isFileNameValid(String fileName); @Override boolean isBranchNameValid(final String branchName); @Override Map<String, Boolean> evaluateJavaIdentifiers(String[] identifiers); @Override Map<String, Boolean> evaluateMavenIdentifiers(String[] identifiers); @Override boolean isTimerIntervalValid(final String timerInterval); @Override boolean validate(final POM pom); @Override boolean validateGroupId(final String groupId); @Override boolean validateArtifactId(final String artifactId); @Override boolean validateGAVVersion(final String version); @Override Collection<ValidationMessage> validateForSave(final Path path,
                                                             final T content); @Override Collection<ValidationMessage> validateForCopy(final Path path,
                                                             final T content); @Override Collection<ValidationMessage> validateForCopy(final Path path); @Override Collection<ValidationMessage> validateForDelete(final Path path,
                                                               final T content); @Override Collection<ValidationMessage> validateForDelete(final Path path);  }