Search in sources :

Example 1 with CustomCharacterEscapeHandler

use of org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler in project eclipselink by eclipse-ee4j.

the class PropertyTestCases method testMarshallerCharacterEscapeHandler2.

public void testMarshallerCharacterEscapeHandler2() throws Exception {
    String SUN_CHARACTER_ESCAPE_HANDLER = "org.glassfish.jaxb.characterEscapeHandler";
    String SUN_JSE_CHARACTER_ESCAPE_HANDLER = "com.sun.xml.internal.bind.characterEscapeHandler";
    CharacterEscapeHandler handler = new CustomCharacterEscapeHandler();
    m.setProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER, handler);
    assertEquals(handler, m.getProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER));
    m.setProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER, null);
    assertNull(m.getProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER));
    m.setProperty(SUN_CHARACTER_ESCAPE_HANDLER, handler);
    assertEquals(handler, m.getProperty(SUN_CHARACTER_ESCAPE_HANDLER));
    m.setProperty(SUN_CHARACTER_ESCAPE_HANDLER, null);
    assertNull(m.getProperty(SUN_CHARACTER_ESCAPE_HANDLER));
    m.setProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER, handler);
    assertEquals(handler, m.getProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER));
    m.setProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER, null);
    assertNull(m.getProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER));
}
Also used : CharacterEscapeHandler(org.eclipse.persistence.oxm.CharacterEscapeHandler) CustomCharacterEscapeHandler(org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler) CustomCharacterEscapeHandler(org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler)

Example 2 with CustomCharacterEscapeHandler

use of org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler in project eclipselink by eclipse-ee4j.

the class PropertyTestCases method testMarshallerCharacterEscapeHandler.

public void testMarshallerCharacterEscapeHandler() throws Exception {
    String SUN_CHARACTER_ESCAPE_HANDLER_MARSHALLER = "org.glassfish.jaxb.marshaller.CharacterEscapeHandler";
    String SUN_JSE_CHARACTER_ESCAPE_HANDLER_MARSHALLER = "com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler";
    CharacterEscapeHandler handler = new CustomCharacterEscapeHandler();
    m.setProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER, handler);
    assertEquals(handler, m.getProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER));
    m.setProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER, null);
    assertNull(m.getProperty(MarshallerProperties.CHARACTER_ESCAPE_HANDLER));
    m.setProperty(SUN_CHARACTER_ESCAPE_HANDLER_MARSHALLER, handler);
    assertEquals(handler, m.getProperty(SUN_CHARACTER_ESCAPE_HANDLER_MARSHALLER));
    m.setProperty(SUN_CHARACTER_ESCAPE_HANDLER_MARSHALLER, null);
    assertNull(m.getProperty(SUN_CHARACTER_ESCAPE_HANDLER_MARSHALLER));
    m.setProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER_MARSHALLER, handler);
    assertEquals(handler, m.getProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER_MARSHALLER));
    m.setProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER_MARSHALLER, null);
    assertNull(m.getProperty(SUN_JSE_CHARACTER_ESCAPE_HANDLER_MARSHALLER));
}
Also used : CharacterEscapeHandler(org.eclipse.persistence.oxm.CharacterEscapeHandler) CustomCharacterEscapeHandler(org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler) CustomCharacterEscapeHandler(org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler)

Aggregations

CharacterEscapeHandler (org.eclipse.persistence.oxm.CharacterEscapeHandler)2 CustomCharacterEscapeHandler (org.eclipse.persistence.testing.jaxb.xmlmarshaller.CustomCharacterEscapeHandler)2