Re: JavaHL jar file containing class files for unit tests

Daniel Sahlberg <[email protected]> Wed, 29 Jul 2026 10:58:10 +0200
Newsgroups gmane.comp.version-control.subversion.devel
Message-ID <CAMHy98Nxhf0K=ghWSApO_ArC8t5Znucgcow8JEugK0FNHcuT_g@mail.gmail.com>
--000000000000a018280657bc28bb
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <[email protected]>:

> On 2026/07/28 23:58, Daniel Sahlberg wrote:
> > Den m=C3=A5n 27 juli 2026 kl 00:09 skrev Jun Omae <[email protected] <m=
ailto:
> [email protected]>>:
> >
> >     > Is there a problem if we include the test classes?
> >
> >     No direct issues have been found so far. However, static
> initializers within test classes are executed simply by loading the class=
.
> >
> >     [[[
> >     $ grep -r 'static *{' subversion/bindings/javahl
> >
>  subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.=
java:
>    static {
> >
>  subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.=
java:
>    static {
> >     ]]]
> >
> >
> > Thank you!
> >
> > I think I got it working on 1.14.x, successfully created a JAR file
> without the tests.
> >
> > It still seems to fail on trunk. Can you do the same steps above on
> trunk?
> >
> > Cheers,
> > Daniel
> >
>
> Hm, I get the same failures on trunk.
> It seems that the changes of the behavior is introduced in r1933892.
> At least, ./configure should stop and/or warn it if the junit is NOT
> optional when javahl enabled.
>
> [[[
> $ /bin/sh autogen.sh
> $ ./configure --prefix=3D/dev/shm/svn/trunk --without-apxs --without-swig
> --without-swig-{perl,python,ruby} --enable-javahl
> --with-jdk=3D/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
> PYTHON=3D/usr/bin/python3
> $ make -j$(nproc) all
> $ make javahl
>
> $ find subversion/bindings/javahl -name '*.class' | wc -l
> 277
> $ find subversion/bindings/javahl -name '*Test*.class' | wc -l
> 0    #=3D=3D> tests/**/*.java are compiled yet.
>
> $ make install
> $ make install-javahl    # Why this task builds tests/**/*.java?
> ...
> /dev/shm/subversion-trunk/subversion/bindings/javahl/tests/org/tigris/sub=
version/javahl/BasicTests.java:1708:
> error: cannot find symbol
>         assertEquals("wrong revision from commit",
>         ^
>   symbol:   method assertEquals(String,long,int)
>   location: class BasicTests
> /dev/shm/subversion-trunk/subversion/bindings/javahl/tests/org/tigris/sub=
version/javahl/BasicTests.java:1756:
> error: cannot find symbol
>         assertEquals("wrong revision from update",
>         ^
>   symbol:   method assertEquals(String,long,int)
>   location: class BasicTests
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> 100 errors
> ]]]
>

Thanks for confirming! It seems like 1.15.x is also affected by this (I'll
bring it up on the release thread).

To add three more data points to the discussion, I checked Fedora 43, 44
and FreeBSD 14. The tests are present in Fedora's svn-javahl.jar but not in
FreeBSD's svn-javahl.jar. Obviously different distributors use different
options when building. That is unfortunate since we are distributing
different ABIs.

I think it would be cleaner to have the tests in svn-javahl-tests.jar if
built. Maybe we want to install this alongside svn-javahl.jar. That way
Fedora and Ubuntu can keep distributing the tests and FreeBSD not, while
everyone's svn-javahl.jar is the same.

Does that make sense?

Cheers,
Daniel

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

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">Den ons 29 juli=
 2026 kl 04:32 skrev Jun Omae &lt;<a href=3D"mailto:[email protected]">jun6=
[email protected]</a>&gt;:<br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">On 2026/07/28 23:58, Daniel Sahlberg wrote:<br>
&gt; Den m=C3=A5n 27 juli 2026 kl 00:09 skrev Jun Omae &lt;<a href=3D"mailt=
o:[email protected]" target=3D"_blank">[email protected]</a> &lt;mailto:<a =
href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&g=
t;&gt;:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; Is there a problem if we include the test clas=
ses?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0No direct issues have been found so far. However, s=
tatic initializers within test classes are executed simply by loading the c=
lass.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0[[[<br>
&gt;=C2=A0 =C2=A0 =C2=A0$ grep -r &#39;static *{&#39; subversion/bindings/j=
avahl<br>
&gt;=C2=A0 =C2=A0 =C2=A0subversion/bindings/javahl/tests/org/apache/subvers=
ion/javahl/UtilTests.java: =C2=A0 =C2=A0static {<br>
&gt;=C2=A0 =C2=A0 =C2=A0subversion/bindings/javahl/tests/org/apache/subvers=
ion/javahl/UtilTests.java: =C2=A0 =C2=A0static {<br>
&gt;=C2=A0 =C2=A0 =C2=A0]]]<br>
&gt; <br>
&gt; <br>
&gt; Thank you!<br>
&gt; <br>
&gt; I think I got it working on 1.14.x, successfully created a JAR file wi=
thout the tests.<br>
&gt; <br>
&gt; It still seems to fail on trunk. Can you do the same steps above on tr=
unk?<br>
&gt; <br>
&gt; Cheers,<br>
&gt; Daniel<br>
&gt; <br>
<br>
Hm, I get the same failures on trunk.<br>
It seems that the changes of the behavior is introduced in r1933892.<br>
At least, ./configure should stop and/or warn it if the junit is NOT option=
al when javahl enabled.<br>
<br>
[[[<br>
$ /bin/sh autogen.sh<br>
$ ./configure --prefix=3D/dev/shm/svn/trunk --without-apxs --without-swig -=
-without-swig-{perl,python,ruby} --enable-javahl --with-jdk=3D/usr/lib/jvm/=
java-11-openjdk-amd64 --without-junit PYTHON=3D/usr/bin/python3<br>
$ make -j$(nproc) all<br>
$ make javahl<br>
<br>
$ find subversion/bindings/javahl -name &#39;*.class&#39; | wc -l<br>
277<br>
$ find subversion/bindings/javahl -name &#39;*Test*.class&#39; | wc -l<br>
0=C2=A0 =C2=A0 #=3D=3D&gt; tests/**/*.java are compiled yet.<br>
<br>
$ make install<br>
$ make install-javahl=C2=A0 =C2=A0 # Why this task builds tests/**/*.java?<=
br>
...<br>
/dev/shm/subversion-trunk/subversion/bindings/javahl/tests/org/tigris/subve=
rsion/javahl/BasicTests.java:1708: error: cannot find symbol<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertEquals(&quot;wrong revision from commit&q=
uot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ^<br>
=C2=A0 symbol:=C2=A0 =C2=A0method assertEquals(String,long,int)<br>
=C2=A0 location: class BasicTests<br>
/dev/shm/subversion-trunk/subversion/bindings/javahl/tests/org/tigris/subve=
rsion/javahl/BasicTests.java:1756: error: cannot find symbol<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertEquals(&quot;wrong revision from update&q=
uot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ^<br>
=C2=A0 symbol:=C2=A0 =C2=A0method assertEquals(String,long,int)<br>
=C2=A0 location: class BasicTests<br>
Note: Some input files use or override a deprecated API.<br>
Note: Recompile with -Xlint:deprecation for details.<br>
100 errors<br>
]]]<br></blockquote><div><br></div><div>Thanks for confirming! It seems lik=
e 1.15.x is also affected by this (I&#39;ll bring it up on the release thre=
ad).</div><div><br></div><div><div>To add three more data points to the dis=
cussion, I checked Fedora 43, 44 and FreeBSD 14. The tests are present in F=
edora&#39;s svn-javahl.jar but not in FreeBSD&#39;s svn-javahl.jar. Obvious=
ly different distributors use different options when building. That is unfo=
rtunate since we are distributing different ABIs.</div><div><br></div><div>=
<span style=3D"background-color:transparent">I think it would be cleaner to=
 have the tests in svn-javahl-tests.jar if built. Maybe we want to install =
this alongside svn-javahl.jar. That way Fedora and Ubuntu can keep distribu=
ting the tests and FreeBSD not, while everyone&#39;s svn-javahl.jar is the =
same.</span></div><div><span style=3D"background-color:transparent"><br></s=
pan></div><div><span style=3D"background-color:transparent">Does that make =
sense?</span></div><div><span style=3D"background-color:transparent"><br></=
span></div><div>Cheers,</div><div>Daniel</div><div><br></div></div></div></=
div>

--000000000000a018280657bc28bb--