Java 11 migrate all remaining s (#1120)
* Moves saga to Java 11 * Moves semaphore to Java 11 * Moves servant to Java 11 * Moves serverless to Java 11 * Moves service-layer to Java 11 * Moves service-locator to Java 11 * Moves sharding to Java 11 * Moves singleton to Java 11 * Moves spatial-partition to Java 11 * Moves specification to Java 11 * Moves state to Java 11 * Moves step-builder to Java 11 * Moves strategy to Java 11 * Moves subclass-sandbox to Java 11 * Fixes checkstyle issues
This commit is contained in:
committed by
Ilkka Seppälä
parent
310ae50248
commit
cd2a2e7711
@@ -25,15 +25,12 @@ package com.iluwatar.semaphore;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Application Test Entrypoint
|
||||
*/
|
||||
public class AppTest {
|
||||
@Test
|
||||
public void test() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
}
|
||||
|
@@ -23,12 +23,12 @@
|
||||
|
||||
package com.iluwatar.semaphore;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test taking from and putting Fruit into a FruitBowl
|
||||
*/
|
||||
@@ -36,16 +36,16 @@ public class FruitBowlTest {
|
||||
|
||||
@Test
|
||||
public void fruitBowlTest() {
|
||||
FruitBowl fbowl = new FruitBowl();
|
||||
|
||||
var fbowl = new FruitBowl();
|
||||
|
||||
assertEquals(0, fbowl.countFruit());
|
||||
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
|
||||
for (var i = 1; i <= 10; i++) {
|
||||
fbowl.put(new Fruit(Fruit.FruitType.LEMON));
|
||||
assertEquals(i, fbowl.countFruit());
|
||||
}
|
||||
|
||||
for (int i = 9; i >= 0; i--) {
|
||||
for (var i = 9; i >= 0; i--) {
|
||||
assertNotNull(fbowl.take());
|
||||
assertEquals(i, fbowl.countFruit());
|
||||
}
|
||||
|
@@ -23,11 +23,11 @@
|
||||
|
||||
package com.iluwatar.semaphore;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test case for acquiring and releasing a Semaphore
|
||||
*/
|
||||
@@ -35,11 +35,11 @@ public class SemaphoreTest {
|
||||
|
||||
@Test
|
||||
public void acquireReleaseTest() {
|
||||
Semaphore sphore = new Semaphore(3);
|
||||
var sphore = new Semaphore(3);
|
||||
|
||||
assertEquals(3, sphore.getAvailableLicenses());
|
||||
|
||||
for (int i = 2; i >= 0; i--) {
|
||||
for (var i = 2; i >= 0; i--) {
|
||||
try {
|
||||
sphore.acquire();
|
||||
assertEquals(i, sphore.getAvailableLicenses());
|
||||
@@ -47,8 +47,8 @@ public class SemaphoreTest {
|
||||
fail(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
sphore.release();
|
||||
assertEquals(i, sphore.getAvailableLicenses());
|
||||
}
|
||||
|
Reference in New Issue
Block a user