整合其他分支的接口,并给没有注释的接口添加注释

This commit is contained in:
zhoubin
2021-08-10 16:01:09 +08:00
parent 1db7955ca7
commit 881e3f6445
24 changed files with 922 additions and 236 deletions
@@ -10,7 +10,7 @@ import java.util.Arrays;
public class ASYMEnDeTest {
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("非对称密钥加解密");
byte[] testData = new byte[100];
@@ -16,7 +16,7 @@ import java.util.Arrays;
public class InputOutputKeyTest
{
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("密钥导入导出功能测试");
@@ -5,7 +5,7 @@ import racal.sunyard.main.SydApiBuilder;
public class MACTest {
public static void main(String[] args) {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
SydApi api = new SydApiBuilder()
.setIp("172.16.17.162")
@@ -41,7 +41,7 @@ public class RSAP1SignVerify {
}
public static void main(String[] args) {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
SydApi4j api = (SydApi4j) new SydApiBuilder()
.setIp("192.168.1.226")
.useDebugMode()
@@ -13,7 +13,7 @@ import java.util.Arrays;
public class Test
{
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("工银亚洲测试功能测试");
byte[] testData = new byte[17000];
@@ -73,7 +73,7 @@ import java.util.Arrays;
*/
public class Test2 {
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("工银亚洲测试功能测试");
byte[] testData = new byte[17000];
@@ -11,7 +11,7 @@ import java.util.Arrays;
public class TestKeyPair
{
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("非对称密钥生成");
byte[] testData = new byte[17000];
@@ -8,7 +8,7 @@ import racal.sunyard.main.SydApiBuilder;
import java.util.Arrays;
public class MACTest {
public static void main(String[] args) {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("MAC 测试");
@@ -5,7 +5,7 @@ import racal.sunyard.main.SydApi4j;
import racal.sunyard.main.SydApiBuilder;
public class PBOCTest {
public static void main(String[] args) {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("PBOC MAC 测试");
@@ -9,7 +9,7 @@ public class PledgeTest {
public static void main(String[] args) {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
byte[] testData = "1234567812345678".getBytes();
//testData = new byte[8];
@@ -9,7 +9,7 @@ public class PledgeTest2 {
public static void main(String[] args) {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
byte[] testData = "1234567812345678".getBytes();
//testData = new byte[8];
@@ -10,7 +10,7 @@ import java.io.UnsupportedEncodingException;
public class PrintTest {
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
// 连接加密机
SydApi4j api = (SydApi4j) new SydApiBuilder()
.setIp("172.16.17.161")
@@ -13,7 +13,7 @@ import java.io.UnsupportedEncodingException;
public class TestCB
{
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("SydApi 测试程序启动");
@@ -13,7 +13,7 @@ import java.util.Arrays;
public class TestGongYin
{
public static void main(String[] args) throws UnsupportedEncodingException {
public static void main(String[] args) throws UnsupportedEncodingException, IllegalAccessException, InstantiationException, ClassNotFoundException {
System.out.println("工银亚洲测试功能测试");
byte[] testData = new byte[17000];
@@ -1,8 +1,14 @@
package com.sunyard.sydapi.test;
import com.sunyard.trans.PacketSN;
import org.junit.Test;
import racal.sunyard.main.SydApi4j;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
@@ -42,4 +48,66 @@ public class TestUtil {
}
/**
* 获取所有方法
*/
@Test
public void getMethod() {
Class<SydApi4j> jClass = SydApi4j.class;
Method[] dm = jClass.getDeclaredMethods();
System.out.println(dm.length);
for (int i = 0; i < dm.length; i++) {
Type[] types = dm[i].getGenericParameterTypes();
System.out.print(dm[i].getName() + "(");
for (int j = 0; j < types.length; j++) {
Type type = types[j];
System.out.print(getRealTypeName(type));
if (j != types.length - 1) {
System.out.print(", ");
}
}
System.out.println(")");
}
}
public String getRealTypeName(Type type) {
String resultName = "";
if (type instanceof ParameterizedType) {
resultName = getRealName(type.getTypeName()) + "<";
Type[] actualTypes = ((ParameterizedType) type).getActualTypeArguments();
for (int z = 0; z < actualTypes.length; z++) {
resultName += getRealName(actualTypes[z].getTypeName());
if (z != actualTypes.length - 1) {
resultName += ", ";
}
}
resultName += ">";
} else {
resultName = getRealName(type.getTypeName());
}
return resultName.replace("$", ".");
}
public String getRealName(String typeName) {
if (typeName.contains(".") && typeName.contains("<")) {
typeName = typeName.substring(0, typeName.indexOf("<"));
return typeName.substring(typeName.lastIndexOf(".") + 1);
}
if (typeName.contains(".")) {
return typeName.substring(typeName.lastIndexOf(".") + 1);
}
return typeName;
}
}