Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for tika jar file, updated accompanying test #18

Merged
merged 3 commits into from
Mar 25, 2020
Merged

Added check for tika jar file, updated accompanying test #18

merged 3 commits into from
Mar 25, 2020

Conversation

bitcoin-coder-bob
Copy link
Contributor

@bitcoin-coder-bob bitcoin-coder-bob commented Mar 25, 2020

Per this issue: #17

Fixes the silent missing jar file error. Added accompanying test.

Copy link
Member

@tbpg tbpg left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines +116 to +119
s.jar = "nonexistentFile.jar"
if err := s.Start(ctx); err == nil {
t.Fatalf("s.Start got no error, want error for missing Jar file")
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add this to TestStartError (which may need to be updated to point to real files).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in TestStartError. I am unsure of what your are asking.

Copy link
Member

Choose a reason for hiding this comment

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

Ah. You're totally right, my bad.

tika/server.go Outdated
if _, err := os.Stat(s.jar); os.IsNotExist(err) {
return err
}
cmd := command("java", append([]string{"-jar", s.jar, "-p", s.port}, s.child.args()...)...)
Copy link
Member

Choose a reason for hiding this comment

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

Delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woops. Repushed.

Comment on lines +131 to +133
if _, err := os.Stat(s.jar); os.IsNotExist(err) {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we do this in NewServer? Could see doing it in either function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, could be in either. Pathing of where things are called from could come into play, which is why I put it here and not in NewServer.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me.

@bitcoin-coder-bob bitcoin-coder-bob changed the title Added check for tike jar file, updated accompanying test, go fmt Added check for tika jar file, updated accompanying test Mar 25, 2020
Added an additional line by accident. Removed it here.
Copy link
Member

@tbpg tbpg left a comment

Choose a reason for hiding this comment

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

Thanks!

@tbpg tbpg merged commit 5c2b106 into google:master Mar 25, 2020
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.

3 participants