All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.bouncycastle.asn1.test.ObjectIdentifierTest Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.fitbur.bouncycastle.asn1.test;

import com.fitbur.bouncycastle.asn1.ASN1ObjectIdentifier;
import com.fitbur.bouncycastle.util.test.SimpleTest;
import com.fitbur.bouncycastle.util.test.TestResult;

public class ObjectIdentifierTest
    extends SimpleTest
{
    public String getName()
    {
        return "ObjectIdentifier";
    }

    public void performTest()
        throws Exception
    {
        // exercise the object cache
        for (int i = 0; i < 1024; i++)
        {
            for (int j = 0; j != 17000; j++)
            {
                byte[] encoded = new ASN1ObjectIdentifier("1.1." + i + "." + j).getEncoded();

                ASN1ObjectIdentifier.getInstance(encoded);
            }
        }
    }

    public static void main(
        String[] args)
    {
        ObjectIdentifierTest    test = new ObjectIdentifierTest();
        TestResult result = test.perform();

        System.out.println(result);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy