Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Use Ant's repo for most of the test now
git-svn-id: https://svn.apache.org/repos/asf/ant/sandbox/antlibs/svn/trunk@161895 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bodewig committed Apr 19, 2005
1 parent c7618ea commit 284f0fab2eee34391f211bda066c8b31af9881e8
Showing 6 changed files with 67 additions and 68 deletions.
@@ -20,42 +20,42 @@
default="all" xmlns:svn="antlib:org.apache.tools.ant.taskdefs.svn">

<property name="tmpdir" value="tmpdir"/>
<property name="tpfdir" value="${tmpdir}/tpf"/>
<property name="file" value="ebcdic.h"/>
<property name="trunkdir" value="${tmpdir}/trunk"/>
<property name="file" value="build.xml"/>

<target name="setup">
<mkdir dir="${tmpdir}"/>
<svn:svn
svnURL="http://svn.apache.org/repos/asf/httpd/httpd/trunk/os/tpf/"
svnURL="http://svn.apache.org/repos/asf/ant/antlibs/common/trunk/"
dest="${tmpdir}"/>
</target>

<target name="all" depends="setup">
<svn:svn failonerror="true" subcommand="status ${file}" dest="${tpfdir}"/>
<svn:svn failonerror="true" dest="${tpfdir}">
<svn:svn failonerror="true" subcommand="status ${file}" dest="${trunkdir}"/>
<svn:svn failonerror="true" dest="${trunkdir}">
<commandline>
<argument value="up"/>
<argument value="-r"/>
<argument value="83750"/>
<argument value="161881"/>
<argument value="${file}"/>
</commandline>
</svn:svn>
<svn:svn failonerror="true" subcommand="status ${file}" dest="${tpfdir}"/>
<svn:svn failonerror="true" dest="${tpfdir}">
<svn:svn failonerror="true" subcommand="status ${file}" dest="${trunkdir}"/>
<svn:svn failonerror="true" dest="${trunkdir}">
<commandline>
<argument line="up -r HEAD ${file}" />
</commandline>
</svn:svn>
<svn:svn failonerror="true" subcommand="status ${file}" dest="${tpfdir}"/>
<svn:svn failonerror="true" subcommand="status ${file}" dest="${trunkdir}"/>
</target>

<target name="revision-attribute">
<mkdir dir="${tmpdir}" />
<svn:svn
svnURL="http://svn.apache.org/repos/asf/httpd/httpd/trunk/os/tpf"
svnURL="http://svn.apache.org/repos/asf/ant/antlibs/common/trunk/"
dest="${tmpdir}"
quiet="false"
revision="83750"/>
revision="161881"/>
</target>

<target name="cleanup">
@@ -25,7 +25,7 @@
<target name="setup">
<mkdir dir="${tmpdir}"/>
<svn:svn
svnURL="http://svn.apache.org/repos/asf/jakarta/bcel/trunk"
svnURL="http://svn.apache.org/repos/asf/ant/sandbox/antlibs/svn/trunk"
dest="${tmpdir}"/>
</target>

@@ -36,30 +36,30 @@

<target name="start" depends="setup">
<svn:changelog failonerror="true" dest="${trunkdir}"
destfile="${tmpdir}/log.xml" start="153000"/>
destfile="${tmpdir}/log.xml" start="161500"/>
</target>

<target name="startDate" depends="setup">
<svn:changelog failonerror="true" dest="${trunkdir}"
destfile="${tmpdir}/log.xml" start="{2005-02-10}"/>
destfile="${tmpdir}/log.xml" start="{2005-04-18}"/>
</target>

<target name="end" depends="setup">
<svn:changelog failonerror="true" dest="${trunkdir}"
destfile="${tmpdir}/log.xml" end="153000"/>
destfile="${tmpdir}/log.xml" end="161500"/>
</target>

<target name="endDate" depends="setup">
<svn:changelog failonerror="true" dest="${trunkdir}"
destfile="${tmpdir}/log.xml" end="{2005-02-10}"/>
destfile="${tmpdir}/log.xml" end="{2005-04-18}"/>
</target>

<target name="report" depends="start">
<style in="${tmpdir}/log.xml"
out="${tmpdir}/log.html"
style="src/etc/changelog.xsl">
<param name="title" expression="Jakarta BCEL ChangeLog"/>
<param name="repo" expression="http://svn.apache.org/repos/asf"/>
<param name="title" expression="Ant SVN Antlib ChangeLog"/>
<param name="repo" expression="http://svn.apache.org/repos/ant/sandbox/antlibs/svn"/>
</style>
</target>

