aglinxinyuan opened a new pull request, #9211:
URL: https://github.com/apache/texera/pull/9211
### What changes were proposed in this PR?
In
`common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/keywordSearch/CaseSensitiveAnalyzerSpec.scala`:
1. Overload `tokensOf(analyzer: CaseSensitiveAnalyzer, fieldName: String,
input: String): List[String]` to encapsulate the Lucene `TokenStream` drain
lifecycle (`reset` -> `incrementToken` -> `end` -> `close`). The single-use
`tokensOf(fieldName, input)` delegates to this helper with a managed analyzer
instance.
2. Deduplicate the intra-analyzer stream reuse test by replacing its
duplicated 15-line `TokenStream` drain loop with calls to `tokensOf(analyzer,
"body", input)`.
3. Table-drive the 11 repetitive `assert(tokensOf("body", input) ==
expected)` tokenization test cases across case preservation, word boundary
splitting, whitespace collapsing, punctuation stripping, and empty/whitespace
inputs via a parameterized `tokenizationCases` sequence registered under
`behavior of "CaseSensitiveAnalyzer"`.
### Any related issues, documentation, discussions?
Closes #9210
### How was this PR tested?
Verified with sbt unit tests, metadata checks, and linters:
```bash
sbt "WorkflowOperator/testOnly
org.apache.texera.amber.operator.keywordSearch.CaseSensitiveAnalyzerSpec"
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.metadata.*"
sbt "WorkflowOperator/scalafmtCheck" "WorkflowOperator/Test/scalafmtCheck"
"WorkflowOperator/scalafix --check" "WorkflowOperator/Test/scalafix --check"
```
All 14 tests in `CaseSensitiveAnalyzerSpec` passed, all 229 operator
metadata tests passed, and all scalafmt / scalafix checks passed.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity (Gemini 2.5 Pro)
--
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]