diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTask.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTask.java index 5872683efd3e108ad9f0973479a671d8fae25637..1b2c938ca008a04f5ccef46f207c70264a3cd2f1 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTask.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTask.java @@ -139,7 +139,7 @@ public class SVNBranchAndTagTask extends Task /** * Requires the following properties: * <ul> - * <li> projecname - the name of the project in the subversion repository to branch from </li> + * <li> projectname - the name of the project in the subversion repository to branch from </li> * <li> branch - the name of the branch to create </li> * </ul> */ @@ -163,6 +163,9 @@ public class SVNBranchAndTagTask extends Task createTagInSvn(svn, source, createBranchContext(destinationContext), destination, branchIfNecessary); break; + case SPRINT_TAG: + createTagInSvn(svn, source, destination); + break; case RELEASE_BRANCH: case FEATURE_BRANCH: createBranchInSvn(svn, source, destination); @@ -179,7 +182,7 @@ public class SVNBranchAndTagTask extends Task final SVNRepositoryProjectContextAntWrapper tag, boolean branchIfNecessary) throws BuildException { - if (false == branchExists(svn, branch)) + if (false == nodeExists(svn, branch)) { if (branchIfNecessary) { @@ -203,24 +206,48 @@ public class SVNBranchAndTagTask extends Task logMessage); } - private static SVNRepositoryProjectContextAntWrapper createBranchContext( - SVNRepositoryProjectContext tagContext) throws BuildException + /** + * This method only creates a tag with the content from the source. It does not create a branch! + */ + private static void createTagInSvn(final ISVNActions svn, + final SVNRepositoryProjectContextAntWrapper source, + final SVNRepositoryProjectContextAntWrapper tag) throws BuildException { try { - final String branchName = SVNUtilities.getBranchForTag(tagContext.getVersion()); - SVNRepositoryProjectContext context = new SVNRepositoryProjectContext(); - context.setReleaseBranch(branchName); - return new SVNRepositoryProjectContextAntWrapper(context, tagContext); - } catch (UserFailureException ex) + copyDependentProjectInSvn(svn, source, tag, "tag"); + } catch (SVNException ex) { throw new BuildException(ex); } } + /** + * This method only creates a branch with the content from the source. It does not create a tag! + */ private static void createBranchInSvn(final ISVNActions svn, final SVNRepositoryProjectContextAntWrapper source, final SVNRepositoryProjectContextAntWrapper destination) + { + try + { + copyDependentProjectInSvn(svn, source, destination, "branch"); + } catch (SVNException ex) + { + throw new BuildException(ex); + } + } + + /** + * Copies a project with all dependencies from the source to the destination. + * + * @param copyKind If the destination is a branch or a tag, this string is only used for log + * messages! + */ + private static void copyDependentProjectInSvn(final ISVNActions svn, + final SVNRepositoryProjectContextAntWrapper source, + final SVNRepositoryProjectContextAntWrapper destination, String copyKind) + throws BuildException { final ISVNProjectPathProvider sourcePathProvider = source.getPathProvider(); final ISVNProjectPathProvider destinationPathProvider = destination.getPathProvider(); @@ -228,13 +255,13 @@ public class SVNBranchAndTagTask extends Task new SVNDependentProjectsCollector(source.getPathProvider(), svn) .collectDependentProjectsFromClasspath(); - final String branchName = destination.getVersion(); - final String logMessage = "Create branch '" + branchName + "'"; + final String tagName = destination.getVersion(); + final String logMessage = "Create " + copyKind + " '" + tagName + "'"; try { - if (branchExists(svn, destination)) + if (nodeExists(svn, destination)) { - throw new BuildException("The branch '" + branchName + "' already exists."); + throw new BuildException("The " + copyKind + " '" + tagName + "' already exists."); } if (svn.isMuccAvailable()) { @@ -271,16 +298,31 @@ public class SVNBranchAndTagTask extends Task } } - private static boolean branchExists(final ISVNActions svn, - final SVNRepositoryProjectContextAntWrapper branch) + private static SVNRepositoryProjectContextAntWrapper createBranchContext( + SVNRepositoryProjectContext tagContext) throws BuildException + { + try + { + final String branchName = SVNUtilities.getBranchForTag(tagContext.getVersion()); + SVNRepositoryProjectContext context = new SVNRepositoryProjectContext(); + context.setReleaseBranch(branchName); + return new SVNRepositoryProjectContextAntWrapper(context, tagContext); + } catch (UserFailureException ex) + { + throw new BuildException(ex); + } + } + + private static boolean nodeExists(final ISVNActions svn, + final SVNRepositoryProjectContextAntWrapper node) { - final String branchName = branch.getVersion(); - final String branchUrl = branch.getRepositoryUrl(); - final String parentUrl = SVNUtilities.getParent(branchUrl); + final String tagName = node.getVersion(); + final String tagUrl = node.getRepositoryUrl(); + final String parentUrl = SVNUtilities.getParent(tagUrl); assert parentUrl != null; - assert branchName.equals(branchUrl.substring(parentUrl.length() + 1)); + assert tagName.equals(tagUrl.substring(parentUrl.length() + 1)); final Set<String> branchSet = new HashSet<String>(svn.list(parentUrl)); - final boolean exists = branchSet.contains(branchName + "/"); + final boolean exists = branchSet.contains(tagName + "/"); return exists; } @@ -384,7 +426,7 @@ public class SVNBranchAndTagTask extends Task } /** - * Sets the name of the feature branch to create. + * Sets the name of the release tag to create. */ public void setReleaseTag(String tagName) { @@ -406,6 +448,29 @@ public class SVNBranchAndTagTask extends Task } } + /** + * Sets the name of the sprint tag to create. + */ + public void setSprintTag(String tagName) + { + assert tagName != null; + + if (SVNProjectVersionType.TRUNK != destinationContext.getVersionType()) + { + throw new BuildException(String.format( + "Version type has already been set (Version: '%s', Type: '%s').", + destinationContext.getVersion(), destinationContext.getVersionType())); + } + + try + { + destinationContext.setSprintTag(tagName); + } catch (UserFailureException ex) + { + throw new BuildException(ex); + } + } + /** * Sets whether it should be branched if the branch does not already exist when tagging. */ diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNProjectVersionType.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNProjectVersionType.java index c98a1c0332f405309d9c8415880e0747f8be995f..990d06fcb56443a486d6a5ea496af865003d8239 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNProjectVersionType.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNProjectVersionType.java @@ -23,5 +23,5 @@ package ch.systemsx.cisd.ant.task.subversion; */ public enum SVNProjectVersionType { - TRUNK, RELEASE_BRANCH, FEATURE_BRANCH, RELEASE_TAG + TRUNK, RELEASE_BRANCH, FEATURE_BRANCH, RELEASE_TAG, SPRINT_TAG } \ No newline at end of file diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRecursiveCheckoutTask.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRecursiveCheckoutTask.java index 5ece282854dca764c96ffe139655e6fd78301544..f50740aac83e4b485941b71e3f1b6cdcc537f563 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRecursiveCheckoutTask.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRecursiveCheckoutTask.java @@ -46,7 +46,8 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; * where the <code><dependent_projectname<n>></code> are referenced from * <code>.../<projectname>/trunk/.classpath</code>. * <p> - * In <code>tag</code> mode (applies to both tags and branches) we assume this subversion layout: + * For releases we assume the following layout in <code>tag</code> mode (applies to both tags and + * branches) : * * <pre> * .../<projectname>/tags/<versiontemplate>/<detailedversion>/<projectname> @@ -55,6 +56,18 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; * ... * .../<projectname>/tags/<versiontemplate>/<detailedversion>/<dependent_projectname2> * </pre> + * + * For our regularly sprint releases we only tag the version and do not create a branch of it. For + * this we have the following structure: + * + * <pre> + * .../<projectname>/tags/sprint/S<sprintnumber>/<projectname> + * ... + * .../<projectname>/tags/sprint/S<sprintnumber>/<dependent_projectname1> + * ... + * .../<projectname>/tags/sprint/S<sprintnumber>/<dependent_projectname2> + * </pre> + * * <em><strong>Note:</strong> This schema requires the Eclipse project names and the subversion project names to be the * same!</em> * @@ -268,8 +281,9 @@ public class SVNRecursiveCheckoutTask extends Task * <p> * If <code>versionName == "trunk"</code>, the version will be the trunk. If <var>versionName</var> * fits into the release branch schema, it will be interpreted as a release branch, if it fits - * into a release tag schema, it will be interpreted as a release tag. In all other cases the - * version will be interpreted as a feature branch. + * into a release tag schema, it will be interpreted as a release tag. If it fits into a sprint + * tag, it will be interpreted as a sprint tag. In all other cases the version will be + * interpreted as a feature branch. */ public void setVersion(String versionName) { @@ -282,6 +296,9 @@ public class SVNRecursiveCheckoutTask extends Task } else if (context.isReleaseTag(versionName)) { setReleaseTag(versionName); + } else if (context.isSprintTag(versionName)) + { + setSprintTag(versionName); } else { setFeatureBranch(versionName); @@ -305,6 +322,23 @@ public class SVNRecursiveCheckoutTask extends Task } } + /** + * Sets the name of the sprint tag specified for this project. + */ + public void setSprintTag(String tagName) + { + assert context != null; + assert tagName != null; + + try + { + context.setSprintTag(tagName); + } catch (UserFailureException ex) + { + throw new BuildException(ex.getMessage()); + } + } + /** * Sets the revision to check out. Defaults to <code>HEAD</code>. */ diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContext.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContext.java index e837028c735fd5e182cf8bb6275c1426d664c72a..2b56a1cdbec08c1b8c8a2975dae2f66aced175cd 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContext.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContext.java @@ -37,6 +37,10 @@ class SVNRepositoryProjectContext private static final Pattern releaseTagPattern = Pattern.compile(SVNUtilities.RELEASE_TAG_PATTERN_STRING); + /** A pattern that sprint tags must match. */ + private static final Pattern sprintTagPattern = + Pattern.compile(SVNUtilities.SPRINT_TAG_PATTERN_STRING); + /** The root of the repository url, including the protocol. */ private String repositoryRoot = SVNUtilities.DEFAULT_REPOSITORY_ROOT; @@ -205,7 +209,7 @@ class SVNRepositoryProjectContext if (false == isReleaseTag(tagName)) { - throw new UserFailureException("Tag name '" + tagName + "' does not match the pattern."); + throw new UserFailureException("Release tag name '" + tagName + "' does not match the pattern."); } this.versionType = SVNProjectVersionType.RELEASE_TAG; this.version = tagName; @@ -219,6 +223,34 @@ class SVNRepositoryProjectContext return releaseTagPattern.matcher(versionName).matches(); } + /** + * Sets the {@link SVNProjectVersionType} to {@link SVNProjectVersionType#SPRINT_TAG} and the + * version to <var>tagName</var>. + * + * @throws UserFailureException If the <var>tagName</var> does not match the pattern for + * sprint tags. + */ + public void setSprintTag(String tagName) throws UserFailureException + { + assert tagName != null; + + if (false == isSprintTag(tagName)) + { + throw new UserFailureException("Sprint tag name '" + tagName + "' does not match the pattern."); + } + this.versionType = SVNProjectVersionType.SPRINT_TAG; + this.version = tagName; + } + + + /** + * @return <code>true</code> if <var>versionName</var> is a sprint tag. + */ + public boolean isSprintTag(String versionName) + { + return sprintTagPattern.matcher(versionName).matches(); + } + /** * @return The type of the version of this project. */ @@ -280,6 +312,9 @@ class SVNRepositoryProjectContext final String branchName = SVNUtilities.getBranchForTag(getVersion()); return StringUtils.join(Arrays.asList(getRepositoryRoot(), getGroup(), getProjectName(), "tags/release", branchName, getVersion()), "/"); + case SPRINT_TAG: + return StringUtils.join(Arrays.asList(getRepositoryRoot(), getGroup(), + getProjectName(), "tags/sprint", getVersion()), "/"); case FEATURE_BRANCH: return StringUtils.join(Arrays.asList(getRepositoryRoot(), getGroup(), getProjectName(), "branches/feature", getVersion()), "/"); diff --git a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java index c748b0298c22080cfc94ac3a4d2d27910ded3768..d3f99a82ff75f58b55596ae7ec16cd7165cde995 100644 --- a/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java +++ b/ant_tasks/source/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilities.java @@ -54,11 +54,17 @@ class SVNUtilities /** A project all other projects depend on implicitely. */ static final String BUILD_RESOURCES_PROJECT = "build_resources"; - private static final String RELEASE_PATTERN_PREFIX = "((S|[0-9]+\\.)[0-9]+)\\."; + private static final String RELEASE_PATTERN_PREFIX = "(([0-9]+\\.)[0-9]+)\\."; /** The regular expression that a release tag has to match. */ static final String RELEASE_TAG_PATTERN_STRING = RELEASE_PATTERN_PREFIX + "[0-9]+"; - + + /** The prefix for the sprint tagging. */ + private static final String SPRINT_PATTERN_PREFIX = "S"; + + /** Pattern which matches the sprint tagging */ + static final String SPRINT_TAG_PATTERN_STRING = SPRINT_PATTERN_PREFIX + "[0-9]+"; + /** The regular expression that a release branch has to match. */ static final String RELEASE_BRANCH_PATTERN_STRING = RELEASE_PATTERN_PREFIX + "x"; diff --git a/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTaskTest.java b/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTaskTest.java index 51616c3d71aef3abd52bf859cc077ae14ae8caba..6822dd373eca4c84155b137cf94187306a545846 100644 --- a/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTaskTest.java +++ b/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNBranchAndTagTaskTest.java @@ -368,6 +368,95 @@ public class SVNBranchAndTagTaskTest assertEquals(expectedCopySet, new HashSet<CopyItem>(svn.copyList)); } + @Test + public void testCreateSprintTag() + { + final String repositoryRoot = "http://host/repos"; + final String groupName = "group"; + final String projectName = "testProject"; + final String tagName = "S42"; + final Map<String, List<String>> listMap = new HashMap<String, List<String>>(); + final String tagUrl = + StringUtils.join(Arrays.asList(repositoryRoot, groupName, projectName, + "tags/sprint"), "/"); + List<String> folders = new ArrayList<String>(); + folders.add("S41/"); + folders.add("42/"); + folders.add("S43/"); + listMap.put(tagUrl, folders); + final Map<String, String> catMap = new HashMap<String, String>(); + final MockSVNRepositoryActions svn = new MockSVNRepositoryActions(listMap, catMap); + final SVNBranchAndTagTask task = new SVNBranchAndTagTask() + { + @Override + ISVNActions createSVNActions() + { + return svn; + } + }; + task.setProject(new Project()); // Required for log not to throw a NPE. + task.setRepositoryRoot(repositoryRoot); + task.setGroup(groupName); + task.setName(projectName); + task.setSprintTag(tagName); + task.execute(); + final String sourceMainUrl = + StringUtils.join(Arrays.asList(repositoryRoot, groupName, projectName, "trunk"), + "/"); + final String targetUrl = + StringUtils.join(Arrays.asList(repositoryRoot, groupName, projectName, + "tags/sprint", tagName), "/"); + final String targetBuildResourcesUrl = + targetUrl + "/" + SVNUtilities.BUILD_RESOURCES_PROJECT; + final String targetMainUrl = + StringUtils.join(Arrays.asList(targetUrl, projectName), + "/"); + final String logMessage = "Create tag '" + tagName + "'"; + + assertEquals(1, svn.mkdirList.size()); + + final String sourceBuildResourcesUrl = + StringUtils.join(Arrays.asList(repositoryRoot, groupName, + SVNUtilities.BUILD_RESOURCES_PROJECT, "trunk"), "/"); + final Set<CopyItem> expectedCopySet = + new HashSet<CopyItem>(Arrays.asList(new CopyItem(sourceBuildResourcesUrl, + SVNUtilities.HEAD_REVISION, targetBuildResourcesUrl, logMessage), new CopyItem( + sourceMainUrl, SVNUtilities.HEAD_REVISION, targetMainUrl, + logMessage))); + assertEquals(expectedCopySet, new HashSet<CopyItem>(svn.copyList)); + } + + @Test(expectedExceptions = + { BuildException.class }) + public void testCreateSprintTagAlreadyExisging() + { + final String repositoryRoot = "http://host/repos"; + final String groupName = "group"; + final String projectName = "testProject"; + final String tagName = "S42"; + final Map<String, List<String>> listMap = new HashMap<String, List<String>>(); + final String tagUrl = + StringUtils.join(Arrays.asList(repositoryRoot, groupName, projectName, + "tags/sprint"), "/"); + listMap.put(tagUrl, Collections.singletonList(tagName + "/")); + final Map<String, String> catMap = new HashMap<String, String>(); + final MockSVNRepositoryActions svn = new MockSVNRepositoryActions(listMap, catMap); + final SVNBranchAndTagTask task = new SVNBranchAndTagTask() + { + @Override + ISVNActions createSVNActions() + { + return svn; + } + }; + task.setProject(new Project()); // Required for log not to throw a NPE. + task.setRepositoryRoot(repositoryRoot); + task.setGroup(groupName); + task.setName(projectName); + task.setSprintTag(tagName); + task.execute(); + } + @Test(expectedExceptions = { BuildException.class }) public void testCreateReleaseTagWithBranchMissing() diff --git a/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContextTest.java b/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContextTest.java index 7b19804e32eaaa4842917c0cbf5c5249e852136b..a0a87d8e8fc0570bd5953db3ab5de3979dcdf7e7 100644 --- a/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContextTest.java +++ b/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNRepositoryProjectContextTest.java @@ -20,6 +20,7 @@ import static ch.systemsx.cisd.ant.task.subversion.SVNProjectVersionType.FEATURE import static ch.systemsx.cisd.ant.task.subversion.SVNProjectVersionType.RELEASE_BRANCH; import static ch.systemsx.cisd.ant.task.subversion.SVNProjectVersionType.RELEASE_TAG; import static ch.systemsx.cisd.ant.task.subversion.SVNProjectVersionType.TRUNK; +import static ch.systemsx.cisd.ant.task.subversion.SVNProjectVersionType.SPRINT_TAG; import static org.testng.AssertJUnit.assertEquals; import java.util.Arrays; @@ -48,36 +49,51 @@ public class SVNRepositoryProjectContextTest public void testVersionTypeReleaseBranch() { final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); - + def.setReleaseBranch("2.3.x"); assert RELEASE_BRANCH == def.getVersionType(); assertEquals("2.3.x", def.getVersion()); - + def.setReleaseBranch("0.0.x"); assert RELEASE_BRANCH == def.getVersionType(); assertEquals("0.0.x", def.getVersion()); - - def.setReleaseBranch("S30.x"); - assert RELEASE_BRANCH == def.getVersionType(); - assertEquals("S30.x", def.getVersion()); + + } + + @Test + public void testVersionTypeSprintReleaseTag() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + + def.setSprintTag("S42"); + assert SPRINT_TAG == def.getVersionType(); + assertEquals("S42", def.getVersion()); + + def.setSprintTag("S365"); + assert SPRINT_TAG == def.getVersionType(); + assertEquals("S365", def.getVersion()); + } + + @Test(expectedExceptions = + { UserFailureException.class }) + public void testFailSprintVersionTypeTag() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + def.setSprintTag("S365.42"); } @Test public void testVersionTypeTag() { final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); - + def.setReleaseTag("2.3.0"); assert RELEASE_TAG == def.getVersionType(); assertEquals("2.3.0", def.getVersion()); - + def.setReleaseTag("1.18.100"); assert RELEASE_TAG == def.getVersionType(); assertEquals("1.18.100", def.getVersion()); - - def.setReleaseTag("S18.100"); - assert RELEASE_TAG == def.getVersionType(); - assertEquals("S18.100", def.getVersion()); } @Test @@ -154,7 +170,7 @@ public class SVNRepositoryProjectContextTest final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); final String name = "someProject"; final String subName = "someSubProject"; - final String branchName = "S9.x"; + final String branchName = "8.06.x"; def.setProjectName(name); def.setReleaseBranch(branchName); final String branchUrl = @@ -311,15 +327,47 @@ public class SVNRepositoryProjectContextTest final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); def.setReleaseTag("1.1.x"); } - + @Test(expectedExceptions = { UserFailureException.class }) - public void testIllegalTag8() + public void testIllegalTag8() { final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); def.setReleaseTag("s1.x"); } + + @Test(expectedExceptions = + { UserFailureException.class }) + public void testIllegalReleaseTag9() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + def.setReleaseTag("S42"); + } + + @Test(expectedExceptions = + { UserFailureException.class }) + public void testIllegalSprintTag1() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + def.setSprintTag("1.1"); + } + + @Test(expectedExceptions = + { UserFailureException.class }) + public void testIllegalSprintTag2() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + def.setSprintTag("42"); + } + @Test(expectedExceptions = + { UserFailureException.class }) + public void testIllegalSprintTag3() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + def.setSprintTag("s42"); + } + @Test(expectedExceptions = { UserFailureException.class }) public void testIllegalBranch1() @@ -378,12 +426,20 @@ public class SVNRepositoryProjectContextTest @Test(expectedExceptions = { UserFailureException.class }) - public void testIllegalBranch8() + public void testIllegalBranch8() { final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); def.setReleaseBranch("s1.0"); } + @Test(expectedExceptions = + { UserFailureException.class }) + public void testIllegalBranch9() + { + final SVNRepositoryProjectContext def = new SVNRepositoryProjectContext(); + def.setReleaseBranch("S1"); + } + @Test public void testMissingName() { diff --git a/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilitiesTest.java b/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilitiesTest.java index 2beb4a4290232c305682634634e9dc993abdbe6b..6698614ce49cedc62a0e6e8382866bbae192264b 100644 --- a/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilitiesTest.java +++ b/ant_tasks/sourceTest/java/ch/systemsx/cisd/ant/task/subversion/SVNUtilitiesTest.java @@ -98,7 +98,6 @@ public class SVNUtilitiesTest assertEquals("0.9.x", SVNUtilities.getBranchForTag("0.9.0")); assertEquals("1.0.x", SVNUtilities.getBranchForTag("1.0.10")); assertEquals("8.04.x", SVNUtilities.getBranchForTag("8.04.10")); - assertEquals("S30.x", SVNUtilities.getBranchForTag("S30.10")); } @Test @@ -107,7 +106,6 @@ public class SVNUtilitiesTest assertEquals("0.9.0", SVNUtilities.getFirstTagForBranch("0.9.x")); assertEquals("1.5.0", SVNUtilities.getFirstTagForBranch("1.5.x")); assertEquals("8.04.0", SVNUtilities.getFirstTagForBranch("8.04.x")); - assertEquals("S30.0", SVNUtilities.getFirstTagForBranch("S30.x")); } }