REM:
1. 增加获取设备信息测试用例单元测试接口
2. 增加虚拟设备模拟离线功能
This commit is contained in:
HuangXin 2020-09-14 15:49:56 +08:00
parent 63d7a28b1e
commit 1a2b7121fd
7 changed files with 486 additions and 13 deletions

View File

@ -15,6 +15,11 @@ import javax.annotation.Nullable;
* @author <huangxin@cmhi.chinamoblie.com>
*/
public class VirtualAbilityImpl implements DisposeAbility {
/**
* The Is online.
*/
private boolean isOnline = true;
/**
* Init device env.
*
@ -24,7 +29,11 @@ public class VirtualAbilityImpl implements DisposeAbility {
*/
@Override
public void initDeviceEnv(String urlPath, String username, String password) {
final String offlineTarget = "0";
if(offlineTarget.equals(username)) {
isOnline = false;
}
}
/**
@ -90,7 +99,7 @@ public class VirtualAbilityImpl implements DisposeAbility {
*/
@Override
public boolean getDeviceLinkStatus() {
return true;
return isOnline;
}
/**

View File

@ -60,12 +60,11 @@ public class TestHelper {
}
if (loginToken != null) {
build.contentType(MediaType.APPLICATION_JSON)
.header("Authorization", ConstValue.STRING_HTTP_AUTH_HEAD + loginToken)
.content(sendMsgContent);
} else {
build.contentType(MediaType.APPLICATION_JSON)
.content(sendMsgContent);
build.header("Authorization", ConstValue.STRING_HTTP_AUTH_HEAD + loginToken);
}
if (reqType != RequestMethod.GET) {
build.contentType(MediaType.APPLICATION_JSON).content(sendMsgContent);
}
return mockMvc.perform(build)

View File

@ -2,12 +2,14 @@ package com.dispose.test.qa.exec;
import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.service.DisposeDeviceManagerService;
import com.dispose.test.common.QATestItem;
import com.dispose.test.qa.testcase.v20.P1All;
import com.dispose.test.qa.testcase.v20.P2DeviceAdd;
import com.dispose.test.qa.testcase.v20.P2DeviceDel;
import com.dispose.test.qa.testcase.v20.P2DeviceQuery;
import com.dispose.test.qa.testcase.v20.P2DeviceUpgrade;
import com.dispose.test.qa.testcase.v20.P2Info;
import com.dispose.test.qa.testcase.v20.P2Login;
import com.dispose.test.qa.testcase.v20.P2Logout;
@ -35,6 +37,13 @@ public interface TestCaseRun {
*/
DisposeTaskMapper getDisposeTaskMapper();
/**
* Gets dispose device manager service.
*
* @return the dispose device manager service
*/
DisposeDeviceManagerService getDisposeDeviceManagerService();
/**
* Gets all test case.
*
@ -52,6 +61,8 @@ public interface TestCaseRun {
Collections.addAll(tolTestCase, P2DeviceUpgrade.getTestCase());
Collections.addAll(tolTestCase, P2DeviceQuery.getTestCase());
Collections.addAll(tolTestCase, P2Info.getTestCase());
return tolTestCase;
}
}

View File

@ -4,6 +4,7 @@ import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.service.DisposeDeviceManagerService;
import com.dispose.test.common.CommonEnvironment;
import com.dispose.test.common.CommonRestfulJson;
import com.dispose.test.common.QATestItem;
@ -74,6 +75,12 @@ public class JsonTestCaseRun extends CommonRestfulJson implements TestCaseRun {
@Resource
private DisposeTaskMapper disposeTaskMapper;
/**
* The Dispose device manager service.
*/
@Resource
private DisposeDeviceManagerService disposeDeviceManagerService;
/**
* Instantiates a new Json test case run.
*
@ -100,7 +107,7 @@ public class JsonTestCaseRun extends CommonRestfulJson implements TestCaseRun {
.filter(k -> k.getCaseJsonValue() != null && k.getCaseJsonValue().length() > 0)
.filter(k -> usedId.size() == 0 || usedId.stream().anyMatch(v -> Objects.equals(v, k.getId())))
.filter(k -> Arrays.stream(CommonEnvironment.commonPriorityFilter).anyMatch(v -> k.getPriority() == v))
//.filter(k-> k.getId() >= 600)
//.filter(k-> k.getId() >= 700)
.collect(Collectors.toList());
}
@ -154,4 +161,14 @@ public class JsonTestCaseRun extends CommonRestfulJson implements TestCaseRun {
public DisposeTaskMapper getDisposeTaskMapper() {
return disposeTaskMapper;
}
/**
* Gets dispose device manager service.
*
* @return the dispose device manager service
*/
@Override
public DisposeDeviceManagerService getDisposeDeviceManagerService() {
return disposeDeviceManagerService;
}
}

View File

@ -4,6 +4,7 @@ import com.dispose.common.ProtoCryptoType;
import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.service.DisposeDeviceManagerService;
import com.dispose.test.common.CommonEnvironment;
import com.dispose.test.common.CommonRestful;
import com.dispose.test.common.QATestItem;
@ -50,6 +51,10 @@ public class ObjectTestCaseRun extends CommonRestful implements TestCaseRun {
*/
@ClassRule
public static final SpringClassRule springClassRule = new SpringClassRule();
/**
* The constant objIdFilter.
*/
private static final Integer[] objIdFilter = new Integer[]{};
/**
* The Spring method rule.
*/
@ -69,11 +74,11 @@ public class ObjectTestCaseRun extends CommonRestful implements TestCaseRun {
*/
@Resource
private DisposeTaskMapper disposeTaskMapper;
/**
* The constant objIdFilter.
* The Dispose device manager service.
*/
private static final Integer[] objIdFilter = new Integer[] {};
@Resource
private DisposeDeviceManagerService disposeDeviceManagerService;
/**
* Instantiates a new Object test case run.
@ -152,4 +157,14 @@ public class ObjectTestCaseRun extends CommonRestful implements TestCaseRun {
public DisposeTaskMapper getDisposeTaskMapper() {
return disposeTaskMapper;
}
/**
* Gets dispose device manager service.
*
* @return the dispose device manager service
*/
@Override
public DisposeDeviceManagerService getDisposeDeviceManagerService() {
return disposeDeviceManagerService;
}
}

View File

@ -319,8 +319,7 @@ public class P1All {
Assert.assertEquals((long) v.getMsgContent().getStatus(), e.getCode());
Assert.assertEquals((long) v.getMsgContent().getCurPageNumber(), 1);
Assert.assertEquals((long) v.getMsgContent().getPageSize(), 10);
Assert.assertEquals(v.getMsgContent().getItems().size(),
Math.min(v.getMsgContent().getTotalItems(), 10));
Assert.assertNotEquals(v.getMsgContent().getItems().size(), 0);
})
.build(),

View File

