Test Description and Specification for JAXBContext tests

The JAXBContext class provides the client's entry point to the Jakarta XML Binding API. It provides an abstraction for managing the XML/Java binding information necessary to implement the Jakarta XML Binding binding framework operations: unmarshal, marshal and validate.



protected JAXBContext()

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, constructor protected JAXBContext().

Assertion testing

Pre-conditions Assertion Expected results Test Case ID
called from within a constructor of the child class Default constructor throws no exceptions. no exceptions Ctor001

Test Descriptions


See:
Test descriptions for JAXBContextTests.java (Ctor001)


public void generateSchema(SchemaOutputResolver outputResolver) throws IOException

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, method public void generateSchema(SchemaOutputResolver outputResolver) throws IOException.

Assertion testing

Assertion Test Case ID
generateSchema(SchemaOutputResolver) generates schema for jaxb annotated classes schemagen001

Test Descriptions

Test cases included:
Ctor001, newInstance005, newInstance006, newInstance007, newInstance007a, newInstance008, newInstance009, newInstance010, newInstance011, newInstance012, schemagen001.

ItemValue
title General tests of constructors and newInstance methods
source JAXBContextTests.java CustomJAXBContext.java ContextFactory.java package_with_jaxb_index/PurchaseOrderType.java package_with_jaxb_index/Address.java package_with_jaxb_index/Items.java package_with_jaxb_index/package-info.java package_without_jaxb_index/PurchaseOrderType.java package_without_jaxb_index/Address.java package_without_jaxb_index/Items.java package_without_jaxb_index/package-info.java colliding_type_names/PurchaseOrderType.java colliding_type_names/Address.java colliding_type_names/Items.java colliding_type_names/package-info.java
executeClass javasoft.sqe.tests.api.jakarta.xml.bind.JAXBContext.JAXBContextTests
keywords runtime positive
executeArgs -TestCaseID ALL


public static JAXBContext newInstance( Class... classesToBeBound ) throws JAXBException

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, method public static JAXBContext newInstance( Class... classesToBeBound ) throws JAXBException.

Assertion testing

Assertion Test Case ID
newInstance(Class ...) creates a jaxbContext with no exception if valid classes are passed as a parameter newInstance007
IllegalArgumentException - if the parameter contains null (i.e., newInstance(null);) newInstance007a
newInstance(Class..) throws JAXBException when class tree have colliding type names. newInstance009
newInstance(Class...) with empty parameter list creates a new instance of JAXBContext that "knows" about spec-defined classes. newInstance010

Test Descriptions


See:
Test descriptions for JAXBContextTests.java (newInstance007, newInstance007a, newInstance009, newInstance010)


public static JAXBContext newInstance( Class[] classesToBeBound, Map properties ) throws JAXBException

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, method public static JAXBContext newInstance( Class[] classesToBeBound, Map properties ) throws JAXBException.

Assertion testing

Assertion Test Case ID
newInstance(Class,Map) creates a jaxbContext with no exception if valid classes are passed as a parameter newInstance008

Test Descriptions


See:
Test descriptions for JAXBContextTests.java (newInstance008)


public static JAXBContext newInstance(String contextPath) throws JAXBException

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, method public static JAXBContext newInstance(String contextPath) throws JAXBException.

Assertion testing

Assertion Test Case ID
newInstance(String) creates a jaxbContext with no exception if valid jaxb.index exists in the package, passed as a parameter. Package contains jaxb-annotated classes and a valid jaxb.index file. newInstance011
newInstance(String) throws a JAXBException when package does not contain neither jaxb.index file nor ObjectFactory class. newInstance012

Test Descriptions


See:
Test descriptions for JAXBContextTests.java (newInstance011, newInstance012)


public static JAXBContext newInstance(java.lang.String contextPath) throws JAXBException

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, method public static JAXBContext newInstance(java.lang.String contextPath) throws JAXBException.

Boundary value analysis

contextPath Expected results Test Case ID
unexistent JAXBException newInstance006

Assertion testing

Pre-conditions Assertion Expected results Test Case ID
contextPath contains unexistent package, class loader is the test class loader Throws JAXBException if unable to locate a value for the context factory property. JAXBException is thrown newInstance006

Test Descriptions


See:
Test descriptions for JAXBContextTests.java (newInstance006)


public static JAXBContext newInstance(java.lang.String contextPath, java.lang.ClassLoader classLoader) throws JAXBException

Description

Domain testing of input and output conditions, and external pre-conditions for class JAXBContext, method public static JAXBContext newInstance(java.lang.String contextPath, java.lang.ClassLoader classLoader) throws JAXBException.

Boundary value analysis

contextPath classLoader Expected results Test Case ID
unexistent test class loader JAXBException newInstance005

Assertion testing

Pre-conditions Assertion Expected results Test Case ID
contextPath contains unexistent package, class loader is the test class loader Throws JAXBException if unable to locate a value for the context factory property. JAXBException is thrown newInstance005

Test Descriptions


See:
Test descriptions for JAXBContextTests.java (newInstance005)


Last updated: 07/01/24
Copyright © 2017, 2020 Oracle and/or its affiliates. All rights reserved.