From 8a6eb66f489a3f0e59b70376afe3c25c6322128c Mon Sep 17 00:00:00 2001 From: lijinxing Date: Fri, 3 Apr 2020 10:50:24 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:1.=E8=B0=83=E8=AF=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=85=A8=E9=83=A8=E9=98=B2=E6=8A=A4=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=202.=E8=B0=83=E8=AF=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=98=B2=E6=8A=A4=E5=AF=B9=E8=B1=A1=E6=8E=A5=E5=8F=A3=203.?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BF=AE=E6=94=B9=E9=98=B2=E6=8A=A4=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=8E=A5=E5=8F=A3=204.=E8=B0=83=E8=AF=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=98=B2=E6=8A=A4=E5=AF=B9=E8=B1=A1=E4=B8=AD=E6=9F=90?= =?UTF-8?q?=E4=B8=80=E4=BF=9D=E6=8A=A4=E7=BD=91=E6=AE=B5=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=205.=E8=B0=83=E8=AF=95=E5=88=A0=E9=99=A4=E9=98=B2=E6=8A=A4?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wsdl/TestaddProtectionObjectForUMC.java | 64 +++++++++++++++++++ .../TestdeleteProtectionObjectForUMC.java | 45 +++++++++++++ ...stdeleteProtectionObjectIPRangeForUMC.java | 48 ++++++++++++++ ...ices.java => TestgetAllDetectDevices.java} | 9 ++- ...ces.java => TestgetAllProtectDevices.java} | 9 ++- .../TestgetAllProtectionObjectFromUMC.java | 59 +++++++++++++++++ .../TestmodifyProtectionObjectForUMC.java | 56 ++++++++++++++++ 7 files changed, 288 insertions(+), 2 deletions(-) create mode 100644 src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestaddProtectionObjectForUMC.java create mode 100644 src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectForUMC.java create mode 100644 src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectIPRangeForUMC.java rename src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/{getAllDetectDevices.java => TestgetAllDetectDevices.java} (87%) rename src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/{getAllProtectDevices.java => TestgetAllProtectDevices.java} (87%) create mode 100644 src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectionObjectFromUMC.java create mode 100644 src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestmodifyProtectionObjectForUMC.java diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestaddProtectionObjectForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestaddProtectionObjectForUMC.java new file mode 100644 index 00000000..7215a822 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestaddProtectionObjectForUMC.java @@ -0,0 +1,64 @@ +package com.cmcc.hy.phoenix.dptech.wsdl; + +import com.sun.org.apache.xpath.internal.objects.XString; + +/* +4.2 添加防护对象 + */ +public class TestaddProtectionObjectForUMC { + public static void main(String[] args) { + try{ + org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = + new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator(); + + basicAuthentication.setUsername("admin"); + basicAuthentication.setPassword("UMCAdministrator"); + + AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub(); + AbnormalFlowCleaningServiceStub.AddProtectionObjectForUMC addPObject = new AbnormalFlowCleaningServiceStub.AddProtectionObjectForUMC(); + /* + 输入参数: + 属性 类型 说明 + detectionDevices string 检测设备列表。(无检测设备时可填写空串) + cleaningDevices string 清洗设备列表。 + protectionName string 防护对象名称。 + ipSegment string 防护IP段。(注意:防护对象IP段格式同检测对象稍有不同,请参考下面的格式说明。) + ipType int IP类型(V4:0;V6:1)。 + cleaningType int 清洗类型(Probe自动:3;Probe手动:4;第三方自动:1;第三方手动:2;无检测设备:0)。 + */ + String detectionDevices = ""; + String cleaningDevices = "10.88.76.41"; + String protectionName = "test"; + String ipSegment = "1_192.168.1.5-192.168.1.6"; + int ipType = 0; //文档标错 + int cleaningType = 1; //文档标错 + + addPObject.setDetectionDevices(detectionDevices); + addPObject.setCleaningDevices(cleaningDevices); + addPObject.setProtectionName(protectionName); + addPObject.setIpSegment(ipSegment); + addPObject.setIpType(ipType); + addPObject.setCleaningType(cleaningType); + + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); + + /* + 属性 类型 说明 + resultRetVal int 返回状态码。 + resultInfo string 请求执行结果描述。 + 执行成功NtcRequestResultInfo类的resultRetVal属性值为0。 + 执行失败NtcRequestResultInfo类的resultRetVal属性值为非0。可获取resultInfo属性值查看失败提示信息。 + */ + AbnormalFlowCleaningServiceStub.AddProtectionObjectForUMCResponse response = stub.addProtectionObjectForUMC(addPObject); + System.out.println("resultRetVal:" + response.localOut.getResultRetVal()); + System.out.println("resultInfo" + response.localOut.getResultInfo()); + + }catch (org.apache.axis2.AxisFault ex) { + System.out.println(ex.toString()); + } catch (java.rmi.RemoteException ex2) { + System.out.println(ex2.toString()); + } + } + +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectForUMC.java new file mode 100644 index 00000000..d060d4e5 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectForUMC.java @@ -0,0 +1,45 @@ +package com.cmcc.hy.phoenix.dptech.wsdl; + +/* +4.5 删除防护对象 + */ +public class TestdeleteProtectionObjectForUMC { + public static void main(String[] args) { + try{ + org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = + new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator(); + + basicAuthentication.setUsername("admin"); + basicAuthentication.setPassword("UMCAdministrator"); + + AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub(); + AbnormalFlowCleaningServiceStub.DeleteProtectionObjectForUMC deletePO = new AbnormalFlowCleaningServiceStub.DeleteProtectionObjectForUMC(); + /* + 输入参数: + 属性 类型 说明 + protectionName string 防护对象名称。 + */ + String protectionName = "1"; + + deletePO.setProtectionName(protectionName); + + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); + + /* + 输出:NtcRequestResultInfo类的属性信息如下: + 属性 类型 说明 + resultRetVal int 返回状态码。 + resultInfo string 请求执行结果描述。 + */ + AbnormalFlowCleaningServiceStub.DeleteProtectionObjectForUMCResponse response = stub.deleteProtectionObjectForUMC(deletePO); + System.out.println("resultRetVal:"+response.localOut.getResultRetVal()); + System.out.println("resultInfo:"+response.localOut.getResultInfo()); + + }catch (org.apache.axis2.AxisFault ex) { + System.out.println(ex.toString()); + } catch (java.rmi.RemoteException ex2) { + System.out.println(ex2.toString()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectIPRangeForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectIPRangeForUMC.java new file mode 100644 index 00000000..3211e641 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestdeleteProtectionObjectIPRangeForUMC.java @@ -0,0 +1,48 @@ +package com.cmcc.hy.phoenix.dptech.wsdl; + +/* +4.4 删除防护对象中某一保护网段 + */ +public class TestdeleteProtectionObjectIPRangeForUMC { + public static void main(String[] args) { + try{ + org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = + new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator(); + + basicAuthentication.setUsername("admin"); + basicAuthentication.setPassword("UMCAdministrator"); + + AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub(); + AbnormalFlowCleaningServiceStub.DeleteProtectionObjectIPRangeForUMC deletePOIP = new AbnormalFlowCleaningServiceStub.DeleteProtectionObjectIPRangeForUMC(); + /* + 输入参数: + 属性 类型 说明 + protectionName String 防护对象名称。 + ipRangeIDs string 保护网段ID列表。 + */ + String protectionName = "test"; + String ipRangeIDs = "1"; + + deletePOIP.setProtectionName(protectionName); + deletePOIP.setIpRangeIDs(ipRangeIDs); + + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); + + /* + 输出:NtcRequestResultInfo类的属性信息如下: + 属性 类型 说明 + resultRetVal int 返回状态码。 + resultInfo string 请求执行结果描述。 + */ + AbnormalFlowCleaningServiceStub.DeleteProtectionObjectIPRangeForUMCResponse response = stub.deleteProtectionObjectIPRangeForUMC(deletePOIP); + System.out.println("resultRetVal:"+response.localOut.getResultRetVal()); + System.out.println("resultInfo:"+response.localOut.getResultInfo()); + + }catch (org.apache.axis2.AxisFault ex) { + System.out.println(ex.toString()); + } catch (java.rmi.RemoteException ex2) { + System.out.println(ex2.toString()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/getAllDetectDevices.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllDetectDevices.java similarity index 87% rename from src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/getAllDetectDevices.java rename to src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllDetectDevices.java index 70941d71..d89b7347 100644 --- a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/getAllDetectDevices.java +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllDetectDevices.java @@ -1,6 +1,13 @@ package com.cmcc.hy.phoenix.dptech.wsdl; -public class getAllDetectDevices { +/* +2.1 获取全部检测设备 +输入参数 无 +输出参数 : +属性 类型 说明 +out string UMC全部清洗设备列表(注:以英文逗号间隔) + */ +public class TestgetAllDetectDevices { public static void main(String[] args) { try { org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/getAllProtectDevices.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectDevices.java similarity index 87% rename from src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/getAllProtectDevices.java rename to src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectDevices.java index d044db06..e33669b8 100644 --- a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/getAllProtectDevices.java +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectDevices.java @@ -1,6 +1,13 @@ package com.cmcc.hy.phoenix.dptech.wsdl; -public class getAllProtectDevices { +/* +2.2 获取全部清洗设备 +输入参数 无 +输出参数 : +属性 类型 说明 +out string UMC全部检测设备列表(注:以英文逗号间隔) + */ +public class TestgetAllProtectDevices { public static void main(String[] args) { try { org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectionObjectFromUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectionObjectFromUMC.java new file mode 100644 index 00000000..2b2794ab --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestgetAllProtectionObjectFromUMC.java @@ -0,0 +1,59 @@ +package com.cmcc.hy.phoenix.dptech.wsdl; + +import com.sun.org.apache.xpath.internal.objects.XNull; + +/* +4.1 获取全部防护对象 + */ +public class TestgetAllProtectionObjectFromUMC { + public static void main(String[] args) { + try{ + org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = + new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator(); + + basicAuthentication.setUsername("admin"); + basicAuthentication.setPassword("UMCAdministrator"); + + AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub(); + /* + 输入参数:无 + */ + AbnormalFlowCleaningServiceStub.GetAllProtectionObjectFromUMC getPObject = new AbnormalFlowCleaningServiceStub.GetAllProtectionObjectFromUMC(); + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); + + /* + 输出:数组ArrayOfProtectionObjectDataForService 函数返回值。该类为防护对象的数组。 + ArrayOfProtectionObjectDataForService类为ProtectionObjectDataForService类的数组。 + ProtectionObjectDataForService类的属性信息如下: + 属性 类型 说明 + detectionDevices string 检测设备列表。(无检测设备时为空串) + cleaningDevices string 清洗设备列表。 + protectionName string 防护对象名称。 + ipSegment string 防护IP段。(注意:防护对象IP段格式同检测对象稍有不同,请参考下面的格式说明。) + ipType string IP类型(V4:0;V6:1)。 + cleaningType string 清洗类型(Probe自动:3;Probe手动:4;第三方自动:1;第三方手动:2;无检测设备:0)。 + */ + AbnormalFlowCleaningServiceStub.GetAllProtectionObjectFromUMCResponse response = stub.getAllProtectionObjectFromUMC(getPObject); + try { + for (AbnormalFlowCleaningServiceStub.ProtectionObjectDataForService v : response.localOut.getProtectionObjectDataForService()) { + System.out.println("detectionDevices:" + v.getDetectionDevices()); + System.out.println("cleaningDevices:" + v.getCleaningDevices()); + System.out.println("protectionName:" + v.getProtectionName()); + System.out.println("ipSegment:" + v.getIpSegment()); + System.out.println("ipType:" + v.getIpType()); + System.out.println("cleaningType:" + v.getCleaningType()); + } + } catch (NullPointerException ex) { + System.out.println(ex.toString()); + } + + + }catch (org.apache.axis2.AxisFault ex) { + System.out.println(ex.toString()); + } catch (java.rmi.RemoteException ex2) { + System.out.println(ex2.toString()); + } + + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestmodifyProtectionObjectForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestmodifyProtectionObjectForUMC.java new file mode 100644 index 00000000..fa4084da --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/wsdl/TestmodifyProtectionObjectForUMC.java @@ -0,0 +1,56 @@ +package com.cmcc.hy.phoenix.dptech.wsdl; + +import com.sun.org.apache.xpath.internal.objects.XString; + +/* +4.3 修改防护对象 + */ +public class TestmodifyProtectionObjectForUMC { + public static void main(String[] args) { + try{ + org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication = + new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator(); + + basicAuthentication.setUsername("admin"); + basicAuthentication.setPassword("UMCAdministrator"); + + AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub(); + AbnormalFlowCleaningServiceStub.ModifyProtectionObjectForUMC modifyDO = new AbnormalFlowCleaningServiceStub.ModifyProtectionObjectForUMC(); + /* + 输入参数: + 属性 类型 说明 + protectionName string 防护对象名称。 + ipSegment string 防护IP段。(注意:防护对象IP段格式同检测对象稍有不同,请参考下面的格式说明。) + ipType string IP类型(V4:0;V6:1)。 + cleaningType int 清洗类型(Probe自动:3;Probe手动:4;第三方自动:1;第三方手动:2;无检测设备:0)。 //文档类型错误 + */ + String protectionName = "test"; + String ipSegment = "1_192.168.1.7-192.168.1.8"; + int ipType = 0; //文档错误 + int cleaningType = 0; //文档错误 + + modifyDO.setProtectionName(protectionName); + modifyDO.setIpSegment(ipSegment); + modifyDO.setIpType(ipType); + modifyDO.setCleaningType(cleaningType); + + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); + stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); + + /* + 输出:NtcRequestResultInfo类的属性信息如下: + 属性 类型 说明 + resultRetVal int 返回状态码。 + resultInfo string 请求执行结果描述。 + */ + AbnormalFlowCleaningServiceStub.ModifyProtectionObjectForUMCResponse response = stub.modifyProtectionObjectForUMC(modifyDO); + System.out.println("resultRetVal:"+response.localOut.getResultRetVal()); + System.out.println("resultInfo:"+response.localOut.getResultInfo()); + + }catch (org.apache.axis2.AxisFault ex) { + System.out.println(ex.toString()); + } catch (java.rmi.RemoteException ex2) { + System.out.println(ex2.toString()); + } + } +}