opravil-jan opened a new pull request, #119: URL: https://github.com/apache/directory-studio/pull/119
> **Depends on #116.** Without #116, surefire discovers none of the JUnit 5 tests. Until #116 is merged, its commit also shows up here. Only the `test(syncrepl)` commit belongs to this PR. The branch is independent of #117 and #118. This PR changes tests only; production code is untouched. It pins down the current behaviour of `plugins/openldap.syncrepl`, so that later fixes cannot silently change anything else. ### What is covered There are 4 new test classes with 63 tests: - **Getters, setters and `copy()`** for every option. - **`toString()`** for every option. - **Parsing** of all 35 keywords and their enum values, including invalid values. - **Round trips**, per option and with all options set together. | | lines | branches | |---|---|---| | `SyncRepl` | 18.2% → 98.8% | 3.3% → 95.7% | | `SyncReplParser` | 55.3% → 95.6% | 54.7% → 74.2% | | openldap.syncrepl | 45.1% → 91.6% | 38.2% → 81.9% | Coverage was measured with JaCoCo 0.8.15. Each new class was mutation-checked: I broke a targeted production line and confirmed that a test fails. ### Not cementing divergences from slapd Exact output strings are asserted only where Studio already writes what slapd itself writes, as checked in OpenLDAP master (`syncrepl_unparse()` in `syncrepl.c`, `bindconf_unparse()` and the `bindkey` table in `config.c`). For cn=config values, slapd quotes a fixed set of fields and escapes nothing, because `strtok_quote_ldif()` has no escape mechanism. Where Studio differs, the test asserts the slapd behaviour and is `@Disabled`. Every disabled test was enabled once and fails for the stated reason. **Suspected bugs (7):** - `exattrs=userPassword` is read as `attrs=userPassword`. Keywords are matched anywhere in the text, because the parser skips one character when nothing matches. The attribute meant to be *excluded* therefore becomes the *only* replicated attribute, and that is written back on save. - For the same reason, `xrid=5` is read as `rid=5`. - Options the parser does not know (e.g. `lazycommit`, `suffixmassage`, `tls_protocol_min`, `exattrs`) are silently dropped, so they disappear from the value when it is saved. - The cipher suite is read and written as `tls_ciphersuite=`, but slapd only knows `tls_cipher_suite=`. slapd rejects the value Studio writes, and the cipher suite of an existing consumer is lost. There are 2 tests, one for writing and one for reading. - `filter=` at the very end of the value throws `ArrayIndexOutOfBoundsException` (`SyncReplParser.java:1025`) instead of a parser error. - The "missing value" error always names option `rid`, whichever option it is. **Known divergences from slapd (5):** - `credentials` and the `tls_cert`/`tls_key`/`tls_cacert`/`tls_cacertdir` paths are written unquoted. - When reading, `\"` is treated as an escape, a quote that is not followed by whitespace closes the value, and `'...'` is accepted as quoting. **Fixed by #117 (1):** `tls_cacertdir` round trip. Two cases are deliberately left untested, with a comment in the test class: - A `"` inside a quoted value: no output string lets slapd read it back unchanged. - Keyword case: slapd matches keywords with `strncasecmp`. ### Verification `mvn clean install` (Maven 3.9.16, JDK 17): openldap.syncrepl ran 140 tests, of which 127 passed and 13 were skipped (the disabled tests above). `openldap.config.editor` passed all 34 of its tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
