Skip to content

Commit 97ae51f

Browse files
committed
Record in the jdk1.4 build notes that no bctest include glob reaches a test living in the org.bouncycastle.tls package itself, that bctls does not take the matching contamination because its own copy excludes tests at any depth, and that a targeted include therefore buys a compile-floor check rather than a run, the package's AllTests being excluded from the staged sources.
1 parent aa46a75 commit 97ae51f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎docs/claude/build-jdk14.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,26 @@ include (e.g. `**/crypto/agreement/owl/*Test.java`) so it lands in `bctest` (whe
167167
same-package/same-classloader test keeps its package-private access to the class in `bcprov`).
168168
`org.bouncycastle.util.test.{SimpleTest,Test}` legitimately ship in `bcprov` and are not `junit`
169169
subclasses, so they are not the problem; only `*Test extends junit.framework.TestCase` is.
170+
171+
### `org.bouncycastle.tls`-package tests: a targeted include gets them compiled, not run
172+
173+
The same shallow-include problem applies to `bctls`, with a second twist that makes the miss silent
174+
in both directions. A test in the `org.bouncycastle.tls` package itself (rather than
175+
`org.bouncycastle.tls.test`) is reached by **no** bctest include — `**/test/*.java` and
176+
`**/test/*/*.java` cover the `.test` subpackage only — so it is dropped from the distribution
177+
entirely: never compiled by the real 1.4 javac, never run. `Add13CertificateStatusTest`,
178+
`AbstractTlsServerResetTest`, `CheckTlsFeaturesExtensionTest` and `DTLSReassemblerTest` all sit in
179+
that hole today; `SpreadCertificateStatusTest` was given a targeted include
180+
(`org/bouncycastle/tls/SpreadCertificateStatusTest.java`, next to the `owl` one) to get it at least
181+
compiled. The contamination half does *not* fire here — the `build-tls` copy in `bc+-build.xml`
182+
already carries `<exclude name="**/*Test.java"/>`, so unlike `bcprov` these never leak into the
183+
shipped `bctls` jar (`unzip -l bctls-jdk14-*.jar | grep -cE 'Test\.class'` should stay 0).
184+
185+
Adding the include compiles the class but does **not** run it: the `test` target's batchtest runs
186+
`**/AllTests.java` out of the staged bctest source tree, and `ant/jdk14.xml` (around line 283)
187+
excludes `**/tls/AllTests.java` — the only suite referencing these classes. So a targeted include is
188+
a *compile-floor* check, which is usually what you want from this build anyway. Making the package's
189+
tests actually execute means staging its `AllTests` too, which then needs every class it references
190+
included, none of which have been through 1.4 javac — a bigger change, not a one-liner. Note the
191+
`.test`-subpackage suite is unaffected and does run: `org/bouncycastle/tls/test/AllTests.java` is not
192+
excluded, so e.g. `Tls13CertificateStatusTest` is both compiled and executed.

0 commit comments

Comments
 (0)