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

Logging and testing #38

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ArtemGonchar0v
Copy link

No description provided.

throw new IllegalArgumentException("Horses cannot be empty.");
}

this.horses = horses;
LOGGER.debug("створення Hippodrome, коней [" + horses.size() + "]");

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

Copy link
Author

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

I understand, but I was sticking to the task
image

throw new IllegalArgumentException("Distance cannot be negative.");
}

this.name = name;
this.speed = speed;
this.distance = distance;

LOGGER.debug("створення Horse, ім'я [" + name + "], " + "швидкість [" + speed + "]");

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

Copy link
Author

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

I understand, but I was sticking to the task
image

@@ -15,6 +20,8 @@ public static void main(String[] args) throws Exception {
);
Hippodrome hippodrome = new Hippodrome(horses);

LOGGER.info("Початок стрибків. Кількість учасників " + horses.size());

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

Copy link
Author

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

I understand, but I was sticking to the task
image

@@ -23,6 +30,8 @@ public static void main(String[] args) throws Exception {

String winnerName = hippodrome.getWinner().getName();
System.out.println(winnerName + " wins!");

LOGGER.info("Закінчення стрибків. Переможець: " + winnerName);

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

Copy link
Author

Choose a reason for hiding this comment

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

don't commit logs with debug level, also this message is not informative, delete this log

I understand, but I was sticking to the task
image

@@ -23,6 +30,8 @@ public static void main(String[] args) throws Exception {

String winnerName = hippodrome.getWinner().getName();
System.out.println(winnerName + " wins!");

Choose a reason for hiding this comment

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

don't use System.out.println, if u need print some info, use LOG.info()

Copy link
Author

Choose a reason for hiding this comment

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

don't use System.out.println, if u need print some info, use LOG.info()

Ok, but i`m fork this code, It's not my job

import static org.mockito.Mockito.verify;

public class HippodromeTest {
private final List<Horse> horses = new ArrayList<>(Arrays.asList(

Choose a reason for hiding this comment

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

why do u create list in this style new ArrayList<List.of()) just us List.of it will return list of Hourses, or u can make it simplier, create a method private List prepareHourses() {
List hourses = new ArrayList();

for(int i = 0; i<30; i++) {
hourses.add(new Hourse("hourse" + i; 10,100);
}
return hourses;
}

}

@Test
void getNameTest() {

Choose a reason for hiding this comment

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

what a sense of this test?

Copy link
Author

Choose a reason for hiding this comment

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

image
I stuck to the task

@Disabled
@Test
@Timeout(value = 22)
void testMainForTimeout() {

Choose a reason for hiding this comment

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

what a sense of test?

Copy link
Author

Choose a reason for hiding this comment

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

I stuck to the task
image

@ArtemGonchar0v ArtemGonchar0v requested a review from Volodymyr95 May 8, 2024 19:19
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