You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemall.apache.org by my...@apache.org on 2019/10/07 05:44:48 UTC

[incubator-hivemall] branch master updated: Merged ArrayUtilsTest

This is an automated email from the ASF dual-hosted git repository.

myui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hivemall.git


The following commit(s) were added to refs/heads/master by this push:
     new 839fd24  Merged ArrayUtilsTest
839fd24 is described below

commit 839fd243c849ed23c8e08232d3870269b50f8967
Author: Makoto Yui <my...@apache.org>
AuthorDate: Mon Oct 7 14:44:39 2019 +0900

    Merged ArrayUtilsTest
---
 .../test/java/hivemall/utils/ArrayUtilsTest.java   | 55 ----------------------
 .../java/hivemall/utils/lang/ArrayUtilsTest.java   | 27 +++++++++++
 2 files changed, 27 insertions(+), 55 deletions(-)

diff --git a/core/src/test/java/hivemall/utils/ArrayUtilsTest.java b/core/src/test/java/hivemall/utils/ArrayUtilsTest.java
deleted file mode 100644
index 3f81c39..0000000
--- a/core/src/test/java/hivemall/utils/ArrayUtilsTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package hivemall.utils;
-
-import hivemall.utils.lang.ArrayUtils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Random;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class ArrayUtilsTest {
-
-    @Test
-    public void test() {
-        String[] shuffled = new String[] {"1, 2, 3", "4, 5, 6", "7, 8, 9", "10, 11, 12"};
-        String[] outcome = new String[] {"10, 11, 12", "1, 2, 3", "4, 5, 6", "7, 8, 9"};
-
-        ArrayUtils.shuffle(shuffled, new Random(0L));
-
-        for (int i = 0; i < shuffled.length; i++) {
-            Assert.assertEquals(outcome[i], shuffled[i]);
-        }
-    }
-
-    @Test
-    public void asKryoSerializableListTest() {
-        String[] array = new String[] {"1, 2, 3", "4, 5, 6", "7, 8, 9", "10, 11, 12"};
-        List<String> actual = ArrayUtils.asKryoSerializableList(array);
-
-        Assert.assertEquals(Arrays.asList(array), actual);
-
-        Assert.assertEquals(ArrayList.class, actual.getClass());
-    }
-
-}
diff --git a/core/src/test/java/hivemall/utils/lang/ArrayUtilsTest.java b/core/src/test/java/hivemall/utils/lang/ArrayUtilsTest.java
index e38be8c..42acc0b 100644
--- a/core/src/test/java/hivemall/utils/lang/ArrayUtilsTest.java
+++ b/core/src/test/java/hivemall/utils/lang/ArrayUtilsTest.java
@@ -18,6 +18,11 @@
  */
 package hivemall.utils.lang;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -65,4 +70,26 @@ public class ArrayUtilsTest {
             ArrayUtils.insert(original, original.length + 1, 11));
     }
 
+    @Test
+    public void testShuffle() {
+        String[] shuffled = new String[] {"1, 2, 3", "4, 5, 6", "7, 8, 9", "10, 11, 12"};
+        String[] outcome = new String[] {"10, 11, 12", "1, 2, 3", "4, 5, 6", "7, 8, 9"};
+
+        ArrayUtils.shuffle(shuffled, new Random(0L));
+
+        for (int i = 0; i < shuffled.length; i++) {
+            Assert.assertEquals(outcome[i], shuffled[i]);
+        }
+    }
+
+    @Test
+    public void asKryoSerializableListTest() {
+        String[] array = new String[] {"1, 2, 3", "4, 5, 6", "7, 8, 9", "10, 11, 12"};
+        List<String> actual = ArrayUtils.asKryoSerializableList(array);
+
+        Assert.assertEquals(Arrays.asList(array), actual);
+
+        Assert.assertEquals(ArrayList.class, actual.getClass());
+    }
+
 }