@Test public void testValidateBranchName() { assertTrue(validationService.isBranchNameValid("test")); assertTrue(validationService.isBranchNameValid("test#")); assertTrue(validationService.isBranchNameValid("test!")); assertTrue(validationService.isBranchNameValid("test-")); assertTrue(validationService.isBranchNameValid("test_")); assertTrue(validationService.isBranchNameValid("test&")); assertTrue(validationService.isBranchNameValid("test%")); assertFalse(validationService.isBranchNameValid("@test")); assertFalse(validationService.isBranchNameValid("test@")); assertFalse(validationService.isBranchNameValid("te@st")); assertFalse(validationService.isBranchNameValid("/test")); assertFalse(validationService.isBranchNameValid("test/")); assertTrue(validationService.isBranchNameValid("te/st")); assertFalse(validationService.isBranchNameValid("..test")); assertFalse(validationService.isBranchNameValid("test..")); assertFalse(validationService.isBranchNameValid("te..st")); assertTrue(validationService.isBranchNameValid("\041test")); assertTrue(validationService.isBranchNameValid("test\041")); assertTrue(validationService.isBranchNameValid("te\041st")); assertFalse(validationService.isBranchNameValid("\000test")); assertFalse(validationService.isBranchNameValid("test\000")); assertFalse(validationService.isBranchNameValid("te\000st")); assertFalse(validationService.isBranchNameValid("\010test")); assertFalse(validationService.isBranchNameValid("test\010")); assertFalse(validationService.isBranchNameValid("te\010st")); assertFalse(validationService.isBranchNameValid("\037test")); assertFalse(validationService.isBranchNameValid("test\037")); assertFalse(validationService.isBranchNameValid("te\037st")); assertFalse(validationService.isBranchNameValid("\177test")); assertFalse(validationService.isBranchNameValid("test\177")); assertFalse(validationService.isBranchNameValid("te\177st")); assertFalse(validationService.isBranchNameValid(" test")); assertFalse(validationService.isBranchNameValid("test ")); assertFalse(validationService.isBranchNameValid("te st")); assertFalse(validationService.isBranchNameValid("~test")); assertFalse(validationService.isBranchNameValid("test~")); assertFalse(validationService.isBranchNameValid("te~st")); assertFalse(validationService.isBranchNameValid("^test")); assertFalse(validationService.isBranchNameValid("test^")); assertFalse(validationService.isBranchNameValid("te^st")); assertFalse(validationService.isBranchNameValid(":test")); assertFalse(validationService.isBranchNameValid("test:")); assertFalse(validationService.isBranchNameValid("te:st")); assertFalse(validationService.isBranchNameValid("?test")); assertFalse(validationService.isBranchNameValid("test?")); assertFalse(validationService.isBranchNameValid("te?st")); assertFalse(validationService.isBranchNameValid("*test")); assertFalse(validationService.isBranchNameValid("test*")); assertFalse(validationService.isBranchNameValid("te*st")); assertFalse(validationService.isBranchNameValid("[test")); assertFalse(validationService.isBranchNameValid("test[")); assertFalse(validationService.isBranchNameValid("te[st")); assertFalse(validationService.isBranchNameValid(".test")); assertFalse(validationService.isBranchNameValid("test.")); assertTrue(validationService.isBranchNameValid("te.st")); assertFalse(validationService.isBranchNameValid(" assertFalse(validationService.isBranchNameValid("test assertFalse(validationService.isBranchNameValid("te assertFalse(validationService.isBranchNameValid("@{test")); assertFalse(validationService.isBranchNameValid("test@{")); assertFalse(validationService.isBranchNameValid("te@{st")); assertFalse(validationService.isBranchNameValid("@")); assertFalse(validationService.isBranchNameValid("\\test")); assertFalse(validationService.isBranchNameValid("test\\")); assertFalse(validationService.isBranchNameValid("te\\st")); assertFalse(validationService.isBranchNameValid("-test")); assertTrue(validationService.isBranchNameValid("te-st")); assertTrue(validationService.isBranchNameValid("test-")); }
@Override public boolean isBranchNameValid(final String branchName) { final Matcher branchNameMatcher = branchNameValidator.matcher(branchName); return branchNameMatcher.matches(); }
ValidationServiceImpl implements ValidationService { @Override public boolean isBranchNameValid(final String branchName) { final Matcher branchNameMatcher = branchNameValidator.matcher(branchName); return branchNameMatcher.matches(); } }
ValidationServiceImpl implements ValidationService { @Override public boolean isBranchNameValid(final String branchName) { final Matcher branchNameMatcher = branchNameValidator.matcher(branchName); return branchNameMatcher.matches(); } 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 isBranchNameValid(final String branchName) { final Matcher branchNameMatcher = branchNameValidator.matcher(branchName); return branchNameMatcher.matches(); } 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 isBranchNameValid(final String branchName) { final Matcher branchNameMatcher = branchNameValidator.matcher(branchName); return branchNameMatcher.matches(); } 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);  }