You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jun Omae <ju...@gmail.com> on 2026/07/26 09:24:00 UTC

JavaHL jar file containing class files for unit tests

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?

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.

E.g.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=26.04
DISTRIB_CODENAME=resolute
DISTRIB_DESCRIPTION="Ubuntu Resolute Raccoon (development branch)"

$ apt install -y libsvn-java

$ unzip -l /usr/share/java/svn-javahl.jar | grep RunTests
     2013  2026-03-20 11:04   org/apache/subversion/javahl/RunTests$SVNTestSuite.class
     1155  2026-03-20 11:04   org/apache/subversion/javahl/RunTests.class
     1846  2026-03-20 11:04   org/tigris/subversion/javahl/RunTests$SVNTestSuite.class
     1179  2026-03-20 11:04   org/tigris/subversion/javahl/RunTests.class

$ unzip -l /usr/share/java/svn-javahl.jar | grep Test | wc -l
101

-- 
Jun Omae <ju...@gmail.com> (大前 潤)


Re: JavaHL jar file containing class files for unit tests

Posted by Branko Čibej <br...@apache.org>.
On 6. 8. 2026 18:13, Daniel Sahlberg wrote:
> Den tors 6 aug. 2026 kl 16:18 skrev Branko Čibej <br...@apache.org>:
>
>     On 2. 8. 2026 15:07, Daniel Sahlberg wrote:
>>     Den ons 29 juli 2026 kl 12:52 skrev Branko Čibej <br...@apache.org>:
>>
>>         On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>>>
>>>
>>>         Den ons 29 juli 2026 kl 04:32 skrev Jun Omae
>>>         <ju...@gmail.com>:
>>>
>>>             On 2026/07/28 23:58, Daniel Sahlberg wrote:
>>>             > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae
>>>             <jun66j5@gmail.com <ma...@gmail.com>>:
>>>             >
>>>             >     > 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=/dev/shm/svn/trunk --without-apxs
>>>             --without-swig --without-swig-{perl,python,ruby}
>>>             --enable-javahl
>>>             --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64
>>>             --without-junit PYTHON=/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    #==> 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/subversion/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/subversion/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?
>>
>>
>>         The following makes sense:
>>
>>         1. There is no regression in autotools. It is what it is.
>>         Note that putting test classes in a separate jar has wider
>>         consequences than just the ABI. For example, JavaHL tests
>>         would fail in autotools builds. We'd have to change the way
>>         the classpath is constructed in `make check-*-javahl`.
>>
>>         2. No change is needed in 1.15.x. Autotools are consistent
>>         with earlier releases and CMake doesn't build JavaHL. IFF we
>>         want to change this in CMake for 1.15, then we have further
>>         questions to consider:
>>
>>             2.1. CMake and Autotools/vcxproj should produce identical
>>             results given identical options. In this case
>>             specifically I mean that the CMake build should create
>>             the same lib/dll names and the same JavaHL jar (singular)
>>             as the vcxproj generator.
>>
>>
>>         3. Regardless of the answer to 2: If we decide to not include
>>         test classes in svn-javhl.jar, then we have to consider how
>>         to mitigate the ABI change.
>>
>>         Personally I'd prefer changing the build requirements to
>>         changing the ABI in svn-javahl.jar. That means that
>>         --enable-javahl implies that JUnit is mandatory.
>>
>>         -- Brane
>>
>>
>>     Is the patch below an acceptable way of requiring --with-junit?
>>
>>     Cheers,
>>     Daniel
>>
>>
>>      [[[
>>     Index: configure.ac <http://configure.ac>
>>     ===================================================================
>>     --- configure.ac <http://configure.ac>  (revision 1936330)
>>     +++ configure.ac <http://configure.ac>  (working copy)
>>     @@ -1748,6 +1748,7 @@
>>
>>      dnl Possibly compile JavaHL
>>      do_javahl_build=no
>>     +has_junit=no
>
>     This initialisation is not needed.
>
>>      AC_ARG_ENABLE(javahl,
>>        AS_HELP_STRING([--enable-javahl],
>>                   [Enable compilation of Java high-level bindings
>>     (requires C++)]),
>>     @@ -1755,6 +1756,21 @@
>>              do_javahl_build="yes"
>>          fi
>>        ])
>>     +AC_ARG_WITH(junit,
>>     +AS_HELP_STRING([--with-junit=PATH],
>>     +               [Specify a path to the junit JAR file.]),
>>     +[
>>     +    if test "$withval" != "no"; then
>>     +      if test -n "$JAVA_CLASSPATH"; then
>>     +        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
>>     +      else
>>     +        JAVA_CLASSPATH="$withval"
>>     +      fi
>>     +      JAVAHL_TESTS_TARGET="javahl-tests"
>>     +  JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
>>     +      has_junit="yes"
>>
>>     Should be;
>>        have_junit="yes"
>>
>>     +    fi
>>     +])
>>
>>      JAVAHL_OBJDIR=""
>>      INSTALL_EXTRA_JAVAHL_LIB=""
>>     @@ -1763,6 +1779,12 @@
>>      JAVAHL_COMPAT_TESTS_TARGET=""
>>      LT_CXX_LIBADD=""
>>      if test "$do_javahl_build" = "yes"; then
>>     +  dnl Since r1933892 junit is required to build the JavaHL bindings
>>     +  if test "$has_junit" = "no"; then
>
>     And here:
>
>        if test "$have_junit" != "yes"; then
>
>
>     The idea is to set the have_junit variable exactly once. If it's
>     not set, "$have_junit" will be an empty string.
>
>>     +  AC_MSG_ERROR([--with-junit must be specified if building the
>>     Java high-level
>>     +                  bindings.])
>>     +  fi
>>     +
>>        dnl Check for suitable JDK
>>        if test "$JDK_SUITABLE" = "no"; then
>>          AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK.
>>     @@ -1802,21 +1824,6 @@
>>      AC_SUBST(JAVAHL_OBJDIR)
>>      AC_SUBST(FIX_JAVAHL_LIB)
>>      AC_SUBST(LT_CXX_LIBADD)
>>     -
>>     -AC_ARG_WITH(junit,
>>     -AS_HELP_STRING([--with-junit=PATH],
>>     -               [Specify a path to the junit JAR file.]),
>>     -[
>>     -    if test "$withval" != "no"; then
>>     -      if test -n "$JAVA_CLASSPATH"; then
>>     -        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
>>     -      else
>>     -        JAVA_CLASSPATH="$withval"
>>     -      fi
>>     -      JAVAHL_TESTS_TARGET="javahl-tests"
>>     -  JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
>>     -    fi
>>     -])
>>      AC_SUBST(JAVA_CLASSPATH)
>>      AC_SUBST(JAVAHL_TESTS_TARGET)
>>      AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
>>     ]]]
>>
>
>
>  Out of curiosity, why do $do_javahl_build and others follow another 
> pattern?

