Search in sources :

Example 6 with FooType

use of org.apache.cxf.test.assertions.foo.FooType in project cxf by apache.

the class JaxbAssertionTest method testBasic.

@Test
public void testBasic() {
    JaxbAssertion<FooType> assertion = new JaxbAssertion<FooType>();
    assertNull(assertion.getName());
    assertNull(assertion.getData());
    assertTrue(!assertion.isOptional());
    assertEquals(Constants.TYPE_ASSERTION, assertion.getType());
    FooType data = new FooType();
    data.setName("CXF");
    data.setNumber(2);
    QName qn = new QName("http://cxf.apache.org/test/assertions/foo", "FooType");
    assertion.setName(qn);
    assertion.setData(data);
    assertion.setOptional(true);
    assertSame(qn, assertion.getName());
    assertSame(data, assertion.getData());
    assertTrue(assertion.isOptional());
    assertEquals(Constants.TYPE_ASSERTION, assertion.getType());
}
Also used : FooType(org.apache.cxf.test.assertions.foo.FooType) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Aggregations

QName (javax.xml.namespace.QName)6 FooType (org.apache.cxf.test.assertions.foo.FooType)6 Test (org.junit.Test)6 PrimitiveAssertion (org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion)2 Assertion (org.apache.neethi.Assertion)2 Policy (org.apache.neethi.Policy)2 PolicyComponent (org.apache.neethi.PolicyComponent)2 InputStream (java.io.InputStream)1 List (java.util.List)1 All (org.apache.neethi.All)1 ExactlyOne (org.apache.neethi.ExactlyOne)1 IMocksControl (org.easymock.IMocksControl)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1