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