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

Add files via upload #3177

Closed
wants to merge 1 commit into from
Closed

Add files via upload #3177

wants to merge 1 commit into from

Conversation

202201638
Copy link

Pull Request Template

What does this PR do?

Copy link

github-actions bot commented Jan 13, 2025

PR Summary

This PR adds a Singleton class and its corresponding test file. The Singleton class demonstrates the singleton design pattern, ensuring only one instance of the class exists. The test file verifies the singleton implementation and its functionality.

Changes

File Summary
visitor/src/main/java/Singleton.java This file implements the Singleton design pattern. It includes a private constructor, a static method to get the instance, and a sample method showMessage. The class ensures only one instance is created.
visitor/src/test/java/com/iluwatar/visitor/SingletonTest.java This file contains a JUnit test case for the Singleton class. The test verifies that only one instance of the Singleton class is created and that the showMessage method functions correctly.
visitor/target/classes/Singleton.class New file.
visitor/target/classes/com/iluwatar/visitor/App.class New file.
visitor/target/classes/com/iluwatar/visitor/Commander.class New file.
visitor/target/classes/com/iluwatar/visitor/CommanderVisitor.class New file.
visitor/target/classes/com/iluwatar/visitor/Sergeant.class New file.
visitor/target/classes/com/iluwatar/visitor/SergeantVisitor.class New file.
visitor/target/classes/com/iluwatar/visitor/Soldier.class New file.
visitor/target/classes/com/iluwatar/visitor/SoldierVisitor.class New file.
visitor/target/classes/com/iluwatar/visitor/Unit.class New file.
visitor/target/classes/com/iluwatar/visitor/UnitVisitor.class New file.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
Files Processed (12)
  • visitor/src/main/java/Singleton.java (1 hunk)
  • visitor/src/test/java/com/iluwatar/visitor/SingletonTest.java (1 hunk)
  • visitor/target/classes/Singleton.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/App.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/Commander.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/CommanderVisitor.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/Sergeant.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/SergeantVisitor.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/Soldier.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/SoldierVisitor.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/Unit.class (0 hunks)
  • visitor/target/classes/com/iluwatar/visitor/UnitVisitor.class (0 hunks)
Actionable Comments (1)
  • visitor/src/test/java/com/iluwatar/visitor/SingletonTest.java [21-23]

    bug: "Incorrect assertion method used."

Skipped Comments (0)

Comment on lines +21 to +23
private void assertSame(Singleton instance1, Singleton instance2, String s) {
}
}

Choose a reason for hiding this comment

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

The assertSame method in SingletonTest is not a standard JUnit assertion. Replace it with assertEquals or assertSame from JUnit's assertion library.

@iluwatar iluwatar added the resolution: invalid Invalid or Marked as Spam label Jan 14, 2025
@iluwatar iluwatar closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: invalid Invalid or Marked as Spam
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants