01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Vera Y. Petrashkova
20: * @version $Revision$
21: */package org.apache.harmony.crypto.tests.javax.crypto.interfaces;
22:
23: import java.math.BigInteger;
24:
25: import javax.crypto.interfaces.PBEKey;
26:
27: import junit.framework.TestCase;
28:
29: /**
30: * Tests for <code>PBEKey</code> class field
31: *
32: */
33: public class PBEKeyTest extends TestCase {
34:
35: /**
36: * Constructor for PBEKey.
37: *
38: * @param arg0
39: */
40: public PBEKeyTest(String arg0) {
41: super (arg0);
42: }
43:
44: /**
45: * Test for <code>serialVersionUID</code> field
46: */
47: public void testField() {
48: checkPBEKey key = new checkPBEKey();
49: assertEquals("Incorrect serialVersionUID", key.getSerVerUID(), //PBEKey.serialVersionUID
50: -1430015993304333921L);
51: }
52:
53: public class checkPBEKey implements PBEKey {
54: public String getAlgorithm() {
55: return "SecretKey";
56: }
57:
58: public String getFormat() {
59: return "Format";
60: }
61:
62: public byte[] getEncoded() {
63: return new byte[0];
64: }
65:
66: public long getSerVerUID() {
67: return serialVersionUID;
68: }
69:
70: public BigInteger getY() {
71: return null;
72: }
73:
74: public int getIterationCount() {
75: return 0;
76: }
77:
78: public byte[] getSalt() {
79: return new byte[0];
80: }
81:
82: public char[] getPassword() {
83: return new char[0];
84: }
85: }
86: }
|