Java 11 migrate remaining p (#1122)
* Moves partial-response to Java 11 * Moves pipeline to Java 11 * Moves poison-pill to Java 11 * Moves priority-queue to Java 11 * Moves private-class-data to Java 11 * Moves producer-consumer to Java 11 * Moves promise to Java 11 * Moves property to Java 11 * Moves prototype to Java 11 * Moves proxy to Java 11 * Corrects checkstyle errors * Fixes build for pipeline pattern
This commit is contained in:
committed by
Ilkka Seppälä
parent
1401accb4f
commit
428efc7d53
@ -46,13 +46,13 @@ public class App {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// stew is mutable
|
||||
Stew stew = new Stew(1, 2, 3, 4);
|
||||
var stew = new Stew(1, 2, 3, 4);
|
||||
stew.mix();
|
||||
stew.taste();
|
||||
stew.mix();
|
||||
|
||||
// immutable stew protected with Private Class Data pattern
|
||||
ImmutableStew immutableStew = new ImmutableStew(2, 4, 3, 6);
|
||||
var immutableStew = new ImmutableStew(2, 4, 3, 6);
|
||||
immutableStew.mix();
|
||||
}
|
||||
}
|
||||
|
@ -26,15 +26,12 @@ package com.iluwatar.privateclassdata;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* Application test
|
||||
*
|
||||
*/
|
||||
public class AppTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@
|
||||
|
||||
package com.iluwatar.privateclassdata;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import com.iluwatar.privateclassdata.utils.InMemoryAppender;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Date: 12/27/15 - 10:46 PM
|
||||
*
|
||||
@ -54,10 +54,10 @@ public class ImmutableStewTest {
|
||||
*/
|
||||
@Test
|
||||
public void testMix() {
|
||||
final Stew stew = new Stew(1, 2, 3, 4);
|
||||
final String expectedMessage = "Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers";
|
||||
var stew = new Stew(1, 2, 3, 4);
|
||||
var expectedMessage = "Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers";
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
for (var i = 0; i < 20; i++) {
|
||||
stew.mix();
|
||||
assertEquals(expectedMessage, appender.getLastMessage());
|
||||
}
|
||||
@ -70,15 +70,17 @@ public class ImmutableStewTest {
|
||||
*/
|
||||
@Test
|
||||
public void testDrink() {
|
||||
final Stew stew = new Stew(1, 2, 3, 4);
|
||||
final var stew = new Stew(1, 2, 3, 4);
|
||||
stew.mix();
|
||||
|
||||
assertEquals("Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers", appender.getLastMessage());
|
||||
assertEquals("Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers", appender
|
||||
.getLastMessage());
|
||||
|
||||
stew.taste();
|
||||
assertEquals("Tasting the stew", appender.getLastMessage());
|
||||
assertEquals("Tasting the stew", appender.getLastMessage());
|
||||
|
||||
stew.mix();
|
||||
assertEquals("Mixing the stew we find: 0 potatoes, 1 carrots, 2 meat and 3 peppers", appender.getLastMessage());
|
||||
assertEquals("Mixing the stew we find: 0 potatoes, 1 carrots, 2 meat and 3 peppers", appender
|
||||
.getLastMessage());
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@
|
||||
|
||||
package com.iluwatar.privateclassdata;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import com.iluwatar.privateclassdata.utils.InMemoryAppender;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Date: 12/27/15 - 10:46 PM
|
||||
*
|
||||
@ -54,11 +54,11 @@ public class StewTest {
|
||||
*/
|
||||
@Test
|
||||
public void testMix() {
|
||||
final ImmutableStew stew = new ImmutableStew(1, 2, 3, 4);
|
||||
final String expectedMessage = "Mixing the immutable stew we find: 1 potatoes, "
|
||||
final var stew = new ImmutableStew(1, 2, 3, 4);
|
||||
final var expectedMessage = "Mixing the immutable stew we find: 1 potatoes, "
|
||||
+ "2 carrots, 3 meat and 4 peppers";
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
for (var i = 0; i < 20; i++) {
|
||||
stew.mix();
|
||||
assertEquals(expectedMessage, appender.getLastMessage());
|
||||
}
|
||||
|
@ -26,10 +26,9 @@ package com.iluwatar.privateclassdata.utils;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.AppenderBase;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* InMemory Log Appender Util.
|
||||
|
Reference in New Issue
Block a user