Skip to content

Conversation

@kaklakariada
Copy link
Contributor

@kaklakariada kaklakariada commented Jan 19, 2025

Closes #345.

@kaklakariada kaklakariada changed the title #345: Add Jar Launcher #345: Replace ExitGuard in integration tests Jan 19, 2025

import com.exasol.mavenprojectversiongetter.MavenProjectVersionGetter;

class JarLauncher
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this class deserves a bit of documentation in the header. :-)

{
return runnable -> {
final Thread thread = new Thread(runnable);
thread.setName(ProcessOutputConsumer.class.getSimpleName());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it make more sense to name the thread after the process being consumed? Or at least to get that processes identification into the name? Thread names are mainly a debugging means as far as I remember.

return builder.toString();
}

void streamFinished()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming an attribute and a method the same is a recipe for confusion.
Please rename the method. Use an imperative. :-)


private static class ProcessStreamConsumer
{
private final CountDownLatch streamFinished = new CountDownLatch(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
private final CountDownLatch streamFinished = new CountDownLatch(1);
private final CountDownLatch streamFinishedLatch = new CountDownLatch(1);


void accept(final String line)
{
LOG.fine("%s > %s".formatted(name, line));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consuming without logging might be a good option, since we are in tests here and don't want to flood the test log.

@kaklakariada kaklakariada marked this pull request as ready for review November 9, 2025 20:20
@kaklakariada
Copy link
Contributor Author

@redcatbear I implemented your findings. Please check again.
Some code with findings was extracted a separate project. I will fix your findings there.

@sonarqubecloud
Copy link

@kaklakariada kaklakariada merged commit 9aeed9c into main Dec 6, 2025
11 checks passed
@kaklakariada kaklakariada deleted the kaklakariada/issue345 branch December 6, 2025 14:06
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.

Replace tests using security manager

3 participants