|
|
|
@ -52,4 +52,28 @@ public class GeneralKitTest extends Prepare {
|
|
|
|
|
public void getLocale() { |
|
|
|
|
Assert.assertEquals(GeneralKit.getLocale(), Locale.CHINA); |
|
|
|
|
} |
|
|
|
|
@Test |
|
|
|
|
public void equals(){ |
|
|
|
|
Object objArray[] = {1,2,3}; |
|
|
|
|
Integer intArray[] = {1,2,3}; |
|
|
|
|
Long[] longArray = {1L,2L,3L}; |
|
|
|
|
Double doubleArray[] = {1.1,2.2,3.3}; |
|
|
|
|
Byte[] byteArray = {1,2,3}; |
|
|
|
|
Character[] charArray = {'a', 'b', 'c'}; |
|
|
|
|
Boolean booleanArray[] = {true,true,false}; |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(objArray, new Object[]{1,2,3}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(objArray, new Object[]{1,2,3,4}), false); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(intArray, new Integer[]{1,2,3}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(intArray, new Integer[]{1,2,3,4}), false); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(longArray, new Long[]{1L,2L,3L}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(longArray, new Long[]{1L,2L,3L,4L}), false); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(doubleArray, new Double[]{1.1,2.2,3.3}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(doubleArray, new Double[]{1.1,2.2,3.3,4.4}), false); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(byteArray, new Byte[]{1,2,3}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(byteArray, new Byte[]{1,2,3,4}), false); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(charArray, new Character[]{'a','b','c'}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(charArray, new Character[]{'a','b','c','d'}), false); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(booleanArray, new Boolean[]{true,true,false}), true); |
|
|
|
|
Assert.assertEquals(GeneralKit.equals(booleanArray, new Boolean[]{true,true,false,false}), false); |
|
|
|
|
} |
|
|
|
|
} |