@@ -28,19 +28,19 @@

<target name="setup" depends="dir-prep">
<svn:svn
svnURL="http://svn.apache.org/repos/asf/jakarta/bcel/trunk"
svnURL="http://svn.apache.org/repos/asf/ant/sandbox/antlibs/svn/trunk"
dest="${tmpdir}"/>
</target>

<target name="diff" depends="setup">
<svn:revisiondiff failonerror="true" dest="${trunkdir}"
destfile="${tmpdir}/diff.xml" start="152904" end="153682"/>
destfile="${tmpdir}/diff.xml" start="161469" end="161885"/>
</target>

<target name="diff-using-url" depends="dir-prep">
<svn:revisiondiff failonerror="true"
svnURL="http://svn.apache.org/repos/asf/jakarta/bcel/trunk"
destfile="${tmpdir}/diff.xml" start="152904" end="153682"/>
svnURL="http://svn.apache.org/repos/asf/ant/sandbox/antlibs/svn/trunk"
destfile="${tmpdir}/diff.xml" start="161469" end="161885"/>
</target>

<target name="report" depends="diff-using-url">
@@ -45,9 +45,9 @@ public void testAbstractSvnTask() {
}

public void testRevisionAttribute() {
File f = getProject().resolveFile("tmpdir/tpf/ebcdic.h");
File f = getProject().resolveFile("tmpdir/trunk/build.xml");
assertTrue("starting empty", !f.exists());
expectLogContaining("revision-attribute", "A tpf/ebcdic.h");
expectLogContaining("revision-attribute", "A trunk/build.xml");
assertTrue("now it is there", f.exists());
}
}
@@ -42,32 +42,32 @@ public void tearDown() {

public void testLog() throws IOException {
String log = executeTargetAndReadLogFully("log");
assertRev153687(log);
assertRev152685(log);
assertRev161885(log);
assertRev161469(log);
}

public void testStart() throws IOException {
String log = executeTargetAndReadLogFully("start");
assertRev153687(log);
assertNoRev152685(log);
assertRev161885(log);
assertNoRev161469(log);
}

public void testStartDate() throws IOException {
String log = executeTargetAndReadLogFully("startDate");
assertRev153687(log);
assertNoRev152685(log);
assertRev161885(log);
assertNoRev161469(log);
}

public void testEnd() throws IOException {
String log = executeTargetAndReadLogFully("end");
assertNoRev153687(log);
assertRev152685(log);
assertNoRev161885(log);
assertRev161469(log);
}

public void testEndDate() throws IOException {
String log = executeTargetAndReadLogFully("endDate");
assertNoRev153687(log);
assertRev152685(log);
assertNoRev161885(log);
assertRev161469(log);
}

private String executeTargetAndReadLogFully(String target)
@@ -82,8 +82,8 @@ private String executeTargetAndReadLogFully(String target)
}
}

