Browse Source

无jira任务,插件接口适配

pull/28/head
Bruce.Deng 5 years ago
parent
commit
9b074c8a1e
  1. 20
      src/test/java/com/fanruan/api/report/UnitKitTest.java
  2. 7
      src/test/java/com/fanruan/api/util/CodeKitTest.java
  3. 16
      src/test/java/com/fanruan/api/util/GeneralKitTest.java

20
src/test/java/com/fanruan/api/report/UnitKitTest.java

@ -0,0 +1,20 @@
package com.fanruan.api.report;
import com.fr.stable.unit.FU;
import org.junit.Assert;
import org.junit.Test;
public class UnitKitTest {
@Test
public void unit4CompatibleInchDV() {
String str1 = "100";
Assert.assertEquals(UnitKit.unit4CompatibleInchDV(str1), FU.getInstance(365760000));
}
@Test
public void unit4CompatibleMMDV() {
String str1 = "100";
Assert.assertEquals(UnitKit.unit4CompatibleMMDV(str1), FU.getInstance(14400000));
}
}

7
src/test/java/com/fanruan/api/util/CodeKitTest.java

@ -1,7 +1,6 @@
package com.fanruan.api.util;
import com.fr.stable.CodeUtils;
import com.fr.stable.CommonCodeUtils;
import org.junit.Assert;
import org.junit.Test;
@ -36,4 +35,10 @@ public class CodeKitTest {
}
}
@Test
public void jsonEncode() {
String s = "aaa";
Assert.assertEquals(CodeKit.jsonEncode(s),"\"aaa\"");
}
}

16
src/test/java/com/fanruan/api/util/GeneralKitTest.java

@ -2,8 +2,6 @@ package com.fanruan.api.util;
import com.fanruan.api.Prepare;
import com.fr.general.GeneralUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.xml.XMLableReader;
import org.junit.Assert;
import org.junit.Test;
@ -44,6 +42,20 @@ public class GeneralKitTest extends Prepare {
Assert.assertEquals(GeneralKit.compare(s,s2),1);
}
@Test
public void equals() {
String str1 = "a";
String str2 = "a";
String str3 = "b";
int i1 = 1;
int i2 = 1;
int i3 = 2;
Assert.assertEquals(GeneralKit.equals(str1,str2),true);
Assert.assertEquals(GeneralKit.equals(str1,str3),false);
Assert.assertEquals(GeneralKit.equals(i1,i2),true);
Assert.assertEquals(GeneralKit.equals(i1,i3),false);
}
@Test
public void join() {
Object obj[] = {1, 2, 3, 4};

Loading…
Cancel
Save