flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject [2/5] flink git commit: [FLINK-3013] [gelly] Incorrect package declaration in GellyScalaAPICompletenessTest.scala
Date Thu, 19 Nov 2015 10:10:24 GMT
http://git-wip-us.apache.org/repos/asf/flink/blob/3a300e63/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
----------------------------------------------------------------------
diff --git a/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
b/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
index b2bfd6b..608000d 100644
--- a/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
+++ b/flink-test-utils/src/main/java/org/apache/flink/test/util/TestBaseUtils.java
@@ -162,8 +162,8 @@ public class TestBaseUtils extends TestLogger {
 			
 			if (executor.running()) {
 				List<ActorRef> tms = executor.getTaskManagersAsJava();
-				List<Future<Object>> bcVariableManagerResponseFutures = new ArrayList<Future<Object>>();
-				List<Future<Object>> numActiveConnectionsResponseFutures = new ArrayList<Future<Object>>();
+				List<Future<Object>> bcVariableManagerResponseFutures = new ArrayList<>();
+				List<Future<Object>> numActiveConnectionsResponseFutures = new ArrayList<>();
 
 				for (ActorRef tm : tms) {
 					bcVariableManagerResponseFutures.add(Patterns.ask(tm, TestingTaskManagerMessages
@@ -297,7 +297,7 @@ public class TestBaseUtils extends TestLogger {
 
 	public static void compareResultsByLinesInMemory(String expectedResultStr, String resultPath,
 											String[] excludePrefixes) throws Exception {
-		ArrayList<String> list = new ArrayList<String>();
+		ArrayList<String> list = new ArrayList<>();
 		readAllResultLines(list, resultPath, excludePrefixes, false);
 
 		String[] result = list.toArray(new String[list.size()]);
@@ -317,7 +317,7 @@ public class TestBaseUtils extends TestLogger {
 
 	public static void compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr,
 																	String resultPath, String[] excludePrefixes) throws Exception {
-		ArrayList<String> list = new ArrayList<String>();
+		ArrayList<String> list = new ArrayList<>();
 		readAllResultLines(list, resultPath, excludePrefixes, true);
 
 		String[] result = list.toArray(new String[list.size()]);
@@ -332,7 +332,7 @@ public class TestBaseUtils extends TestLogger {
 		Pattern pattern = Pattern.compile(regexp);
 		Matcher matcher = pattern.matcher("");
 
-		ArrayList<String> list = new ArrayList<String>();
+		ArrayList<String> list = new ArrayList<>();
 		try {
 			readAllResultLines(list, resultPath, new String[]{}, false);
 		} catch (IOException e1) {
@@ -355,7 +355,7 @@ public class TestBaseUtils extends TestLogger {
 
 	public static void compareKeyValuePairsWithDelta(String expectedLines, String resultPath,
 														String[] excludePrefixes, String delimiter, double maxDelta) throws Exception
{
-		ArrayList<String> list = new ArrayList<String>();
+		ArrayList<String> list = new ArrayList<>();
 		readAllResultLines(list, resultPath, excludePrefixes, false);
 
 		String[] result = list.toArray(new String[list.size()]);
@@ -421,9 +421,7 @@ public class TestBaseUtils extends TestLogger {
 			} else {
 				throw new IllegalArgumentException("This path does not denote a local file.");
 			}
-		} catch (URISyntaxException e) {
-			throw new IllegalArgumentException("This path does not describe a valid local file URI.");
-		} catch (NullPointerException e) {
+		} catch (URISyntaxException | NullPointerException e) {
 			throw new IllegalArgumentException("This path does not describe a valid local file URI.");
 		}
 	}
@@ -441,7 +439,7 @@ public class TestBaseUtils extends TestLogger {
 	}
 	
 	private static <T> void compareResult(List<T> result, String expected, boolean
asTuples) {
-		String[] extectedStrings = expected.split("\n");
+		String[] expectedStrings = expected.split("\n");
 		String[] resultStrings = new String[result.size()];
 		
 		for (int i = 0; i < resultStrings.length; i++) {
@@ -467,13 +465,13 @@ public class TestBaseUtils extends TestLogger {
 			}
 		}
 		
-		assertEquals("Wrong number of elements result", extectedStrings.length, resultStrings.length);
+		assertEquals("Wrong number of elements result", expectedStrings.length, resultStrings.length);
 
-		Arrays.sort(extectedStrings);
+		Arrays.sort(expectedStrings);
 		Arrays.sort(resultStrings);
 		
-		for (int i = 0; i < extectedStrings.length; i++) {
-			assertEquals(extectedStrings[i], resultStrings[i]);
+		for (int i = 0; i < expectedStrings.length; i++) {
+			assertEquals(expectedStrings[i], resultStrings[i]);
 		}
 	}
 	
@@ -510,7 +508,7 @@ public class TestBaseUtils extends TestLogger {
 	// --------------------------------------------------------------------------------------------
 
 	protected static Collection<Object[]> toParameterList(Configuration ... testConfigs)
{
-		ArrayList<Object[]> configs = new ArrayList<Object[]>();
+		ArrayList<Object[]> configs = new ArrayList<>();
 		for (Configuration testConfig : testConfigs) {
 			Object[] c = { testConfig };
 			configs.add(c);
@@ -519,7 +517,7 @@ public class TestBaseUtils extends TestLogger {
 	}
 
 	protected static Collection<Object[]> toParameterList(List<Configuration> testConfigs)
{
-		LinkedList<Object[]> configs = new LinkedList<Object[]>();
+		LinkedList<Object[]> configs = new LinkedList<>();
 		for (Configuration testConfig : testConfigs) {
 			Object[] c = { testConfig };
 			configs.add(c);


Mime
View raw message