Skip to content

Conversation

@YizhangCao
Copy link
Contributor

Refs JabRef#676

This PR parameterizes tests in AuthorTest and AuthorListTest to reduce code duplication and improve test maintainability.

My classmates are also contributing to the same issue.

@espertusnu

Testing

   ./gradlew test --tests AuthorTest
   ./gradlew test --tests AuthorListTest

@calixtus
Copy link
Member

There seems to be something wrong with either github or your local configuration:
grafik

Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binaries

@Siedlerchr Siedlerchr closed this Oct 23, 2025
@espertusnu
Copy link
Contributor

@YizhangCao seems to have saved the files with the wrong encoding.

@Siedlerchr I see you closed the PR. Should he not fix this?

@calixtus
Copy link
Member

calixtus commented Oct 24, 2025

We got a few low-quality and ai generated prs the last days. Looks like @Siedlerchr overlooked that this pr was from one of the students of your course, when he closed it. Sorry.

Yes, please have the student update the branch with files in the correct encoding.

@calixtus calixtus reopened this Oct 24, 2025
@YizhangCao
Copy link
Contributor Author

Thank you @calixtus and @espertusnu for catching this encoding issue! I apologize for the problem.

I've now fixed the file encoding to UTF-8. The issue occurred because I used PowerShell's redirection operator which saved the files as UTF-16 instead of UTF-8.

After pushing I saw all tests are passed, right now I will fix [Source Code Tests / Checkstyle (pull_request)] and [Source Code Tests / Unit tests – jablib (pull_request)

Comment on lines 27 to 33
@CsvSource({
"'A O', 'A. O.'",
"'A-melia', 'A.-melia'",
"'AmeliA', 'AmeliA'",
"'Ameli A', 'Ameli A.'",
"'Ameli ', 'Ameli'",
"'Ameli AA', 'Ameli A. A.'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refactor using the knowledge provided at https://devdocs.jabref.org/code-howtos/testing.html#use-paramterizedtests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @koppor and @calixtus for the review!

I've made the following fixes:

  1. Fixed all EMPTY_AUTHOR test cases in AuthorListTest.java to expect empty string ('') instead of null
  2. Reformatted all @CsvSource annotations in AuthorTest.java to have one test case per line for better readability, following the guidelines at https://devdocs.jabref.org/code-howtos/testing.html#use-paramterizedtests

@koppor koppor added the status: changes-required Pull requests that are not yet complete label Oct 31, 2025
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-read the docs.

Use TEXT BLOCKS

Image

"MIXED_AUTHOR_AND_INSTITUTION_WITH_LATEX|The Banū Mūsā brothers and Böhm",
// LaTeX-free one institution with parenthesis at start
"ONE_INSTITUTION_WITH_STARTING_PARANTHESIS|Łukasz Michał"
}, delimiter = '|')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| is very unusal as delimiter - If you see it as Markdown table, please align the columns

Is ; available? (which is common).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @koppor! I've updated all parameterized tests to use TEXT BLOCKS with delimiterString = "->" and aligned the columns for better readability as shown in the documentation. The tests now use # for comments and have properly aligned delimiters.

@Siedlerchr
Copy link
Member

@YizhangCao It would be great if you could to the required changes asap. We want to reduce the number of open PRs

@YizhangCao
Copy link
Contributor Author

Thanks for notice! I will do it as soon as possible!

@koppor
Copy link
Member

koppor commented Nov 13, 2025

Thanks for notice! I will do it as soon as possible!

Thank you - and also please follow-up the automatic CI checks soon.

@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Nov 13, 2025
assertEquals("A. O.", Author.addDotIfAbbreviation("A.O."));
assertEquals("A.-O.", Author.addDotIfAbbreviation("A-O"));
@ParameterizedTest
@CsvSource({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why there is no text block?

@koppor koppor enabled auto-merge November 14, 2025 13:19
@koppor
Copy link
Member

koppor commented Nov 14, 2025

I got impatient and fixed for myself.

@YizhangCao adapted only one class (and did not update AuthorTest). Moreover not all tests have been updated.

@koppor koppor disabled auto-merge November 14, 2025 13:20
@koppor koppor enabled auto-merge November 14, 2025 13:23
@koppor
Copy link
Member

koppor commented Nov 14, 2025

Here the diff, what I updated: 23441b4...70c25e0 (there is one more minor thing, but that cannot be shown nicely, because I merged main into this.

@koppor koppor dismissed calixtus’s stale review November 15, 2025 00:50

We moved forward

@koppor koppor added this pull request to the merge queue Nov 15, 2025
Merged via the queue into JabRef:main with commit c45f9be Nov 15, 2025
48 checks passed
Siedlerchr added a commit that referenced this pull request Nov 15, 2025
…ersions/org.glassfish.jersey.core-jersey-server-4.0.0

* upstream/main: (31 commits)
  Adds a 'regenerate' button to AI chat tab (#12191) (#14191)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (#14323)
  Update dependency com.konghq:unirest-modules-gson to v4.6.0 (#14322)
  Convert fixed-value ComboBoxes to SearchableComboBox (#14083) (#14165)
  Add support for transliterated citation keys (#13893)
  Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.5.0 (#14321)
  Add link to latest development version (#14320)
  Parameterize tests in AuthorTest and AuthorListTest (#14135)
  Add AGENTS.md and AI_USAGE_POLICY.md from p5.js (#14316)
  Fix Nullwarnings - A (#14116)
  Update io.github.darvil82:terminal-text-formatter from 2.2.0 to 2.3.0c (#14317)
  Streamline maven repositories (#14315)
  Fix paths to included Java sources
  Add forgotten ..
  Update dependency io.github.darvil82:terminal-text-formatter to v2.3.0c (#14314)
  Chore(deps): Bump io.github.classgraph:classgraph from 4.8.181 to 4.8.184 in /versions (#14304)
  Chore(deps): Bump com.fasterxml:aalto-xml in /versions (#14311)
  Chore(deps): Bump commons-io:commons-io in /versions (#14310)
  Chore(deps): Bump org.apache.maven.plugins:maven-surefire-plugin (#14298)
  Disable fetcher-gui-test (#14308)
  ...
merlinymy pushed a commit to merlinymy/jabref that referenced this pull request Nov 19, 2025
* Parameterize tests in AuthorTest and AuthorListTest (issue JabRef#676)

* Fix file encoding to UTF-8

* Fix EMPTY_AUTHOR test expectations and format CsvSource annotations

* Use TEXT BLOCKS with -> delimiter for parameterized tests

* Use CsvSource and TextBlock in AuthorTest

* Use TextBlock

* Reformat source

* Use ";" instead of "->"

* More text blocks

* Convert to text block

* Covnert one more

* Use "," where possible

* Use Markdown JavaDoc

---------

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants