2 * Copyright (c) 2014 Brocade Communications Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.openflowjava.protocol.impl.core;
11 import static org.junit.Assert.assertNotNull;
12 import static org.junit.Assert.assertTrue;
14 import java.io.InputStream;
16 import org.junit.Before;
17 import org.junit.Test;
18 import org.mockito.MockitoAnnotations;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
25 public class SslKeyStoreTest {
28 * Sets up test environment
32 MockitoAnnotations.initMocks(this);
36 * Test keystore file access
40 public void testAsInputStream() throws Exception {
41 InputStream inputStream = SslKeyStore.asInputStream("src/main/resources/key.bin", PathType.PATH);
42 assertNotNull( inputStream );
47 * Test certificate password retrieval
50 public void testGetCertificatePassword() {
51 char[] password = SslKeyStore.getCertificatePassword();
52 assertNotNull(password);
53 assertTrue (password.length>0) ;
57 * Test keystore password retrieval
60 public void testGetKeyStorePassword() {
61 char[] password = SslKeyStore.getKeyStorePassword() ;
62 assertNotNull(password);
63 assertTrue (password.length>0) ;