[
https://issues.apache.org/jira/browse/LUCENE-10485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17514609#comment-17514609
]
Tomoko Uchida commented on LUCENE-10485:
----------------------------------------
I'm playing around modularizing kuromoji's test (more precisely, I've been
trying to convert it into an "in-module test"
[https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html])
and attached a PoC patch [^hacky-poc-make-kuromoji-test-named-module.patch] .
It's just a hack to show what issues are there.
In summary, to make it work we should:
1. copy all main classes into the test module by `--patch-module`
2. copy all resources into the test module
3. copy all `AttributeImpl`s into the test module (they are not copied by
`--patch-module`; I guess this is because the attribute implementation classes
are not referred from anywhere but dynamically loaded)
4. output the test jar to a separate folder (it cannot reside in the same
folder as the main module - due to the split packages)
In addition, my IDE (IntelliJ IDEA) does not resolve dependencies in the main
module anymore once I added the module descriptor in "src/test". Practically we
can't live with it - maybe we'd need to dynamically generate `module-info.java`
(or it could be possible to directly assemble `module-info.class` ?).
> Limit o.a.l.a.morph package visibility only to kuromoji and nori
> ----------------------------------------------------------------
>
> Key: LUCENE-10485
> URL: https://issues.apache.org/jira/browse/LUCENE-10485
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Tomoko Uchida
> Priority: Minor
> Attachments: hacky-poc-make-kuromoji-test-named-module.patch
>
>
> LUCENE-10393 added a new package {{org.apache.lucene.analysis.morph}} to
> analysis-common that is supposed to be used by only analysis-kuromoji and
> analysis-nori modules. It would be better to reduce its visibility (on
> module-mode) by "export to" clause in the module descriptor.
> The major issue here may be unit tests. They also have to be converted to
> properly named modules otherwise they cannot access the {{o.a.l.a.morph}}
> package.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]