Skip to content

Java06. ДЗ 04, Мурычева Наталья#10

Open
natalymr wants to merge 1 commit intomasterfrom
sem2-pool
Open

Java06. ДЗ 04, Мурычева Наталья#10
natalymr wants to merge 1 commit intomasterfrom
sem2-pool

Conversation

@natalymr
Copy link
Owner

No description provided.

public void testIsReadyInOKCaseNotGet() {
LightFuture<String> result = pool.submit(() -> "test");

assertEquals(false, result.isReady());

Choose a reason for hiding this comment

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

assertFalse

result.get();
} catch (LightExecutionException | InterruptedException ignored) {}

assertEquals(true, result.isReady());

Choose a reason for hiding this comment

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

assertTrue

assertEquals("test then Function", result1.get());
assertEquals("test then Function then Function", result2.get());
}
} No newline at end of file

Choose a reason for hiding this comment

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

не тестируется, что таски, зависящие от тяжеловесной таски, не забивают пул, а попадают в него, когда ожидаемая ими задача выполнится

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