Because of Emerson. [1]

-- Brane

[1] https://en.wikipedia.org/wiki/Wikipedia:Emerson_and_Wilde_on_consistency

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den tors 6 aug. 2026 kl 16:18 skrev Branko Čibej <br...@apache.org>:

> On 2. 8. 2026 15:07, Daniel Sahlberg wrote:
>
> Den ons 29 juli 2026 kl 12:52 skrev Branko Čibej <br...@apache.org>:
>
>> On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>>
>>
>>
>> Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:
>>
>>> On 2026/07/28 23:58, Daniel Sahlberg wrote:
>>> > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com
>>> <ma...@gmail.com>>:
>>> >
>>> >     > 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=/dev/shm/svn/trunk --without-apxs --without-swig
>>> --without-swig-{perl,python,ruby} --enable-javahl
>>> --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
>>> PYTHON=/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    #==> 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/subversion/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/subversion/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?
>>
>>
>>
>> The following makes sense:
>>
>> 1. There is no regression in autotools. It is what it is. Note that
>> putting test classes in a separate jar has wider consequences than just the
>> ABI. For example, JavaHL tests would fail in autotools builds. We'd have to
>> change the way the classpath is constructed in `make check-*-javahl`.
>>
>> 2. No change is needed in 1.15.x. Autotools are consistent with earlier
>> releases and CMake doesn't build JavaHL. IFF we want to change this in
>> CMake for 1.15, then we have further questions to consider:
>>
>> 2.1. CMake and Autotools/vcxproj should produce identical results given
>> identical options. In this case specifically I mean that the CMake build
>> should create the same lib/dll names and the same JavaHL jar (singular) as
>> the vcxproj generator.
>>
>>
>> 3. Regardless of the answer to 2: If we decide to not include test
>> classes in svn-javhl.jar, then we have to consider how to mitigate the ABI
>> change.
>>
>> Personally I'd prefer changing the build requirements to changing the ABI
>> in svn-javahl.jar. That means that --enable-javahl implies that JUnit is
>> mandatory.
>>
>> -- Brane
>>
>>
> Is the patch below an acceptable way of requiring --with-junit?
>
> Cheers,
> Daniel
>
>
>  [[[
> Index: configure.ac
> ===================================================================
> --- configure.ac        (revision 1936330)
> +++ configure.ac        (working copy)
> @@ -1748,6 +1748,7 @@
>
>  dnl Possibly compile JavaHL
>  do_javahl_build=no
> +has_junit=no
>
>
> This initialisation is not needed.
>
>  AC_ARG_ENABLE(javahl,
>    AS_HELP_STRING([--enable-javahl],
>               [Enable compilation of Java high-level bindings (requires
> C++)]),
> @@ -1755,6 +1756,21 @@
>          do_javahl_build="yes"
>      fi
>    ])
> +AC_ARG_WITH(junit,
> +AS_HELP_STRING([--with-junit=PATH],
> +               [Specify a path to the junit JAR file.]),
> +[
> +    if test "$withval" != "no"; then
> +      if test -n "$JAVA_CLASSPATH"; then
> +        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
> +      else
> +        JAVA_CLASSPATH="$withval"
> +      fi
> +      JAVAHL_TESTS_TARGET="javahl-tests"
> +      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
> +      has_junit="yes"
>
> Should be;
>
>   have_junit="yes"
>
>
> +    fi
> +])
>
>  JAVAHL_OBJDIR=""
>  INSTALL_EXTRA_JAVAHL_LIB=""
> @@ -1763,6 +1779,12 @@
>  JAVAHL_COMPAT_TESTS_TARGET=""
>  LT_CXX_LIBADD=""
>  if test "$do_javahl_build" = "yes"; then
> +  dnl Since r1933892 junit is required to build the JavaHL bindings
> +  if test "$has_junit" = "no"; then
>
>
> And here:
>
>   if test "$have_junit" != "yes"; then
>
>
> The idea is to set the have_junit variable exactly once. If it's not set,
> "$have_junit" will be an empty string.
>
> +    AC_MSG_ERROR([--with-junit must be specified if building the Java
> high-level
> +                  bindings.])
> +  fi
> +
>    dnl Check for suitable JDK
>    if test "$JDK_SUITABLE" = "no"; then
>      AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK.
> @@ -1802,21 +1824,6 @@
>  AC_SUBST(JAVAHL_OBJDIR)
>  AC_SUBST(FIX_JAVAHL_LIB)
>  AC_SUBST(LT_CXX_LIBADD)
> -
> -AC_ARG_WITH(junit,
> -AS_HELP_STRING([--with-junit=PATH],
> -               [Specify a path to the junit JAR file.]),
> -[
> -    if test "$withval" != "no"; then
> -      if test -n "$JAVA_CLASSPATH"; then
> -        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
> -      else
> -        JAVA_CLASSPATH="$withval"
> -      fi
> -      JAVAHL_TESTS_TARGET="javahl-tests"
> -      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
> -    fi
> -])
>  AC_SUBST(JAVA_CLASSPATH)
>  AC_SUBST(JAVAHL_TESTS_TARGET)
>  AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
> ]]]
>
>
>
 Out of curiosity, why do $do_javahl_build and others follow another
