2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.api.connection;
\r
11 import static org.junit.Assert.*;
\r
13 import org.junit.Test;
\r
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
\r
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
\r
18 * @author michal.polkorab
\r
21 public class TlsConfigurationImplTest {
\r
24 * Test correct TlsConfigurationImpl creation
\r
27 public void test() {
\r
28 TlsConfigurationImpl config = new TlsConfigurationImpl(KeystoreType.JKS,
\r
29 "user/dir", PathType.CLASSPATH, KeystoreType.PKCS12, "/var/lib", PathType.PATH);
\r
30 assertEquals("Wrong keystore location", "/var/lib", config.getTlsKeystore());
\r
31 assertEquals("Wrong truststore location", "user/dir", config.getTlsTruststore());
\r
32 assertEquals("Wrong keystore type", KeystoreType.PKCS12, config.getTlsKeystoreType());
\r
33 assertEquals("Wrong truststore type", KeystoreType.JKS, config.getTlsTruststoreType());
\r
34 assertEquals("Wrong keystore path type", PathType.PATH, config.getTlsKeystorePathType());
\r
35 assertEquals("Wrong truststore path type", PathType.CLASSPATH, config.getTlsTruststorePathType());
\r
36 assertEquals("Wrong certificate password", "opendaylight", config.getCertificatePassword());
\r
37 assertEquals("Wrong keystore password", "opendaylight", config.getKeystorePassword());
\r
38 assertEquals("Wrong truststore password", "opendaylight", config.getTruststorePassword());
\r