diff options
author | Kengo Seki <sekikn@apache.org> | 2016-10-06 15:54:53 +0900 |
---|---|---|
committer | Konstantin Boudnik <konstantin_boudnik@epam.com> | 2016-10-13 13:17:17 -0700 |
commit | 162f0a62f67c2f226ee12e0d4c9c03c6ca72c8e5 (patch) | |
tree | f8735db0822b1d7543a75dc10b567517a1a4b693 /bigtop-tests/test-artifacts | |
parent | 0f0e8842b735683617f934656c576a4e2ad0d1db (diff) |
BIGTOP-2549: "Expected" and "actual" values are mistakenly switched in some JUnit method invocation
Signed-off-by: Konstantin Boudnik <konstantin_boudnik@epam.com>
Diffstat (limited to 'bigtop-tests/test-artifacts')
10 files changed, 35 insertions, 35 deletions
diff --git a/bigtop-tests/test-artifacts/crunch/src/main/groovy/org/apache/bigtop/itest/crunchsmoke/TestCrunchSmoke.groovy b/bigtop-tests/test-artifacts/crunch/src/main/groovy/org/apache/bigtop/itest/crunchsmoke/TestCrunchSmoke.groovy index 7edca588..b3c8d6c9 100644 --- a/bigtop-tests/test-artifacts/crunch/src/main/groovy/org/apache/bigtop/itest/crunchsmoke/TestCrunchSmoke.groovy +++ b/bigtop-tests/test-artifacts/crunch/src/main/groovy/org/apache/bigtop/itest/crunchsmoke/TestCrunchSmoke.groovy @@ -55,7 +55,7 @@ public class TestCrunchSmoke { + " org.apache.crunch.examples.${algorithm}" + " ${examples.get(algorithm)}" ); - assertEquals("running Crunch example failed", sh.getRet(), 0); + assertEquals("running Crunch example failed", 0, sh.getRet()); } @Test(timeout = 300000L) diff --git a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/PigTests.java b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/PigTests.java index 22e55c9e..8b111111 100644 --- a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/PigTests.java +++ b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/PigTests.java @@ -170,7 +170,7 @@ public abstract class PigTests int i=0; for (String e : expected) { - assertEquals(tuples.get(i++).toString(), e); + assertEquals(e, tuples.get(i++).toString()); } } diff --git a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/sessions/SessionTests.java b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/sessions/SessionTests.java index 6dfc3bee..d13f1c3e 100644 --- a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/sessions/SessionTests.java +++ b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/sessions/SessionTests.java @@ -73,9 +73,9 @@ public class SessionTests extends PigTests userValues.get(userId).put(max, true); } - assertEquals(userValues.get(1).size(), 2); - assertEquals(userValues.get(2).size(), 5); - assertEquals(userValues.get(3).size(), 1); + assertEquals(2, userValues.get(1).size()); + assertEquals(5, userValues.get(2).size()); + assertEquals(1, userValues.get(3).size()); assertTrue(userValues.get(1).containsKey(20)); assertTrue(userValues.get(1).containsKey(30)); diff --git a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/QuantileTests.java b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/QuantileTests.java index 305858c1..e9ef05d6 100644 --- a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/QuantileTests.java +++ b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/QuantileTests.java @@ -44,8 +44,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(1.0,3.0,5.5,8.0,10.0)"); + assertEquals(1,output.size()); + assertEquals("(1.0,3.0,5.5,8.0,10.0)", output.get(0).toString()); } @Test @@ -61,8 +61,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(1.0,3.0,5.5,8.0,10.0)"); + assertEquals(1,output.size()); + assertEquals("(1.0,3.0,5.5,8.0,10.0)", output.get(0).toString()); } @Test @@ -77,8 +77,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(5.5)"); + assertEquals(1,output.size()); + assertEquals("(5.5)", output.get(0).toString()); } @Test @@ -93,8 +93,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(5.0)"); + assertEquals(1,output.size()); + assertEquals("(5.0)", output.get(0).toString()); } @Test @@ -109,8 +109,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(1.0,3.0,5.0,8.0,10.0)"); + assertEquals(1,output.size()); + assertEquals("(1.0,3.0,5.0,8.0,10.0)", output.get(0).toString()); } @Test @@ -125,8 +125,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(5.0,8.0,10.0)"); + assertEquals(1,output.size()); + assertEquals("(5.0,8.0,10.0)", output.get(0).toString()); } @Test @@ -146,8 +146,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(70.0,30.0,370.0,1000.0,1.0)"); + assertEquals(1,output.size()); + assertEquals("(70.0,30.0,370.0,1000.0,1.0)", output.get(0).toString()); } @Test @@ -167,8 +167,8 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(130.0,2280.0,15870.0,50000.0,84130.0,97720.0,99870.0)"); + assertEquals(1,output.size()); + assertEquals("(130.0,2280.0,15870.0,50000.0,84130.0,97720.0,99870.0)", output.get(0).toString()); } @@ -190,7 +190,7 @@ public class QuantileTests extends PigTests List<Tuple> output = getLinesForAlias(test, "data_out", true); - assertEquals(output.size(),1); - assertEquals(output.get(0).toString(), "(130.0,2280.0,15870.0,50000.0,84130.0,97720.0,99870.0)"); + assertEquals(1,output.size()); + assertEquals("(130.0,2280.0,15870.0,50000.0,84130.0,97720.0,99870.0)", output.get(0).toString()); } } diff --git a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/WilsonBinConfTests.java b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/WilsonBinConfTests.java index 5811e2cb..cb43ce15 100644 --- a/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/WilsonBinConfTests.java +++ b/bigtop-tests/test-artifacts/datafu/src/main/groovy/org/apache/bigtop/itest/datafu/stats/WilsonBinConfTests.java @@ -75,7 +75,7 @@ public class WilsonBinConfTests extends PigTests assertTrue(expectationIterator.hasNext()); Double lower = (Double)t.get(0); Double upper = (Double)t.get(1); - assertEquals(String.format("%.5f,%.5f",lower,upper),expectationIterator.next()); + assertEquals(expectationIterator.next(),String.format("%.5f,%.5f",lower,upper)); } } } diff --git a/bigtop-tests/test-artifacts/giraph/src/main/groovy/org/apache/bigtop/itest/giraphsmoke/TestGiraphSmoke.groovy b/bigtop-tests/test-artifacts/giraph/src/main/groovy/org/apache/bigtop/itest/giraphsmoke/TestGiraphSmoke.groovy index b2131306..39a150e3 100644 --- a/bigtop-tests/test-artifacts/giraph/src/main/groovy/org/apache/bigtop/itest/giraphsmoke/TestGiraphSmoke.groovy +++ b/bigtop-tests/test-artifacts/giraph/src/main/groovy/org/apache/bigtop/itest/giraphsmoke/TestGiraphSmoke.groovy @@ -42,7 +42,7 @@ public class TestGiraphSmoke { + " -V 100000" // aggregate vertices + " -w 3" // workers ) - assertEquals("running PageRankBenchmark failed", sh.getRet(), 0); + assertEquals("running PageRankBenchmark failed", 0, sh.getRet()); } @Test(timeout = 300000L) @@ -57,7 +57,7 @@ public class TestGiraphSmoke { + " -n 10" // Number of messages per edge + " -b 100" // size of each message in bytes ) - assertEquals("running RandomMessageBenchmark failed", sh.getRet(), 0); + assertEquals("running RandomMessageBenchmark failed", 0, sh.getRet()); } @Test(timeout = 300000L) @@ -70,7 +70,7 @@ public class TestGiraphSmoke { + " -w 3" // workers + " -o ${testDir}" ) - assertEquals("running SimpleCheckpointVertex failed", sh.getRet(), 0); + assertEquals("running SimpleCheckpointVertex failed", 0, sh.getRet()); } @Test(timeout = 300000L) @@ -80,7 +80,7 @@ public class TestGiraphSmoke { + " org.apache.giraph.examples.SimpleVertexWithWorkerContext" + " ${testDir} 3" ) - assertEquals("running SimpleCheckpointVertex failed", sh.getRet(), 0); + assertEquals("running SimpleCheckpointVertex failed", 0, sh.getRet()); } @Test(timeout = 300000L) @@ -110,6 +110,6 @@ public class TestGiraphSmoke { + " ${testDir}/output" + " 0 ${graphDescription.size() / partitionSize}" ) - assertEquals("running SimpleShortestPathsVertex failed", sh.getRet(), 0); + assertEquals("running SimpleShortestPathsVertex failed", 0, sh.getRet()); } } diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy index 903c8684..fb4b6ec3 100644 --- a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy +++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy @@ -56,7 +56,7 @@ class TestTextSnappy { String expected = "1\trafferty\t31\n2\tjones\t33\n3\tsteinberg\t33" System.out.println("Expected output:\n${expected}") System.out.println("Actual output:\n${output}") - assertEquals("Incorrect output", output, expected) + assertEquals("Incorrect output", expected, output) } } diff --git a/bigtop-tests/test-artifacts/hue/src/main/groovy/org/apache/bigtop/itest/huesmoke/TestHueSmoke.groovy b/bigtop-tests/test-artifacts/hue/src/main/groovy/org/apache/bigtop/itest/huesmoke/TestHueSmoke.groovy index 4b5a46d8..f313d752 100644 --- a/bigtop-tests/test-artifacts/hue/src/main/groovy/org/apache/bigtop/itest/huesmoke/TestHueSmoke.groovy +++ b/bigtop-tests/test-artifacts/hue/src/main/groovy/org/apache/bigtop/itest/huesmoke/TestHueSmoke.groovy @@ -61,6 +61,6 @@ public class TestHueSmoke { } } assertEquals("Application(s) ${failedApps} failed to respond", - failedApps.size(), 0); + 0, failedApps.size()); } } diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy index b02c072d..db09e306 100644 --- a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy @@ -83,10 +83,10 @@ class TestIndexingSolrJ extends SolrTestBase { query.setRows(1000) QueryResponse qr = _server.query(query, SolrRequest.METHOD.POST) Object o = qr.getHeader().get("status") - Assert.assertEquals(qr.getHeader().get("status"), 0) + Assert.assertEquals(0, qr.getHeader().get("status")) SolrDocumentList sdl = qr.getResults() - Assert.assertEquals(sdl.size(), docIds.length) + Assert.assertEquals(docIds.length, sdl.size()) for (SolrDocument doc : sdl) { Assert.assertTrue(docIds.contains(doc.get("id"))) } diff --git a/bigtop-tests/test-artifacts/spark/src/main/groovy/org/apache/bigtop/itest/spark/TestSparkSmoke.groovy b/bigtop-tests/test-artifacts/spark/src/main/groovy/org/apache/bigtop/itest/spark/TestSparkSmoke.groovy index 4c601a0b..20cf2cb7 100644 --- a/bigtop-tests/test-artifacts/spark/src/main/groovy/org/apache/bigtop/itest/spark/TestSparkSmoke.groovy +++ b/bigtop-tests/test-artifacts/spark/src/main/groovy/org/apache/bigtop/itest/spark/TestSparkSmoke.groovy @@ -91,8 +91,8 @@ public class TestSparkSmoke implements Serializable { public Boolean call(String s) { return s.contains("e"); } }).count(); - assertEquals("Lines containing 'spark' should be 14", num_Spark, 14); - assertEquals("Lines containing 'e' should be 43", num_e, 43); + assertEquals("Lines containing 'spark' should be 14", 14, num_Spark); + assertEquals("Lines containing 'e' should be 43", 43, num_e); } } |