pattern?

Thanks,
Daniel

Re: JavaHL jar file containing class files for unit tests

Posted by Branko Čibej <br...@apache.org>.
On 2. 8. 2026 15:07, Daniel Sahlberg wrote:
> Den ons 29 juli 2026 kl 12:52 skrev Branko Čibej <br...@apache.org>:
>
>     On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>>
>>
>>     Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:
>>
>>         On 2026/07/28 23:58, Daniel Sahlberg wrote:
>>         > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae
>>         <jun66j5@gmail.com <ma...@gmail.com>>:
>>         >
>>         >     > 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=/dev/shm/svn/trunk --without-apxs
>>         --without-swig --without-swig-{perl,python,ruby}
>>         --enable-javahl --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64
>>         --without-junit PYTHON=/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    #==> 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/subversion/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/subversion/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?
>
>
>     The following makes sense:
>
>     1. There is no regression in autotools. It is what it is. Note
>     that putting test classes in a separate jar has wider consequences
>     than just the ABI. For example, JavaHL tests would fail in
>     autotools builds. We'd have to change the way the classpath is
>     constructed in `make check-*-javahl`.
>
>     2. No change is needed in 1.15.x. Autotools are consistent with
>     earlier releases and CMake doesn't build JavaHL. IFF we want to
>     change this in CMake for 1.15, then we have further questions to
>     consider:
>
>         2.1. CMake and Autotools/vcxproj should produce identical
>         results given identical options. In this case specifically I
>         mean that the CMake build should create the same lib/dll names
>         and the same JavaHL jar (singular) as the vcxproj generator.
>
>
>     3. Regardless of the answer to 2: If we decide to not include test
>     classes in svn-javhl.jar, then we have to consider how to mitigate
>     the ABI change.
>
>     Personally I'd prefer changing the build requirements to changing
>     the ABI in svn-javahl.jar. That means that --enable-javahl implies
>     that JUnit is mandatory.
>
>     -- Brane
>
>
> Is the patch below an acceptable way of requiring --with-junit?
>
> Cheers,
> Daniel
>
>
>  [[[
> Index: configure.ac <http://configure.ac>
> ===================================================================
> --- configure.ac <http://configure.ac>        (revision 1936330)
> +++ configure.ac <http://configure.ac>        (working copy)
> @@ -1748,6 +1748,7 @@
>
>  dnl Possibly compile JavaHL
>  do_javahl_build=no
> +has_junit=no

This initialisation is not needed.

>  AC_ARG_ENABLE(javahl,
>    AS_HELP_STRING([--enable-javahl],
>               [Enable compilation of Java high-level bindings 
> (requires C++)]),
> @@ -1755,6 +1756,21 @@
>          do_javahl_build="yes"
>      fi
>    ])
> +AC_ARG_WITH(junit,
> +AS_HELP_STRING([--with-junit=PATH],
> +               [Specify a path to the junit JAR file.]),
> +[
> +    if test "$withval" != "no"; then
> +      if test -n "$JAVA_CLASSPATH"; then
> +        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
> +      else
> +        JAVA_CLASSPATH="$withval"
> +      fi
> +      JAVAHL_TESTS_TARGET="javahl-tests"
> +      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
> +      has_junit="yes"
>
> Should be;
>    have_junit="yes"
>
> +    fi
> +])
>
>  JAVAHL_OBJDIR=""
>  INSTALL_EXTRA_JAVAHL_LIB=""
> @@ -1763,6 +1779,12 @@
>  JAVAHL_COMPAT_TESTS_TARGET=""
>  LT_CXX_LIBADD=""
>  if test "$do_javahl_build" = "yes"; then
> +  dnl Since r1933892 junit is required to build the JavaHL bindings
> +  if test "$has_junit" = "no"; then

And here:

   if test "$have_junit" != "yes"; then


The idea is to set the have_junit variable exactly once. If it's not 
set, "$have_junit" will be an empty string.

> +  AC_MSG_ERROR([--with-junit must be specified if building the Java 
> high-level
> +                  bindings.])
> +  fi
> +
>    dnl Check for suitable JDK
>    if test "$JDK_SUITABLE" = "no"; then
>      AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK.
> @@ -1802,21 +1824,6 @@
>  AC_SUBST(JAVAHL_OBJDIR)
>  AC_SUBST(FIX_JAVAHL_LIB)
>  AC_SUBST(LT_CXX_LIBADD)
> -
> -AC_ARG_WITH(junit,
> -AS_HELP_STRING([--with-junit=PATH],
> -               [Specify a path to the junit JAR file.]),
> -[
> -    if test "$withval" != "no"; then
> -      if test -n "$JAVA_CLASSPATH"; then
> -        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
> -      else
> -        JAVA_CLASSPATH="$withval"
> -      fi
> -      JAVAHL_TESTS_TARGET="javahl-tests"
> -      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
> -    fi
> -])
>  AC_SUBST(JAVA_CLASSPATH)
>  AC_SUBST(JAVAHL_TESTS_TARGET)
>  AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
> ]]]
>

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den mån 10 aug. 2026 kl 16:10 skrev Evgeny Kotkov via dev <
dev@subversion.apache.org>:

> Daniel Sahlberg <da...@gmail.com> writes:
>
> > Any chance someone could review this? I think this could help unblock the
> > 1.15.0 release.
>
> Thanks for working on this!
>
> One thing I'd like to note: making --with-junit required when building with
> --enable-javahl would break existing ./configure invocations for packagers,
> such as the one used by Arch Linux [1].
>
> So, just wanted to make sure this is not a surprise.
>

Yes - that is a "known issue". As I wrote previously, I think we need to
point this out clearly in the release notes.

Whichever way we decided to do, this would hit the package maintainers and
end users.
- Now those who don't already build with junit (Arch, FreeBSD to mention
two) have to change.'
- Otherwise, if we broke out the test classes to a separate jar, packagers
(Debian, Fedora to mention two) might have to change their install recipe
(to install a new jar) and users (who relied on the test classes being part
of the JAR) would have to change their CLASSPATH.

Cheers,
Daniel



>
> [1]:
> https://gitlab.archlinux.org/archlinux/packaging/packages/subversion/-/blob/main/PKGBUILD?ref_type=heads#L95
>
>
> Thanks,
> Evgeny Kotkov
>

Re: JavaHL jar file containing class files for unit tests

Posted by Evgeny Kotkov via dev <de...@subversion.apache.org>.
Daniel Sahlberg <da...@gmail.com> writes:

> Any chance someone could review this? I think this could help unblock the
> 1.15.0 release.

Thanks for working on this!

One thing I'd like to note: making --with-junit required when building with
--enable-javahl would break existing ./configure invocations for packagers,
such as the one used by Arch Linux [1].

So, just wanted to make sure this is not a surprise.

[1]: https://gitlab.archlinux.org/archlinux/packaging/packages/subversion/-/blob/main/PKGBUILD?ref_type=heads#L95


