Skip to content

Commit 2d0c750

Browse files
committed
fix
1 parent f8888a1 commit 2d0c750

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

integration-test/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@
195195
<artifactId>junit-jupiter-api</artifactId>
196196
<scope>test</scope>
197197
</dependency>
198+
<dependency>
199+
<groupId>io.github.Caideyipi</groupId>
200+
<version>0.0.1</version>
201+
<artifactId>iotdb_opc_server</artifactId>
202+
</dependency>
198203
<dependency>
199204
<groupId>org.awaitility</groupId>
200205
<artifactId>awaitility</artifactId>

integration-test/src/test/java/org/apache/iotdb/pipe/it/single/IoTDBPipeOPCUAIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public void testOPCUAServerSink() throws Exception {
118118
final long startTime = System.currentTimeMillis();
119119
while (true) {
120120
try {
121-
value = opcUaClient.readValue(0, TimestampsToReturn.Both, new NodeId(2, "root/db/opc")).get();
121+
value =
122+
opcUaClient.readValue(0, TimestampsToReturn.Both, new NodeId(2, "root/db/opc")).get();
122123
Assert.assertEquals(new DateTime(timestampToUtc(2)), value.getSourceTime());
123124
Assert.assertEquals(new Variant(2.0), value.getValue());
124125
Assert.assertEquals(StatusCode.UNCERTAIN, value.getStatusCode());
@@ -167,6 +168,9 @@ public void testOPCUAServerSink() throws Exception {
167168
}
168169
}
169170

171+
@Test
172+
public void testOPCUAClientSink() throws Exception {}
173+
170174
@Test
171175
public void testOPCUASinkInTableModel() throws Exception {
172176
try (final SyncConfigNodeIServiceClient client =

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaSink.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ public void transfer(final TabletInsertionEvent tabletInsertionEvent) throws Exc
449449
nameSpace.transfer(tablet, isTableModel, this);
450450
} else if (Objects.nonNull(client)) {
451451
client.transfer(tablet, this);
452+
} else {
453+
throw new PipeException(
454+
"No OPC client or server is specified when transferring tablet");
452455
}
453456
});
454457
}

0 commit comments

Comments
 (0)