From 3964061010ff2953912115f3ddc1e5919109e34b Mon Sep 17 00:00:00 2001 From: huangxin Date: Tue, 21 Apr 2020 15:51:54 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E7=A7=BB=E9=99=A4DP=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=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/dispose/pojo/dto/ProtocolReqDTO.java | 5 +- .../TestSuit/AllDisposePlatformTest.java | 2 +- .../dptech/DPTechInterfaceTestCase.java | 128 +++++++++--------- 3 files changed, 67 insertions(+), 68 deletions(-) diff --git a/src/main/java/com/dispose/pojo/dto/ProtocolReqDTO.java b/src/main/java/com/dispose/pojo/dto/ProtocolReqDTO.java index 7f4ab504..7e518b8f 100644 --- a/src/main/java/com/dispose/pojo/dto/ProtocolReqDTO.java +++ b/src/main/java/com/dispose/pojo/dto/ProtocolReqDTO.java @@ -18,8 +18,7 @@ import org.springframework.http.HttpHeaders; @Data @NoArgsConstructor public class ProtocolReqDTO extends ProtocolDTO { - @SuppressWarnings("checkstyle:ConstantName") - private static final ObjectMapper objMapper = new ObjectMapper(); + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static String token; @@ -32,7 +31,7 @@ public class ProtocolReqDTO extends ProtocolDTO { * @throws JsonProcessingException the json processing exception */ public T getRequestObject(Class objType) throws JsonProcessingException { - return objMapper.readValue(this.getMsgContent(), objType); + return OBJECT_MAPPER.readValue(this.getMsgContent(), objType); } /** diff --git a/src/test/java/com/dispose/TestSuit/AllDisposePlatformTest.java b/src/test/java/com/dispose/TestSuit/AllDisposePlatformTest.java index c9a83c55..66624468 100644 --- a/src/test/java/com/dispose/TestSuit/AllDisposePlatformTest.java +++ b/src/test/java/com/dispose/TestSuit/AllDisposePlatformTest.java @@ -15,7 +15,7 @@ import org.junit.runners.Suite; */ @RunWith(Suite.class) @Suite.SuiteClasses({ - DPTechInterfaceTestCase.class, +// DPTechInterfaceTestCase.class, UserAccountMapperTest.class, DisposeDeviceMapperTest.class, AuthControllerTest.class, diff --git a/src/test/java/com/dispose/dptech/DPTechInterfaceTestCase.java b/src/test/java/com/dispose/dptech/DPTechInterfaceTestCase.java index 0021428f..53fa3f84 100644 --- a/src/test/java/com/dispose/dptech/DPTechInterfaceTestCase.java +++ b/src/test/java/com/dispose/dptech/DPTechInterfaceTestCase.java @@ -25,90 +25,90 @@ import java.util.List; @SpringBootTest @Slf4j public class DPTechInterfaceTestCase { - @Resource - private ObjectMapper objMapper; +// @Resource +// private ObjectMapper objMapper; /** * Get all detection object from umc. */ - @Test - public void getAllDetectionObjectFromUMC(){ - - try { - DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), "10.88.77.15"); - - List detDevs = dp.getAllDetectionObject(); - - Assert.assertNotEquals(detDevs.size(), 0); - - } catch (Exception ex){ - Assert.fail(); - } - } +// @Test +// public void getAllDetectionObjectFromUMC(){ +// +// try { +// DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), "10.88.77.15"); +// +// List detDevs = dp.getAllDetectionObject(); +// +// Assert.assertNotEquals(detDevs.size(), 0); +// +// } catch (Exception ex){ +// Assert.fail(); +// } +// } /** * Get all protect devices. */ - @Test - public void getAllProtectDevices(){ - - try { - DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), "10.88.77.15"); - - String proDevs = dp.getProtectDevices(); - - Assert.assertNotEquals(proDevs.length(), 0); - - } catch (Exception ex){ - Assert.fail(); - } - } +// @Test +// public void getAllProtectDevices(){ +// +// try { +// DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), "10.88.77.15"); +// +// String proDevs = dp.getProtectDevices(); +// +// Assert.assertNotEquals(proDevs.length(), 0); +// +// } catch (Exception ex){ +// Assert.fail(); +// } +// } /** * Get all protect objects. */ - @Test - public void getAllProtectObjects(){ - - try { - DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), "10.88.77.15"); - - List proObjs = dp.getAllProtectionObject(); - - Assert.assertNotEquals(proObjs.size(), 0); - - } catch (Exception ex){ - Assert.fail(); - } - } +// @Test +// public void getAllProtectObjects(){ +// +// try { +// DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), "10.88.77.15"); +// +// List proObjs = dp.getAllProtectionObject(); +// +// Assert.assertNotEquals(proObjs.size(), 0); +// +// } catch (Exception ex){ +// Assert.fail(); +// } +// } /** * Get link status. */ - @Test - public void getLinkStatus(){ - - DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), - "10.88.77.15"); - - Assert.assertTrue(dp.getDeviceLinkStatus()); - } +// @Test +// public void getLinkStatus(){ +// +// DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), +// "10.88.77.15"); +// +// Assert.assertTrue(dp.getDeviceLinkStatus()); +// } /** * Gets device capacity. * * @throws JsonProcessingException the json processing exception */ - @Test - public void getDeviceCapacity() throws JsonProcessingException { - - DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), - "10.88.77.15"); - - List capList = dp.getDeviceCapacity(); - - Assert.assertNotEquals(capList.size(), 0); - - log.info(objMapper.writerWithDefaultPrettyPrinter().writeValueAsString(capList)); - } +// @Test +// public void getDeviceCapacity() throws JsonProcessingException { +// +// DisposeEntryManager dp = DeviceRouter.deviceRouterFactory(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode(), +// "10.88.77.15"); +// +// List capList = dp.getDeviceCapacity(); +// +// Assert.assertNotEquals(capList.size(), 0); +// +// log.info(objMapper.writerWithDefaultPrettyPrinter().writeValueAsString(capList)); +// } }