From 2227a96f7d17e3803d04aae58b2fa4f2955ca958 Mon Sep 17 00:00:00 2001 From: richie Date: Wed, 28 Aug 2019 18:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/util/GeneralKitTest.java | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/test/java/com/fanruan/api/util/GeneralKitTest.java b/src/test/java/com/fanruan/api/util/GeneralKitTest.java index 849a0e4..7bbefa6 100644 --- a/src/test/java/com/fanruan/api/util/GeneralKitTest.java +++ b/src/test/java/com/fanruan/api/util/GeneralKitTest.java @@ -1,9 +1,7 @@ package com.fanruan.api.util; import com.fanruan.api.Prepare; -import com.fr.third.guava.base.Objects; import com.fr.general.GeneralUtils; -import com.fr.third.javax.persistence.criteria.CriteriaBuilder; import org.junit.Assert; import org.junit.Test; @@ -20,26 +18,8 @@ public class GeneralKitTest extends Prepare { } @Test - public void equals() throws Exception{ - Integer x = 5; - Integer y = 10; - Integer z =5; - Short a = 5; - Assert.assertEquals(GeneralKit.equals(x, y), false); - Assert.assertEquals(GeneralKit.equals(x, z), true); - Assert.assertEquals(GeneralKit.equals(z, a), false); - } - - @Test - public void hashCodes() { - class A { - } - ; - Object a = new A(); - Assert.assertEquals(GeneralKit.hashCode(a), Objects.hashCode(a)); - } public void objectToString() { - Integer s = new Integer(1); + Integer s = 1; Assert.assertEquals(GeneralKit.objectToString(s),"1"); } @@ -51,10 +31,10 @@ public class GeneralKitTest extends Prepare { @Test public void compare() { - Integer s = new Integer(1); - Integer s3 = new Integer(1); - Integer s1 = new Integer(2); - Integer s2 = new Integer(0); + Integer s = 1; + Integer s3 = 1; + Integer s1 = 2; + Integer s2 = 0; Assert.assertEquals(GeneralKit.compare(s,s1),-1); Assert.assertEquals(GeneralKit.compare(s,s3),0); Assert.assertEquals(GeneralKit.compare(s,s2),1);