Thanks,
Evgeny Kotkov

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Any chance someone could review this? I think this could help unblock the
1.15.0 release.

Thanks,
Daniel


Den sön 2 aug. 2026 kl 15:07 skrev Daniel Sahlberg <
daniel.l.sahlberg@gmail.com>:

> Den ons 29 juli 2026 kl 12:52 skrev Branko Čibej <br...@apache.org>:
>
>> On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>>
>>
>>
>> Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:
>>
>>> On 2026/07/28 23:58, Daniel Sahlberg wrote:
>>> > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com
>>> <ma...@gmail.com>>:
>>> >
>>> >     > 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=/dev/shm/svn/trunk --without-apxs --without-swig
>>> --without-swig-{perl,python,ruby} --enable-javahl
>>> --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
>>> PYTHON=/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    #==> 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/subversion/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/subversion/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?
>>
>>
>>
>> The following makes sense:
>>
>> 1. There is no regression in autotools. It is what it is. Note that
>> putting test classes in a separate jar has wider consequences than just the
>> ABI. For example, JavaHL tests would fail in autotools builds. We'd have to
>> change the way the classpath is constructed in `make check-*-javahl`.
>>
>> 2. No change is needed in 1.15.x. Autotools are consistent with earlier
>> releases and CMake doesn't build JavaHL. IFF we want to change this in
>> CMake for 1.15, then we have further questions to consider:
>>
>> 2.1. CMake and Autotools/vcxproj should produce identical results given
>> identical options. In this case specifically I mean that the CMake build
>> should create the same lib/dll names and the same JavaHL jar (singular) as
>> the vcxproj generator.
>>
>>
>> 3. Regardless of the answer to 2: If we decide to not include test
>> classes in svn-javhl.jar, then we have to consider how to mitigate the ABI
>> change.
>>
>> Personally I'd prefer changing the build requirements to changing the ABI
>> in svn-javahl.jar. That means that --enable-javahl implies that JUnit is
>> mandatory.
>>
>> -- Brane
>>
>>
> Is the patch below an acceptable way of requiring --with-junit?
>
> Cheers,
> Daniel
>
>
>  [[[
> Index: configure.ac
> ===================================================================
> --- configure.ac        (revision 1936330)
> +++ configure.ac        (working copy)
> @@ -1748,6 +1748,7 @@
>
>  dnl Possibly compile JavaHL
>  do_javahl_build=no
> +has_junit=no
>  AC_ARG_ENABLE(javahl,
>    AS_HELP_STRING([--enable-javahl],
>               [Enable compilation of Java high-level bindings (requires
> C++)]),
> @@ -1755,6 +1756,21 @@
>          do_javahl_build="yes"
>      fi
>    ])
> +AC_ARG_WITH(junit,
> +AS_HELP_STRING([--with-junit=PATH],
> +               [Specify a path to the junit JAR file.]),
> +[
> +    if test "$withval" != "no"; then
> +      if test -n "$JAVA_CLASSPATH"; then
> +        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
> +      else
> +        JAVA_CLASSPATH="$withval"
> +      fi
> +      JAVAHL_TESTS_TARGET="javahl-tests"
> +      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
> +      has_junit="yes"
> +    fi
> +])
>
>  JAVAHL_OBJDIR=""
>  INSTALL_EXTRA_JAVAHL_LIB=""
> @@ -1763,6 +1779,12 @@
>  JAVAHL_COMPAT_TESTS_TARGET=""
>  LT_CXX_LIBADD=""
>  if test "$do_javahl_build" = "yes"; then
> +  dnl Since r1933892 junit is required to build the JavaHL bindings
> +  if test "$has_junit" = "no"; then
> +    AC_MSG_ERROR([--with-junit must be specified if building the Java
> high-level
> +                  bindings.])
> +  fi
> +
>    dnl Check for suitable JDK
>    if test "$JDK_SUITABLE" = "no"; then
>      AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK.
> @@ -1802,21 +1824,6 @@
>  AC_SUBST(JAVAHL_OBJDIR)
>  AC_SUBST(FIX_JAVAHL_LIB)
>  AC_SUBST(LT_CXX_LIBADD)
> -
> -AC_ARG_WITH(junit,
> -AS_HELP_STRING([--with-junit=PATH],
> -               [Specify a path to the junit JAR file.]),
> -[
> -    if test "$withval" != "no"; then
> -      if test -n "$JAVA_CLASSPATH"; then
> -        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
> -      else
> -        JAVA_CLASSPATH="$withval"
> -      fi
> -      JAVAHL_TESTS_TARGET="javahl-tests"
> -      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
> -    fi
> -])
>  AC_SUBST(JAVA_CLASSPATH)
>  AC_SUBST(JAVAHL_TESTS_TARGET)
>  AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
> ]]]
>
>

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den ons 29 juli 2026 kl 12:52 skrev Branko Čibej <br...@apache.org>:

