Skip to content

Simplify some test code by using method TikaTest#getResourceAsUrl and TikaTest#getResourceAsUri#385

Merged
kkrugler merged 3 commits intoapache:mainfrom
PeterAlfredLee:simplify_getResource
Nov 18, 2020
Merged

Simplify some test code by using method TikaTest#getResourceAsUrl and TikaTest#getResourceAsUri#385
kkrugler merged 3 commits intoapache:mainfrom
PeterAlfredLee:simplify_getResource

Conversation

@PeterAlfredLee
Copy link
Copy Markdown
Member

@PeterAlfredLee PeterAlfredLee commented Nov 17, 2020

  1. Add method getResourceAsUrl to TikaTest
  2. Add method getResourceAsUri to TikaTest
  3. Simplify some test code by using method TikaTest#getResourceAsUrl and TikaTest#getResourceAsUri

* @param name name of the desired resource
* @return A {@link java.net.URL} object or null
*/
public URL getResource(String name) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A more descriptive name - like getResourceAsUrl() - would help when reading the code. Wondering if a getResourceAsUri() should also be added.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure. Will update change.

@PeterAlfredLee PeterAlfredLee changed the title Simplify some test code by using method TikaTest#getResource Simplify some test code by using method TikaTest#getResourceAsUrl and TikaTest#getResourceAsUri Nov 18, 2020
Copy link
Copy Markdown
Contributor

@kkrugler kkrugler left a comment

Choose a reason for hiding this comment

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

lgtm!

@kkrugler kkrugler merged commit 49bd7d5 into apache:main Nov 18, 2020
@PeterAlfredLee PeterAlfredLee deleted the simplify_getResource branch November 19, 2020 01:29
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.

2 participants