|
|
@ -24,6 +24,7 @@ import org.thingsboard.server.transport.lwm2m.AbstractLwM2MIntegrationTest; |
|
|
import java.util.Set; |
|
|
import java.util.Set; |
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
import java.util.concurrent.ScheduledExecutorService; |
|
|
import java.util.concurrent.ScheduledExecutorService; |
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
import java.util.function.Predicate; |
|
|
import java.util.function.Predicate; |
|
|
|
|
|
|
|
|
import static org.eclipse.leshan.core.LwM2mId.ACCESS_CONTROL; |
|
|
import static org.eclipse.leshan.core.LwM2mId.ACCESS_CONTROL; |
|
|
@ -52,7 +53,6 @@ public abstract class AbstractRpcLwM2MIntegrationTest extends AbstractLwM2MInteg |
|
|
|
|
|
|
|
|
protected String RPC_TRANSPORT_CONFIGURATION; |
|
|
protected String RPC_TRANSPORT_CONFIGURATION; |
|
|
|
|
|
|
|
|
protected static final String ENDPOINT_RPC = "deviceEndpointRpc"; |
|
|
|
|
|
protected ScheduledExecutorService executor; |
|
|
protected ScheduledExecutorService executor; |
|
|
protected TbTestWebSocketClient wsClient; |
|
|
protected TbTestWebSocketClient wsClient; |
|
|
protected String deviceId; |
|
|
protected String deviceId; |
|
|
@ -72,19 +72,18 @@ public abstract class AbstractRpcLwM2MIntegrationTest extends AbstractLwM2MInteg |
|
|
protected String objectIdVer_19; |
|
|
protected String objectIdVer_19; |
|
|
protected String objectIdVer_50 = "/50"; |
|
|
protected String objectIdVer_50 = "/50"; |
|
|
protected String objectIdVer_3303; |
|
|
protected String objectIdVer_3303; |
|
|
|
|
|
protected static AtomicInteger endpointSequence = new AtomicInteger(); |
|
|
|
|
|
|
|
|
public AbstractRpcLwM2MIntegrationTest(){ |
|
|
public AbstractRpcLwM2MIntegrationTest(){ |
|
|
setResources(resources); |
|
|
setResources(resources); |
|
|
setEndpoint(ENDPOINT_RPC); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Before |
|
|
@Before |
|
|
public void beforeTest() throws Exception { |
|
|
public void beforeTest() throws Exception { |
|
|
|
|
|
setEndpoint("deviceEndpointRpc" + endpointSequence.incrementAndGet()); |
|
|
init(); |
|
|
init(); |
|
|
createNewClient (SECURITY, COAP_CONFIG, true); |
|
|
createNewClient (SECURITY, COAP_CONFIG, true); |
|
|
|
|
|
|
|
|
Thread.sleep(1000); |
|
|
|
|
|
|
|
|
|
|
|
expectedObjects = ConcurrentHashMap.newKeySet(); |
|
|
expectedObjects = ConcurrentHashMap.newKeySet(); |
|
|
expectedObjectIdVers = ConcurrentHashMap.newKeySet(); |
|
|
expectedObjectIdVers = ConcurrentHashMap.newKeySet(); |
|
|
expectedInstances = ConcurrentHashMap.newKeySet(); |
|
|
expectedInstances = ConcurrentHashMap.newKeySet(); |
|
|
@ -179,14 +178,10 @@ public abstract class AbstractRpcLwM2MIntegrationTest extends AbstractLwM2MInteg |
|
|
"}"; |
|
|
"}"; |
|
|
createDeviceProfile(RPC_TRANSPORT_CONFIGURATION); |
|
|
createDeviceProfile(RPC_TRANSPORT_CONFIGURATION); |
|
|
|
|
|
|
|
|
Thread.sleep(1000); |
|
|
NoSecClientCredentials credentials = createNoSecClientCredentials(endpoint); |
|
|
|
|
|
|
|
|
NoSecClientCredentials credentials = createNoSecClientCredentials(ENDPOINT_RPC); |
|
|
|
|
|
final Device device = createDevice(credentials); |
|
|
final Device device = createDevice(credentials); |
|
|
deviceId = device.getId().getId().toString(); |
|
|
deviceId = device.getId().getId().toString(); |
|
|
|
|
|
|
|
|
Thread.sleep(1000); |
|
|
|
|
|
|
|
|
|
|
|
client.start(); |
|
|
client.start(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|