Home | History | Annotate | Download | only in testcases
      1 /**
      2  * @license
      3  * Copyright 2016 Google Inc. All rights reserved.
      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
      7  *
      8  *   http://www.apache.org/licenses/LICENSE-2.0
      9  *
     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.
     15  */
     16 
     17 package com.google.security.wycheproof;
     18 
     19 import java.security.Provider;
     20 import java.security.Security;
     21 import java.util.TreeSet;
     22 import junit.framework.TestCase;
     23 
     24 /** Not a true test: reports information about the provider. */
     25 public class BasicTest extends TestCase {
     26 
     27   /** List all algorithms known to the security manager. */
     28   public void testListAllAlgorithms() {
     29     for (Provider p : Security.getProviders()) {
     30       System.out.println();
     31       System.out.println("Provider:" + p.getName());
     32       // Using a TreeSet here, because the elements are sorted.
     33       TreeSet<String> list = new TreeSet<String>();
     34       for (Object key : p.keySet()) {
     35         list.add((String) key);
     36       }
     37       for (String algorithm : list) {
     38         if (algorithm.startsWith("Alg.Alias.")) {
     39           continue;
     40         }
     41         System.out.println(algorithm);
     42       }
     43     }
     44   }
     45 }
     46