2 * Copyright (C) 2007 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package tests.security.interfaces;
17 import dalvik.annotation.TestLevel;
18 import dalvik.annotation.TestTargetNew;
19 import dalvik.annotation.TestTargetClass;
21 import junit.framework.TestCase;
23 import java.math.BigInteger;
24 import java.security.interfaces.DSAParams;
25 import java.security.spec.DSAParameterSpec;
27 @TestTargetClass(DSAParams.class)
28 public class DSAParamsTest extends TestCase {
30 private final BigInteger p = new BigInteger("4");
31 private final BigInteger q = BigInteger.TEN;
32 private final BigInteger g = BigInteger.ZERO;
35 * @tests java.security.interfaces.DSAParams
39 level = TestLevel.COMPLETE,
44 public void test_getG() {
45 DSAParams params = new DSAParameterSpec(p, q, g);
46 assertEquals("Invalid G", g, params.getG());
50 * @tests java.security.interfaces.DSAParams
54 level = TestLevel.COMPLETE,
59 public void test_getP() {
60 DSAParams params = new DSAParameterSpec(p, q, g);
61 assertEquals("Invalid P", p, params.getP());
65 * @tests java.security.interfaces.DSAParams
69 level = TestLevel.COMPLETE,
74 public void test_getQ() {
75 DSAParams params = new DSAParameterSpec(p, q, g);
76 assertEquals("Invalid Q", q, params.getQ());