Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bouncycastle.asn1.test;
 
 
 
 public abstract class ASN1UnitTest
     extends SimpleTest
    protected void checkMandatoryField(String nameASN1Encodable expectedASN1Encodable present)
    {
        if (!expected.equals(present))
        {
            fail(name + " field doesn't match.");
        }
    }
    protected void checkMandatoryField(String nameString expectedString present)
    {
        if (!expected.equals(present))
        {
            fail(name + " field doesn't match.");
        }
    }
    protected void checkMandatoryField(String namebyte[] expectedbyte[] present)
    {
        if (!areEqual(expectedpresent))
        {
            fail(name + " field doesn't match.");
        }
    }
    protected void checkMandatoryField(String nameint expectedint present)
    {
        if (expected != present)
        {
            fail(name + " field doesn't match.");
        }
    }
    protected void checkOptionalField(String nameASN1Encodable expectedASN1Encodable present)
    {
        if (expected != null)
        {
            if (!expected.equals(present))
            {
                fail(name + " field doesn't match.");
            }
        }
        else if (present != null)
        {
            fail(name + " field found when none expected.");
        }
    }
    protected void checkOptionalField(String nameString expectedString present)
    {
        if (expected != null)
        {
            if (!expected.equals(present))
            {
                fail(name + " field doesn't match.");
            }
        }
        else if (present != null)
        {
            fail(name + " field found when none expected.");
        }
    }
    protected void checkOptionalField(String nameBigInteger expectedBigInteger present)
    {
        if (expected != null)
        {
            if (!expected.equals(present))
            {
                fail(name + " field doesn't match.");
            }
        }
        else if (present != null)
        {
            fail(name + " field found when none expected.");
        }
    }
New to GrepCode? Check out our FAQ X