FileDocCategorySizeDatePackage
PolicyTest.javaAPI DocExample4689Tue May 29 16:57:36 BST 2007com.sun.xml.ws.policy

PolicyTest

public class PolicyTest extends TestCase
author
Marek Potociar (marek.potociar@sun.com)

Fields Summary
Constructors Summary
public PolicyTest(String testName)

        super(testName);
    
Methods Summary
protected voidsetUp()

    
protected voidtearDown()

    
public voidtestEmptyPolicyFactoryMethodReturnsConstantObjectOnNullArguments()

        Policy tested = Policy.createEmptyPolicy(null, null);
        Policy expected = Policy.createEmptyPolicy();
        
        assertTrue("The createEmptyPolicy(String, String) factory method should return the same instance as createEmptyPolicy()", tested == expected);
    
public voidtestEmptyPolicyFactoryMethodReturnsProperObjectOnNonNullArguments()

        Policy tested = Policy.createEmptyPolicy("aaa", "bbb");
        
        assertEquals("The name is not initialized as expected", tested.getName(), "aaa");
        assertEquals("The ID is not initialized as expected", tested.getId(), "bbb");
    
public voidtestEmptyPolicyReturnsTrueOnIsEmptyAndFalseOnIsNull()

        Policy tested = Policy.createEmptyPolicy();
        assertTrue("Empty policy must return 'true' on isEmpty() call", tested.isEmpty());
        assertFalse("Empty policy must return 'false' on isNull() call", tested.isNull());
        
    
public voidtestNullPolicyFactoryMethodReturnsConstantObjectOnNullArguments()

        Policy tested = Policy.createNullPolicy(null, null);
        Policy expected = Policy.createNullPolicy();
        
        assertTrue("The createNullPolicy(String, String) factory method should return the same instance as createNullPolicy()", tested == expected);
    
public voidtestNullPolicyFactoryMethodReturnsProperObjectOnNonNullArguments()

        Policy tested = Policy.createNullPolicy("aaa", "bbb");
        
        assertEquals("The name is not initialized as expected", tested.getName(), "aaa");
        assertEquals("The ID is not initialized as expected", tested.getId(), "bbb");
    
public voidtestNullPolicyReturnsFalseOnIsEmptyAndTrueOnIsNull()

        Policy tested = Policy.createNullPolicy();
        assertFalse("Null policy must return 'false' on isEmpty() call", tested.isEmpty());
        assertTrue("Null policy must return 'true' on isNull() call", tested.isNull());