> On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>
>
>
> Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:
>
>> On 2026/07/28 23:58, Daniel Sahlberg wrote:
>> > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com
>> <ma...@gmail.com>>:
>> >
>> >     > 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=/dev/shm/svn/trunk --without-apxs --without-swig
>> --without-swig-{perl,python,ruby} --enable-javahl
>> --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
>> PYTHON=/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    #==> 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/subversion/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/subversion/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?
>
>
>
> The following makes sense:
>
> 1. There is no regression in autotools. It is what it is. Note that
> putting test classes in a separate jar has wider consequences than just the
> ABI. For example, JavaHL tests would fail in autotools builds. We'd have to
> change the way the classpath is constructed in `make check-*-javahl`.
>
> 2. No change is needed in 1.15.x. Autotools are consistent with earlier
> releases and CMake doesn't build JavaHL. IFF we want to change this in
> CMake for 1.15, then we have further questions to consider:
>
> 2.1. CMake and Autotools/vcxproj should produce identical results given
> identical options. In this case specifically I mean that the CMake build
> should create the same lib/dll names and the same JavaHL jar (singular) as
> the vcxproj generator.
>
>
> 3. Regardless of the answer to 2: If we decide to not include test classes
> in svn-javhl.jar, then we have to consider how to mitigate the ABI change.
>
> Personally I'd prefer changing the build requirements to changing the ABI
> in svn-javahl.jar. That means that --enable-javahl implies that JUnit is
> mandatory.
>
> -- Brane
>
>
Is the patch below an acceptable way of requiring --with-junit?

Cheers,
Daniel


 [[[
Index: configure.ac
===================================================================
--- configure.ac        (revision 1936330)
+++ configure.ac        (working copy)
@@ -1748,6 +1748,7 @@

 dnl Possibly compile JavaHL
 do_javahl_build=no
+has_junit=no
 AC_ARG_ENABLE(javahl,
   AS_HELP_STRING([--enable-javahl],
              [Enable compilation of Java high-level bindings (requires
C++)]),
@@ -1755,6 +1756,21 @@
         do_javahl_build="yes"
     fi
   ])
+AC_ARG_WITH(junit,
+AS_HELP_STRING([--with-junit=PATH],
+               [Specify a path to the junit JAR file.]),
+[
+    if test "$withval" != "no"; then
+      if test -n "$JAVA_CLASSPATH"; then
+        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
+      else
+        JAVA_CLASSPATH="$withval"
+      fi
+      JAVAHL_TESTS_TARGET="javahl-tests"
+      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
+      has_junit="yes"
+    fi
+])

 JAVAHL_OBJDIR=""
 INSTALL_EXTRA_JAVAHL_LIB=""
@@ -1763,6 +1779,12 @@
 JAVAHL_COMPAT_TESTS_TARGET=""
 LT_CXX_LIBADD=""
 if test "$do_javahl_build" = "yes"; then
+  dnl Since r1933892 junit is required to build the JavaHL bindings
+  if test "$has_junit" = "no"; then
+    AC_MSG_ERROR([--with-junit must be specified if building the Java
high-level
+                  bindings.])
+  fi
+
   dnl Check for suitable JDK
   if test "$JDK_SUITABLE" = "no"; then
     AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK.
@@ -1802,21 +1824,6 @@
 AC_SUBST(JAVAHL_OBJDIR)
 AC_SUBST(FIX_JAVAHL_LIB)
 AC_SUBST(LT_CXX_LIBADD)
-
-AC_ARG_WITH(junit,
-AS_HELP_STRING([--with-junit=PATH],
-               [Specify a path to the junit JAR file.]),
-[
-    if test "$withval" != "no"; then
-      if test -n "$JAVA_CLASSPATH"; then
-        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
-      else
-        JAVA_CLASSPATH="$withval"
-      fi
-      JAVAHL_TESTS_TARGET="javahl-tests"
-      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
-    fi
-])
 AC_SUBST(JAVA_CLASSPATH)
 AC_SUBST(JAVAHL_TESTS_TARGET)
 AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
]]]

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den ons 29 juli 2026 kl 12:52 skrev Branko Čibej <br...@apache.org>:

> On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>
>
>
> Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:
>
>> On 2026/07/28 23:58, Daniel Sahlberg wrote:
>> > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com
>> <ma...@gmail.com>>:
>> >
>> >     > 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=/dev/shm/svn/trunk --without-apxs --without-swig
>> --without-swig-{perl,python,ruby} --enable-javahl
>> --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
>> PYTHON=/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    #==> 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/subversion/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/subversion/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?
>
>
>
> The following makes sense:
>
> 1. There is no regression in autotools. It is what it is. Note that
> putting test classes in a separate jar has wider consequences than just the
> ABI. For example, JavaHL tests would fail in autotools builds. We'd have to
> change the way the classpath is constructed in `make check-*-javahl`.
>