private static final void assertRev153687(String log) {
int rev = log.indexOf("<revision>153687</revision>");
private static final void assertRev161885(String log) {
int rev = log.indexOf("<revision>161885</revision>");
Assert.assertTrue(rev > -1);
int entryBeforeRev = log.lastIndexOf("<entry>", rev);
int entryAfterRev = log.indexOf("</entry>", rev);
@@ -92,25 +92,23 @@ private static final void assertRev153687(String log) {
Assert.assertTrue(entryAfterRev > -1);

Assert
.assertTrue(log.lastIndexOf("<author><![CDATA[dbrosius]]></author>",
.assertTrue(log.lastIndexOf("<author><![CDATA[bodewig]]></author>",
rev) > entryBeforeRev);
Assert
.assertTrue(log.indexOf("<name><![CDATA[/jakarta/bcel/trunk/src"
+ "/java/org/apache/bcel/util/BCELifier."
+ "java]]></name>", rev) < entryAfterRev);
.assertTrue(log.indexOf("<name><![CDATA[/ant/sandbox/antlibs/"
+ "antunit/trunk]]></name>", rev)
< entryAfterRev);
Assert
.assertTrue(log.indexOf("<action>modified</action>", rev)
< entryAfterRev);
Assert
.assertTrue(log.indexOf("<message><![CDATA[Update BCELifier to "
+ "handle the new method access flags "
+ "(ACC_BRIDGE, ACC_VARARGS)]]></message>",
rev)
.assertTrue(log.indexOf("<message><![CDATA[Make sandboxes build"
+ "]]></message>", rev)
< entryAfterRev);
}

private static final void assertRev152685(String log) {
int rev = log.indexOf("<revision>152685</revision>");
private static final void assertRev161469(String log) {
int rev = log.indexOf("<revision>161469</revision>");
Assert.assertTrue(rev > -1);
int entryBeforeRev = log.lastIndexOf("<entry>", rev);
int entryAfterRev = log.indexOf("</entry>", rev);
@@ -119,28 +117,28 @@ private static final void assertRev152685(String log) {
Assert.assertTrue(entryAfterRev > -1);

Assert
.assertTrue(log.lastIndexOf("<![CDATA[(no author)]]>", rev)
.assertTrue(log.lastIndexOf("<![CDATA[bodewig]]>", rev)
> entryBeforeRev);
Assert
.assertTrue(log.indexOf("<name><![CDATA[/jakarta/bcel/branches]]>"
+ "</name>", rev) < entryAfterRev);
.assertTrue(log.indexOf("<name><![CDATA[/ant/sandbox/antlibs/"
+ "antunit]]></name>", rev)
< entryAfterRev);
Assert
.assertTrue(log.indexOf("<action>added</action>", rev)
< entryAfterRev);
Assert
.assertTrue(log.indexOf("<message><![CDATA[New repository "
+ "initialized by cvs2svn.]]></message>",
rev)
.assertTrue(log.indexOf("<message><![CDATA[Import sandbox antlibs"
+ "]]></message>", rev)
< entryAfterRev);
}

private static final void assertNoRev153687(String log) {
int rev = log.indexOf("<revision>153687</revision>");
private static final void assertNoRev161885(String log) {
int rev = log.indexOf("<revision>161885</revision>");
Assert.assertEquals(-1, rev);
}

private static final void assertNoRev152685(String log) {
int rev = log.indexOf("<revision>152685</revision>");
private static final void assertNoRev161469(String log) {
int rev = log.indexOf("<revision>161469</revision>");
Assert.assertEquals(-1, rev);
}
}
@@ -43,17 +43,17 @@ public void tearDown() {
public void testDiff() throws IOException {
String log = executeTargetAndReadLogFully("diff");
assertAttributesNoURL(log);
assertAdded(log);
//assertAdded(log);
assertModified(log);
assertDeleted(log);
//assertDeleted(log);
}

public void testDiffUrl() throws IOException {
String log = executeTargetAndReadLogFully("diff-using-url");
assertAttributesWithURL(log);
assertAdded(log);
//assertAdded(log);
assertModified(log);
assertDeleted(log);
//assertDeleted(log);
}

private String executeTargetAndReadLogFully(String target)
@@ -73,10 +73,10 @@ private static final void assertAttributes(String log) {
Assert.assertTrue(start > -1);
int end = log.indexOf(">", start);
Assert.assertTrue(end > -1);
Assert.assertTrue(log.indexOf("start=\"152904\"", start) > -1);
Assert.assertTrue(log.indexOf("start=\"152904\"", start) < end);
Assert.assertTrue(log.indexOf("end=\"153682\"", start) > -1);
Assert.assertTrue(log.indexOf("end=\"153682\"", start) < end);
Assert.assertTrue(log.indexOf("start=\"161469\"", start) > -1);
Assert.assertTrue(log.indexOf("start=\"161469\"", start) < end);
Assert.assertTrue(log.indexOf("end=\"161885\"", start) > -1);
Assert.assertTrue(log.indexOf("end=\"161885\"", start) < end);
}

private static final void assertAttributesNoURL(String log) {
@@ -89,10 +89,12 @@ private static final void assertAttributesWithURL(String log) {
int start = log.indexOf("<revisiondiff");
int end = log.indexOf(">", start);
Assert.assertTrue(log.indexOf("svnurl=\"http://svn.apache.org/repos/"
+ "asf/jakarta/bcel/trunk\"", start)
+ "asf/ant/sandbox/antlibs/svn/trunk\"",
start)
> -1);
Assert.assertTrue(log.indexOf("svnurl=\"http://svn.apache.org/repos/"
+ "asf/jakarta/bcel/trunk\"", start)
+ "asf/ant/sandbox/antlibs/svn/trunk\"",
start)
< end);
}

@@ -110,8 +112,7 @@ private static final void assertAdded(String log) {
}

private static final void assertModified(String log) {
int name = log.indexOf("<name><![CDATA[xdocs/stylesheets/project."
+ "xml]]></name>");
int name = log.indexOf("<name><![CDATA[build.xml]]></name>");
Assert.assertTrue(name > -1);

int pathAfterName = log.indexOf("</path>", name);

0 comments on commit 284f0fa

Please sign in to comment.