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 javax.crypto.interfaces.DHPrivateKey;
24: import javax.crypto.spec.DHParameterSpec;
25:
26: import junit.framework.TestCase;
27:
28: import java.math.BigInteger;
29:
30: /**
31: * Tests for <code>DHPrivateKey</code> class field
32: *
33: */
34: public class DHPrivateKeyTest extends TestCase {
35:
36: /**
37: * Constructor for DHPrivateKey.
38: *
39: * @param arg0
40: */
41: public DHPrivateKeyTest(String arg0) {
42: super (arg0);
43: }
44:
45: /**
46: * Test for <code>serialVersionUID</code> field
47: */
48: public void testField() {
49: checkDHPrivateKey key = new checkDHPrivateKey();
50: assertEquals("Incorrect serialVersionUID", key.getSerVerUID(), //DHPrivateKey.serialVersionUID
51: 2211791113380396553L);
52: }
53:
54: public class checkDHPrivateKey implements DHPrivateKey {
55: public String getAlgorithm() {
56: return "SecretKey";
57: }
58:
59: public String getFormat() {
60: return "Format";
61: }
62:
63: public byte[] getEncoded() {
64: return new byte[0];
65: }
66:
67: public long getSerVerUID() {
68: return serialVersionUID;
69: }
70:
71: public BigInteger getX() {
72: return null;
73: }
74:
75: public DHParameterSpec getParams() {
76: return null;
77: }
78: }
79: }
|