Home | History | Annotate | Download | only in spec
      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 Vladimir N. Molotkov
     20 * @version $Revision$
     21 */
     22 
     23 package tests.security.spec;
     24 
     25 import junit.framework.TestCase;
     26 
     27 import java.security.spec.ECGenParameterSpec;
     28 
     29 /**
     30  * Tests for <code>ECGenParameterSpec</code> class fields and methods.
     31  *
     32  */
     33 public class ECGenParameterSpecTest extends TestCase {
     34 
     35     //
     36     // Tests
     37     //
     38 
     39     /**
     40      * Test #1 for <code>ECGenParameterSpec</code> constructor<br>
     41      *
     42      * Assertion: creates new object of <code>ECGenParameterSpec</code> class
     43      * using valid <code>name</code>
     44      */
     45     public final void testECGenParameterSpec01() {
     46         new ECGenParameterSpec("someName");
     47     }
     48 
     49     /**
     50      * Test #2 for <code>ECGenParameterSpec</code> constructor<br>
     51      *
     52      * Assertion: throws NullPointerException
     53      * if <code>name</code> is <code>null</code>
     54      */
     55     public final void testECGenParameterSpec02() {
     56         try {
     57             new ECGenParameterSpec(null);
     58             fail("NPE expected");
     59         } catch (NullPointerException ok) {}
     60     }
     61 
     62     /**
     63      * Test for <code>getName()</code> method<br>
     64      *
     65      * Assertion: returns the <code>name</code>
     66      */
     67     public final void testGetName() {
     68         String name = "someName";
     69         ECGenParameterSpec ps = new ECGenParameterSpec(name);
     70         assertEquals(name, ps.getName());
     71     }
     72 
     73 }
     74