Re: JavaHL jar file containing class files for unit tests

Daniel Sahlberg <[email protected]> Sun, 26 Jul 2026 17:30:15 +0200
Newsgroups gmane.comp.version-control.subversion.devel
Message-ID <CAMHy98PZCkT7yh0W0+ebiMECqJCw6iZnh_KzEHem9krJgMcf+g@mail.gmail.com>
--0000000000003159c3065785494f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Den s=C3=B6n 26 juli 2026 kl 12:06 skrev Jun Omae <[email protected]>:

> On Sun, Jul 26, 2026 at 6:39=E2=80=AFPM Branko =C4=8Cibej <[email protected]=
rg> wrote:
> >
> > On 26. 7. 2026 11:24, Jun Omae wrote:
> >
> > Hi,
> >
> > I noticed that svn-javahl.jar file has class files for unit tests while
> working for support build JavaHL with cmake.
> > I don't think it's necessary for the jar file for distribution.... is
> that intentional?
> >
> >
> >
> > I noticed this myself the last time I looked at JavaHL. I'm not sure ho=
w
> this came about in the first place, but by now it's intentional because
> it's always been this way. Maybe it's to allow users who only use binarie=
s
> to run JavaHL tests. In any case this is part of the published ABI.
>
>
> In JavaDoc for JavaHL, test classes are not described.
> See https://subversion.apache.org/docs/javahl/1.14/
>
>
> > In JavaHL build with cmake, the class files for unit tests are archived
> into svn-javahl-tests.jar, and only svn-javahl.jar is installed.
> >
> >
> > The CMake build must create a JAR that is identical to what the
> autotools produce.
>
>
> JUnit jar is not required for build with autoconf. Without JUnit jar,
> the svn-javahl.jar doesn't have test classes.
>

How did you configure your build?

If I configure with --with-junit=3D/path/to/junit-4.13.2.jar, I can run `ma=
ke
install-javahl` successfully.

However if I configure without --with-junit (and run make clean!), I get
error messages whenever I run `make install-javahl`:
[[[
/home/dsg/ramdisk/svn_trunk/subversion/bindings/javahl/tests/org/apache/sub=
version/javahl/BasicTests.java:1446:
error: cannot find symbol
        assertEquals(expected, actual);
        ^
  symbol:   method assertEquals(String,String)
  location: class BasicTests
]]]

What I'd like to confirm is if we can create a JAR without the test classes=
.

@Jun Omae <[email protected]> Is there a problem if we include the test
classes?

Cheers,
Daniel

--0000000000003159c3065785494f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><span s=
tyle=3D"background-color:transparent">Den s=C3=B6n 26 juli 2026 kl 12:06 sk=
rev Jun Omae &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">jun=
[email protected]</a>&gt;:</span></div><div class=3D"gmail_quote"><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex">On Sun, Jul 26, 2026 at 6:39=E2=80=AF=
PM Branko =C4=8Cibej &lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:<br>
&gt;<br>
&gt; On 26. 7. 2026 11:24, Jun Omae wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I noticed that svn-javahl.jar file has class files for unit tests whil=
e working for support build JavaHL with cmake.<br>
&gt; I don&#39;t think it&#39;s necessary for the jar file for distribution=
.... is that intentional?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I noticed this myself the last time I looked at JavaHL. I&#39;m not su=
re how this came about in the first place, but by now it&#39;s intentional =
because it&#39;s always been this way. Maybe it&#39;s to allow users who on=
ly use binaries to run JavaHL tests. In any case this is part of the publis=
hed ABI.<br>
<br>
<br>
In JavaDoc for JavaHL, test classes are not described.<br>
See <a href=3D"https://subversion.apache.org/docs/javahl/1.14/" rel=3D"nore=
ferrer" target=3D"_blank">https://subversion.apache.org/docs/javahl/1.14/</=
a><br>
<br>
<br>
&gt; In JavaHL build with cmake, the class files for unit tests are archive=
d into svn-javahl-tests.jar, and only svn-javahl.jar is installed.<br>
&gt;<br>
&gt;<br>
&gt; The CMake build must create a JAR that is identical to what the autoto=
ols produce.<br>
<br>
<br>
JUnit jar is not required for build with autoconf. Without JUnit jar,<br>
the svn-javahl.jar doesn&#39;t have test classes.<br></blockquote><div><br>=
</div><div>How did you configure your build?</div><div><br></div><div><div>=
<span style=3D"background-color:transparent">I</span><span style=3D"backgro=
und-color:transparent">f I configure with --with-junit=3D/path/to/junit-4.1=
3.2.jar, I can run=C2=A0</span><span style=3D"background-color:transparent"=
>`make install-javahl`</span><span style=3D"background-color:transparent">=
=C2=A0successfully.</span></div><br></div><div>However if I configure witho=
ut --with-junit (and run make clean!), I get error messages w<span style=3D=
"background-color:transparent">henever I run `make install-javahl`:</span><=
/div><div>[[[</div>/home/dsg/ramdisk/svn_trunk/subversion/bindings/javahl/t=
ests/org/apache/subversion/javahl/BasicTests.java:1446: error: cannot find =
symbol<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertEquals(expected, actual);<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ^<br>=C2=A0 symbol: =C2=A0 method assertEquals(=
String,String)<br><div><span style=3D"background-color:transparent">=C2=A0 =
location: class BasicTests</span></div><div>]]]</div><div><br></div><div>Wh=
at I&#39;d like to confirm is if we can create a JAR without the test class=
es.</div><div><br></div><div><a class=3D"gmail_plusreply" id=3D"plusReplyCh=
ip-0" href=3D"mailto:[email protected]" tabindex=3D"-1">@Jun Omae</a>=C2=A0=
Is there a problem if we include the test classes?<br></div><div><br></div>=
<div><span style=3D"background-color:transparent">Cheers,</span></div><div>=
<span style=3D"background-color:transparent">Daniel</span></div><div><br></=
div></div></div>
</div>
</div>

--0000000000003159c3065785494f--