1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * 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 */ 21 22 package org.apache.harmony.crypto.tests.javax.crypto.interfaces; 23 24 import java.math.BigInteger; 25 26 import javax.crypto.interfaces.DHPublicKey; 27 import javax.crypto.spec.DHParameterSpec; 28 29 import junit.framework.TestCase; 30 31 32 /** 33 * Tests for <code>DHPublicKey</code> class field 34 */ 35 public class DHPublicKeyTest extends TestCase { 36 37 public static void main(String[] args) { 38 } 39 40 /** 41 * Constructor for DHPublicKey. 42 * 43 * @param arg0 44 */ 45 public DHPublicKeyTest(String arg0) { 46 super(arg0); 47 } 48 49 /** 50 * Test for <code>serialVersionUID</code> field 51 */ 52 public void testField() { 53 checkDHPublicKey key = new checkDHPublicKey(); 54 assertEquals("Incorrect serialVersionUID", 55 key.getSerVerUID(), //DHPublicKey.serialVersionUID 56 -6628103563352519193L); 57 } 58 59 public class checkDHPublicKey implements DHPublicKey { 60 public String getAlgorithm() { 61 return "SecretKey"; 62 } 63 64 public String getFormat() { 65 return "Format"; 66 } 67 68 public byte[] getEncoded() { 69 return new byte[0]; 70 } 71 72 public long getSerVerUID() { 73 return serialVersionUID; 74 } 75 76 public BigInteger getY() { 77 return null; 78 } 79 80 public DHParameterSpec getParams() { 81 return null; 82 } 83 } 84 } 85