@ -0,0 +1,423 @@
package com.dispose.test.qa.testcase.v20;
import com.dispose.common.DisposeCapacityType;
import com.dispose.common.DisposeDeviceType;
import com.dispose.common.DisposeObjectType;
import com.dispose.common.ErrorCode;
import com.dispose.common.Helper;
import com.dispose.common.HttpType;
import com.dispose.common.IpAddrType;
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.dto.protocol.device.info.GetAreaInfoRsp;
import com.dispose.pojo.dto.protocol.device.info.GetDeviceInfoRsp;
import com.dispose.pojo.dto.protocol.device.info.GetPlatformVerInfoRsp;
import com.dispose.pojo.entity.DisposeCapacity;
import com.dispose.pojo.entity.DisposeDevice;
import com.dispose.test.common.QATestItem;
import com.dispose.test.common.TestPriority;
import com.dispose.test.common.VerifyProtoRespCallback;
import com.dispose.test.qa.exec.TestCaseRun;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
/**
* The type P 2 info.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/
@Slf4j
public class P2Info {
/**
* The constant BASE_P2_INFO_ID.
*/
public static final int BASE_P2_INFO_ID = 700;
/**
* The constant testItemArray.
*/
private static final QATestItem[] testItemArray = new QATestItem[]{
QATestItem.builder()
.id(BASE_P2_INFO_ID)
.name("获取节点信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/areaInfo")
.method(RequestMethod.GET)
.caseJsonValue("{}")
.rspClass(GetAreaInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetAreaInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertEquals((long) v.getMsgContent().getStatus(), e.getCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 5);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertNotNull(k.getNodeId());
Assert.assertNotNull(k.getTotalNetflow());
Assert.assertNotNull(k.getCapacityType());
Assert.assertNotEquals(k.getCapacityType().length, 0);
Assert.assertNotNull(k.getOnlineDevices());
});
})
.prepareCallback(P2Info::prepareDisposeDevice)
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 1)
.name("获取平台版本信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/platformVersion")
.method(RequestMethod.GET)
.caseJsonValue("{}")
.rspClass(GetPlatformVerInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetPlatformVerInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertEquals((long) v.getMsgContent().getStatus(), e.getCode());
Assert.assertNotNull(v.getMsgContent().getPlatVer());
Assert.assertNotEquals(v.getMsgContent().getPlatVer().getBuildTime().length(), 0);
Assert.assertNotEquals(v.getMsgContent().getPlatVer().getCommitDescribe().length(), 0);
Assert.assertNotEquals(v.getMsgContent().getPlatVer().getCommitId().length(), 0);
Assert.assertNotEquals(v.getMsgContent().getPlatVer().getCommitTime().length(), 0);
Assert.assertNotEquals(v.getMsgContent().getPlatVer().getGitBranch().length(), 0);
Assert.assertNotEquals(v.getMsgContent().getPlatVer().getTagName().length(), 0);
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 2)
.name("获取存在的一个设备版本信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceVersion")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"id\":[\"1\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 1);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertEquals(k.getId(), "1");
Assert.assertEquals(k.getIpAddr(), "127.0.0.1");
Assert.assertEquals(k.getIpPort(), Helper.ipPortNormalize(k.getIpPort(), HttpType.HTTP));
Assert.assertNotEquals(k.getVersion().length(), 0);
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 3)
.name("获取多个设备版本信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceVersion")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"id\":[\"1\"," +
"\"571\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 2);
v.getMsgContent().getItems().forEach(k -> {
if ("1".equals(k.getId())) {
Assert.assertEquals(k.getIpAddr(), "127.0.0.1");
Assert.assertEquals(k.getIpPort(), Helper.ipPortNormalize(k.getIpPort(), HttpType.HTTP));
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_OK.getCode());
} else {
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_NOSUCHDEVICE.getCode());
}
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 4)
.name("msgContent为空")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceVersion")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) P2Info::verifyJsonExceptionResp)
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 5)
.name("获取在线的一个设备信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceLinkStatus")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"id\":[\"1\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 1);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertEquals(k.getId(), "1");
Assert.assertEquals(k.getIpAddr(), "127.0.0.1");
Assert.assertEquals(k.getIpPort(), Helper.ipPortNormalize(k.getIpPort(), HttpType.HTTP));
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_OK.getCode());
Assert.assertEquals((long) k.getOnline(), 1);
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 6)
.name("获取在线的多个设备信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceLinkStatus")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"id\":[\"1\"," +
"\"2\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 2);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertEquals(k.getIpAddr(), "127.0.0.1");
Assert.assertEquals(k.getIpPort(), Helper.ipPortNormalize(k.getIpPort(), HttpType.HTTP));
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_OK.getCode());
Assert.assertEquals((long) k.getOnline(), 1);
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 7)
.name("获取不在线的一个设备信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceLinkStatus")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580," +
"\"msgContent\":{\"id\":[\"3\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 1);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertEquals(k.getId(), "3");
Assert.assertEquals(k.getIpAddr(), "127.0.0.1");
Assert.assertEquals(k.getIpPort(), Helper.ipPortNormalize(k.getIpPort(), HttpType.HTTP));
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_OK.getCode());
Assert.assertEquals((long) k.getOnline(), 0);
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 8)
.name("获取不在线的多个设备信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceLinkStatus")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"id\":[\"3\"," +
"\"4\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 2);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertEquals(k.getIpAddr(), "127.0.0.1");
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_OK.getCode());
Assert.assertEquals((long) k.getOnline(), 0);
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 9)
.name("获取不存在设备的在线信息")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceLinkStatus")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"id\":[\"593\"]}}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_OK)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) (v, e, c) -> {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertNotNull(v.getMsgContent().getItems());
Assert.assertEquals(v.getMsgContent().getItems().size(), 1);
v.getMsgContent().getItems().forEach(k -> {
Assert.assertEquals(k.getId(), "593");
Assert.assertEquals((long) k.getStatus(), ErrorCode.ERR_NOSUCHDEVICE.getCode());
});
})
.build(),
QATestItem.builder()
.id(BASE_P2_INFO_ID + 10)
.name("msgContent为空")
.priority(TestPriority.P2_PRIORITY)
.urlPath("/info/deviceLinkStatus")
.method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}")
.rspClass(GetDeviceInfoRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<GetDeviceInfoRsp>) P2Info::verifyJsonExceptionResp)
.build(),
};
/**
* Get test case qa test item [ ].
*
* @return the qa test item [ ]
*/
public static QATestItem[] getTestCase() {
return testItemArray;
}
/**
* Verify json exception resp.
*
* @param v the v
* @param e the e
* @param c the c
*/
private static void verifyJsonExceptionResp(ProtocolRespDTO<? extends BaseRespStatus> v, ErrorCode e,
TestCaseRun c) {
Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
Assert.assertEquals((long) v.getMsgContent().getStatus(), e.getCode());
}
/**
* Prepare dispose device.
*
* @param c the c
*/
private static void prepareDisposeDevice(TestCaseRun c) {
List<DisposeDevice> disposeDevices = new ArrayList<>();
List<DisposeCapacity> capacityList = new ArrayList<>();
capacityList.add(
DisposeCapacity.builder()
.capacityType(DisposeCapacityType.CLEANUP)
.objectType(DisposeObjectType.IP)
.ipType(IpAddrType.IPV4_IPV6)
.protectIp("0.0.0.0")
.reserveNetflow(30)
.build()
);
capacityList.add(
DisposeCapacity.builder()
.capacityType(DisposeCapacityType.BLACKHOOL)
.objectType(DisposeObjectType.IP_DOMAIN_URL)
.build()
);
capacityList.add(
DisposeCapacity.builder()
.capacityType(DisposeCapacityType.HIDEPEND)
.objectType(DisposeObjectType.IP)
.ipType(IpAddrType.IPV4_IPV6)
.protectIp("0.0.0.0")
.build()
);
capacityList.add(
DisposeCapacity.builder()
.capacityType(DisposeCapacityType.DETECTIVE)
.objectType(DisposeObjectType.IP)
.ipType(IpAddrType.IPV4_IPV6)
.protectIp("0.0.0.0")
.build()
);
for (int i = 0; i < 18; i++) {
List<DisposeCapacity> disposeCapacities = new ArrayList<>(capacityList);
Random rnd = new Random(System.currentTimeMillis());
int k = 0;
int n = rnd.nextInt(3);
Iterator<DisposeCapacity> it = disposeCapacities.iterator();
while (it.hasNext()) {
DisposeCapacity item = it.next();
if (item.getCapacityType() != DisposeCapacityType.CLEANUP && k++ <= n) {
it.remove();
}
}
DisposeDevice dev = DisposeDevice.builder()
.ipAddr("127.0.0.1")
.ipPort(String.valueOf(1000 + i))
.deviceType(DisposeDeviceType.VIRTUAL_DISPOSE)
.areaCode(i % 5)
.deviceName("实验室虚拟清洗设备")
.manufacturer("CMCC")
.model("Virtual")
.version("v0.0.1")
.userName("admin")
.password("admin")
.urlPath("")
.urlType(HttpType.HTTP)
.readme("实验室虚拟测试设备")
.devCapacity(disposeCapacities)
.build();
disposeDevices.add(dev);
}
c.getDisposeDeviceManagerService().addDisposeDevice(disposeDevices);
}
}