ca6826f00dfff26c100c11515560457232585326
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / core / SslKeyStoreTest.java
1 /*
2  * Copyright (c) 2014 Brocade Communications Systems, Inc. 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.impl.core;
10
11 import static org.junit.Assert.assertNotNull;
12
13 import java.io.InputStream;
14
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.mockito.MockitoAnnotations;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
19
20 /**
21  *
22  * @author jameshall
23  */
24 public class SslKeyStoreTest {
25
26     /**
27      * Sets up test environment
28      */
29     @Before
30     public void setUp() {
31         MockitoAnnotations.initMocks(this);
32     }
33
34     /**
35      * Test keystore file access - via classpath
36      * @throws Exception 
37      */
38     @Test
39     public void testAsInputStream() throws Exception {
40         InputStream inputStream = SslKeyStore.asInputStream("/key.bin", PathType.CLASSPATH);
41         assertNotNull( inputStream );
42         inputStream.close();
43     }
44
45     /**
46      * Test keystore file access - via relative path
47      * @throws Exception 
48      */
49     @Test
50     public void testAsInputStream2() throws Exception {
51         InputStream inputStream = SslKeyStore.asInputStream("src/test/resources/key.bin", PathType.PATH);
52         assertNotNull( inputStream );
53         inputStream.close();
54     }
55 }