Revision: 12666
http://sourceforge.net/p/foray/code/12666
Author: victormote
Date: 2022-06-20 17:25:03 +0000 (Mon, 20 Jun 2022)
Log Message:
-----------
Combine two IntArrayBuilderTests classes.
Modified Paths:
--------------
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java
Removed Paths:
-------------
trunk/foray/foray-common/src/test/java/org/foray/common/data/IntArrayBuilderTests.java
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/data/IntArrayBuilderTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/IntArrayBuilderTests.java 2022-06-20 12:25:31 UTC (rev 12665)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/IntArrayBuilderTests.java 2022-06-20 17:25:03 UTC (rev 12666)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2019 The FOray Project.
- * http://www.foray.org
- *
- * Licensed 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.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.data;
-
-import org.foray.common.sequence.IntArray;
-import org.foray.common.sequence.IntArrayBuilder;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Tests of {@Link IntArrayBuilder}.
- */
-public class IntArrayBuilderTests {
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the comparison object is of the wrong type.
- */
- @SuppressWarnings("unlikely-arg-type")
- @Test
- public void testEqualsWrongType() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(4);
- Assert.assertFalse(out.equals("abc"));
- }
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the comparison object is null.
- */
- @Test
- public void testEqualsNull() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(4);
- Assert.assertFalse(out.equals(null));
- }
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the length of the comparison object is different.
- */
- @Test
- public void testEqualsDifferentLengths() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(4);
- out.append(4);
- IntArrayBuilder comparison = new IntArrayBuilder();
- comparison.append(4);
- Assert.assertFalse(out.equals(comparison));
- comparison = new IntArrayBuilder();
- comparison.append(4);
- comparison.append(4);
- comparison.append(4);
- Assert.assertFalse(out.equals(comparison));
- }
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the sequences are equal.
- */
- @Test
- public void testEqualsAreEquivalentCharSequenceEquivalent() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(989);
- out.append(4);
- final IntArrayBuilder comparison = new IntArrayBuilder();
- comparison.append(989);
- comparison.append(4);
- Assert.assertTrue(out.equals(comparison));
- }
-
- /** Test of method {@link IntArrayBuilder#append(int...)}. */
- @Test
- public void testAppend() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(0);
- out.append(1);
- out.append(2, 3, 4, 5);
- final IntArray expected = new IntArray(new int[] {0, 1, 2, 3, 4, 5});
- Assert.assertEquals(expected, out.toIntArray());
- }
-
-}
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java 2022-06-20 12:25:31 UTC (rev 12665)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java 2022-06-20 17:25:03 UTC (rev 12666)
@@ -37,6 +37,70 @@
public class IntArrayBuilderTests {
/**
+ * Test of method {@link IntArrayBuilder#equals(Object)} where the comparison object is of the wrong type.
+ */
+ @SuppressWarnings("unlikely-arg-type")
+ @Test
+ public void testEqualsWrongType() {
+ final IntArrayBuilder out = new IntArrayBuilder();
+ out.append(4);
+ Assert.assertFalse(out.equals("abc"));
+ }
+
+ /**
+ * Test of method {@link IntArrayBuilder#equals(Object)} where the comparison object is null.
+ */
+ @Test
+ public void testEqualsNull() {
+ final IntArrayBuilder out = new IntArrayBuilder();
+ out.append(4);
+ Assert.assertFalse(out.equals(null));
+ }
+
+ /**
+ * Test of method {@link IntArrayBuilder#equals(Object)} where the length of the comparison object is different.
+ */
+ @Test
+ public void testEqualsDifferentLengths() {
+ final IntArrayBuilder out = new IntArrayBuilder();
+ out.append(4);
+ out.append(4);
+ IntArrayBuilder comparison = new IntArrayBuilder();
+ comparison.append(4);
+ Assert.assertFalse(out.equals(comparison));
+ comparison = new IntArrayBuilder();
+ comparison.append(4);
+ comparison.append(4);
+ comparison.append(4);
+ Assert.assertFalse(out.equals(comparison));
+ }
+
+ /**
+ * Test of method {@link IntArrayBuilder#equals(Object)} where the sequences are equal.
+ */
+ @Test
+ public void testEqualsAreEquivalentCharSequenceEquivalent() {
+ final IntArrayBuilder out = new IntArrayBuilder();
+ out.append(989);
+ out.append(4);
+ final IntArrayBuilder comparison = new IntArrayBuilder();
+ comparison.append(989);
+ comparison.append(4);
+ Assert.assertTrue(out.equals(comparison));
+ }
+
+ /** Test of method {@link IntArrayBuilder#append(int...)}. */
+ @Test
+ public void testAppend() {
+ final IntArrayBuilder out = new IntArrayBuilder();
+ out.append(0);
+ out.append(1);
+ out.append(2, 3, 4, 5);
+ final IntArray expected = new IntArray(new int[] {0, 1, 2, 3, 4, 5});
+ Assert.assertEquals(expected, out.toIntArray());
+ }
+
+ /**
* Test of {@link IntArrayBuilder#insert(int, int)}.
*/
@Test
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|