Skip to content

Commit

Permalink
Attempt to stabilize OPC UA chunk factory tests.
Browse files Browse the repository at this point in the history
Related to #1764.

Signed-off-by: Łukasz Dywicki <[email protected]>
  • Loading branch information
splatch committed Sep 30, 2024
1 parent 33700a6 commit 33bfcbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

public class ChunkFactory {

public static int SYMMETRIC_SECURITY_HEADER_SIZE = 4;
public static final int ASYMMETRIC_SECURITY_HEADER_SIZE = 59;
public static final int SYMMETRIC_SECURITY_HEADER_SIZE = 4;

public Chunk create(boolean asymmetric, Conversation conversation) {
return create(asymmetric,
Expand All @@ -48,7 +49,7 @@ public Chunk create(boolean asymmetric, boolean encrypted, boolean signed, Secur

if (securityPolicy == SecurityPolicy.NONE) {
return new Chunk(
asymmetric ? 59 : SYMMETRIC_SECURITY_HEADER_SIZE,
asymmetric ? ASYMMETRIC_SECURITY_HEADER_SIZE : SYMMETRIC_SECURITY_HEADER_SIZE,
1,
1,
securityPolicy.getSymmetricSignatureSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.plc4x.java.opcua.TestCertificateGenerator;
import org.apache.plc4x.java.opcua.readwrite.MessageSecurityMode;
import org.apache.plc4x.java.opcua.readwrite.OpcuaProtocolLimits;
Expand All @@ -38,7 +39,7 @@
@DisableOnJenkinsFlag
class ChunkFactoryTest {

public static final Map<Integer, Entry<PrivateKey, X509Certificate>> CERTIFICATES = new HashMap<>();
public static final Map<Integer, Entry<PrivateKey, X509Certificate>> CERTIFICATES = new ConcurrentHashMap<>();

private OpcuaProtocolLimits limits = new OpcuaProtocolLimits(
8196,
Expand Down

0 comments on commit 33bfcbd

Please sign in to comment.