Search in sources :

Example 6 with BuildInfo

use of org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo in project milo by eclipse.

the class OpcUaServerConfigTest method testCopy.

@Test
public void testCopy() throws IOException {
    DefaultTrustListManager trustListManager = new DefaultTrustListManager(Files.createTempDir());
    ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
    OpcUaServerConfig original = OpcUaServerConfig.builder().setCertificateManager(new DefaultCertificateManager()).setTrustListManager(trustListManager).setCertificateValidator(new DefaultServerCertificateValidator(trustListManager)).setIdentityValidator(AnonymousIdentityValidator.INSTANCE).setBuildInfo(new BuildInfo("a", "b", "c", "d", "e", DateTime.MIN_VALUE)).setLimits(new OpcUaServerConfigLimits() {
    }).setScheduledExecutorService(scheduledExecutorService).build();
    OpcUaServerConfig copy = OpcUaServerConfig.copy(original).build();
    assertEquals(copy.getIdentityValidator(), original.getIdentityValidator());
    assertEquals(copy.getBuildInfo(), original.getBuildInfo());
    assertEquals(copy.getLimits(), original.getLimits());
    assertEquals(copy.getScheduledExecutorService(), original.getScheduledExecutorService());
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) DefaultTrustListManager(org.eclipse.milo.opcua.stack.core.security.DefaultTrustListManager) DefaultCertificateManager(org.eclipse.milo.opcua.stack.core.security.DefaultCertificateManager) BuildInfo(org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo) DefaultServerCertificateValidator(org.eclipse.milo.opcua.stack.server.security.DefaultServerCertificateValidator) Test(org.testng.annotations.Test)

Aggregations

BuildInfo (org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo)6 OpcUaServer (org.eclipse.milo.opcua.sdk.server.OpcUaServer)3 DefaultCertificateManager (org.eclipse.milo.opcua.stack.core.security.DefaultCertificateManager)3 DefaultTrustListManager (org.eclipse.milo.opcua.stack.core.security.DefaultTrustListManager)3 DateTime (org.eclipse.milo.opcua.stack.core.types.builtin.DateTime)3 DefaultServerCertificateValidator (org.eclipse.milo.opcua.stack.server.security.DefaultServerCertificateValidator)3 File (java.io.File)2 KeyPair (java.security.KeyPair)2 X509Certificate (java.security.cert.X509Certificate)2 ServerTypeNode (org.eclipse.milo.opcua.sdk.client.model.nodes.objects.ServerTypeNode)2 OpcUaServerConfig (org.eclipse.milo.opcua.sdk.server.api.config.OpcUaServerConfig)2 UaException (org.eclipse.milo.opcua.stack.core.UaException)2 UaRuntimeException (org.eclipse.milo.opcua.stack.core.UaRuntimeException)2 SelfSignedHttpsCertificateBuilder (org.eclipse.milo.opcua.stack.core.util.SelfSignedHttpsCertificateBuilder)2 EndpointConfiguration (org.eclipse.milo.opcua.stack.server.EndpointConfiguration)2 Lists (com.google.common.collect.Lists)1 List (java.util.List)1 Locale (java.util.Locale)1 UUID (java.util.UUID)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1