autotools (in 1.14) produce different results depending on if you use
--with-junit or without. Depending on how I read your arguments ("changing
the ABI" below), it could be an ABI violation/bug that we sometimes produce
a svn-javahl.jar without the test classes.


> 2. No change is needed in 1.15.x. Autotools are consistent with earlier
> releases and CMake doesn't build JavaHL. IFF we want to change this in
> CMake for 1.15, then we have further questions to consider:
>

Autotools currently fail when building when using options that were working
in 1.14. That for me is a regression.  Changing build requirements and
refusing to run configure is not a regression. More below.


>
> 2.1. CMake and Autotools/vcxproj should produce identical results given
> identical options. In this case specifically I mean that the CMake build
> should create the same lib/dll names and the same JavaHL jar (singular) as
> the vcxproj generator.
>
>
Agree that it should produce identical results given identical options.

>
> 3. Regardless of the answer to 2: If we decide to not include test classes
> in svn-javhl.jar, then we have to consider how to mitigate the ABI change.
>
> Personally I'd prefer changing the build requirements to changing the ABI
> in svn-javahl.jar. That means that --enable-javahl implies that JUnit is
> mandatory.
>

Good! That is exactly what we need to figure out.

Cheers,
Daniel

Re: JavaHL jar file containing class files for unit tests

Posted by Branko Čibej <br...@apache.org>.
On 29. 7. 2026 10:58, Daniel Sahlberg wrote:
>
>
> Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:
>
>     On 2026/07/28 23:58, Daniel Sahlberg wrote:
>     > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com
>     <ma...@gmail.com>>:
>     >
>     >     > 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=/dev/shm/svn/trunk --without-apxs
>     --without-swig --without-swig-{perl,python,ruby} --enable-javahl
>     --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
>     PYTHON=/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    #==> 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/subversion/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/subversion/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?


The following makes sense:

1. There is no regression in autotools. It is what it is. Note that 
putting test classes in a separate jar has wider consequences than just 
the ABI. For example, JavaHL tests would fail in autotools builds. We'd 
have to change the way the classpath is constructed in `make 
check-*-javahl`.

2. No change is needed in 1.15.x. Autotools are consistent with earlier 
releases and CMake doesn't build JavaHL. IFF we want to change this in 
CMake for 1.15, then we have further questions to consider:

    2.1. CMake and Autotools/vcxproj should produce identical results
    given identical options. In this case specifically I mean that the
    CMake build should create the same lib/dll names and the same JavaHL
    jar (singular) as the vcxproj generator.


3. Regardless of the answer to 2: If we decide to not include test 
classes in svn-javhl.jar, then we have to consider how to mitigate the 
ABI change.

Personally I'd prefer changing the build requirements to changing the 
ABI in svn-javahl.jar. That means that --enable-javahl implies that 
JUnit is mandatory.

-- Brane

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den ons 29 juli 2026 kl 04:32 skrev Jun Omae <ju...@gmail.com>:

> On 2026/07/28 23:58, Daniel Sahlberg wrote:
> > Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com <mailto:
> jun66j5@gmail.com>>:
> >
> >     > 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=/dev/shm/svn/trunk --without-apxs --without-swig
> --without-swig-{perl,python,ruby} --enable-javahl
> --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit
> PYTHON=/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    #==> 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/subversion/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/subversion/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

Re: JavaHL jar file containing class files for unit tests

Posted by Jun Omae <ju...@gmail.com>.
On 2026/07/28 23:58, Daniel Sahlberg wrote:
> Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <jun66j5@gmail.com <ma...@gmail.com>>:
> 
>     > 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=/dev/shm/svn/trunk --without-apxs --without-swig --without-swig-{perl,python,ruby} --enable-javahl --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 --without-junit PYTHON=/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    #==> 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/subversion/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/subversion/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
]]]


-- 
Jun Omae <ju...@gmail.com> (大前 潤)

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den mån 27 juli 2026 kl 00:09 skrev Jun Omae <ju...@gmail.com>:

>
>
> On Mon, Jul 27, 2026 at 12:30 AM Daniel Sahlberg <
> daniel.l.sahlberg@gmail.com> wrote:
>
>> Den sön 26 juli 2026 kl 12:06 skrev Jun Omae <ju...@gmail.com>:
>>
>>> On Sun, Jul 26, 2026 at 6:39 PM Branko Čibej <br...@apache.org> 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
>>> how 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 binaries
>>> 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=/path/to/junit-4.13.2.jar, I can run `make
>> 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/subversion/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 <ju...@gmail.com> Is there a problem if we include the test
>> classes?
>>
>> Cheers,
>> Daniel
>>
>>
>
> [[[
> $ svn co -q https://svn.apache.org/repos/asf/subversion/branches/1.14.x
> ./subversion-1.14.x
> $ svn cleanup --remove-{unversioned,ignored}
> $ cd ./subversion-1.14.x$ /bin/sh autogen.sh
> $ ./configure --prefix=/dev/shm/svn-javahl --without-apxs --without-swig \
> >   --enable-javahl --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 \
> >   --without-junit PYTHON=/usr/bin/python3
> $ make -j$(nproc) all
> $ make javahl
> $ make install
> $ make install-javahl
> $ unzip -l /dev/shm/svn-javahl/lib/svn-javahl/svn-javahl.jar | grep -F
> .class | wc -l
> 276
> $ unzip -l /dev/shm/svn-javahl/lib/svn-javahl/svn-javahl.jar | grep -F
> Test | wc -l
> 0
> ]]]
>
> > 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

Re: JavaHL jar file containing class files for unit tests

Posted by Jun Omae <ju...@gmail.com>.
On Mon, Jul 27, 2026 at 12:30 AM Daniel Sahlberg <
daniel.l.sahlberg@gmail.com> wrote:

> Den sön 26 juli 2026 kl 12:06 skrev Jun Omae <ju...@gmail.com>:
>
>> On Sun, Jul 26, 2026 at 6:39 PM Branko Čibej <br...@apache.org> 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
>> how 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 binaries
>> 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=/path/to/junit-4.13.2.jar, I can run `make
> 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/subversion/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 <ju...@gmail.com> Is there a problem if we include the test
> classes?
>
> Cheers,
> Daniel
>
>

[[[
$ svn co -q https://svn.apache.org/repos/asf/subversion/branches/1.14.x
./subversion-1.14.x
$ svn cleanup --remove-{unversioned,ignored}
$ cd ./subversion-1.14.x$ /bin/sh autogen.sh
$ ./configure --prefix=/dev/shm/svn-javahl --without-apxs --without-swig \
>   --enable-javahl --with-jdk=/usr/lib/jvm/java-11-openjdk-amd64 \
>   --without-junit PYTHON=/usr/bin/python3
$ make -j$(nproc) all
$ make javahl
$ make install
$ make install-javahl
$ unzip -l /dev/shm/svn-javahl/lib/svn-javahl/svn-javahl.jar | grep -F
.class | wc -l
276
$ unzip -l /dev/shm/svn-javahl/lib/svn-javahl/svn-javahl.jar | grep -F Test
| wc -l
0
]]]

> 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 {
]]]

--
Jun Omae <ju...@gmail.com> (大前 潤)

Re: JavaHL jar file containing class files for unit tests

Posted by Daniel Sahlberg <da...@gmail.com>.
Den sön 26 juli 2026 kl 12:06 skrev Jun Omae <ju...@gmail.com>:

> On Sun, Jul 26, 2026 at 6:39 PM Branko Čibej <br...@apache.org> 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 how
> 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 binaries
> 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=/path/to/junit-4.13.2.jar, I can run `make
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/subversion/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 <ju...@gmail.com> Is there a problem if we include the test
classes?

Cheers,
Daniel

Re: JavaHL jar file containing class files for unit tests

Posted by Jun Omae <ju...@gmail.com>.
On Sun, Jul 26, 2026 at 6:39 PM Branko Čibej <br...@apache.org> 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 how 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 binaries 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.


-- 
Jun Omae <ju...@gmail.com> (大前 潤)

Re: JavaHL jar file containing class files for unit tests

Posted by Branko Čibej <br...@apache.org>.
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 how 
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 
binaries to run JavaHL tests. In any case this is part of the published ABI.


> 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.


>
> E.g.
>
> $ cat /etc/lsb-release
> DISTRIB_ID=Ubuntu
> DISTRIB_RELEASE=26.04
> DISTRIB_CODENAME=resolute
> DISTRIB_DESCRIPTION="Ubuntu Resolute Raccoon (development branch)"
>
> $ apt install -y libsvn-java
>
> $ unzip -l /usr/share/java/svn-javahl.jar | grep RunTests
>       2013  2026-03-20 11:04   org/apache/subversion/javahl/RunTests$SVNTestSuite.class
>       1155  2026-03-20 11:04   org/apache/subversion/javahl/RunTests.class
>       1846  2026-03-20 11:04   org/tigris/subversion/javahl/RunTests$SVNTestSuite.class
>       1179  2026-03-20 11:04   org/tigris/subversion/javahl/RunTests.class
>
> $ unzip -l /usr/share/java/svn-javahl.jar | grep Test | wc -l
> 101
>