Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.XMLContext


     * Test marshalling of bean refering to another one with proxy.
     *
     * @throws Exception For any exception thrown.
     */
    public void testMarshalReferingBeanProxy() throws Exception {
        XMLContext xmlContext = new XMLContext();
        xmlContext.setProperty(XMLProperties.PROXY_INTERFACES, "net.sf.cglib.proxy.Factory");
       
        Mapping mapping = xmlContext.createMapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = xmlContext.createMarshaller();
        marshaller.setWriter(out);
        marshaller.setMapping(mapping);
       
// Joachim 2007-09-04 before XMLContext was introduced it looked like:
//        Configuration config = LocalConfiguration.getInstance();
View Full Code Here


        super(name);
    }

   
    protected void setUp() throws Exception {
        this.context = new XMLContext();
        context.setProperty("org.exolab.castor.indent", "true");
    }
View Full Code Here

    public TestTemplateWithMapping(final String name) {
        super(name);
    }

    protected void setUp() throws Exception {
        this.context = new XMLContext();
        context.setProperty("org.exolab.castor.indent", "true");
    }
View Full Code Here

    /* (non-Javadoc)
     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        this.xmlContext = new XMLContext();
        // das Test Objekt vorbereiten
        this.writer = new StringWriter();
    }
View Full Code Here

          if (node.getNamespaceURI().equals(JDOConstants.JDO_NAMESPACE)
                  && (node.getLocalName().equals(JDOConstants.ANNOTATIONS_TABLE_NAME)
                          || node.getLocalName().equals(JDOConstants.ANNOTATIONS_COLUMN_NAME)
                          || node.getLocalName().equals(JDOConstants.ANNOTATIONS_ONE_TO_ONE_NAME)
                          || node.getLocalName().equals(JDOConstants.ANNOTATIONS_ONE_TO_MANY))) {
              XMLContext context = new XMLContext();
              context.addPackage(JDOConstants.GENERATED_ANNOTATION_CLASSES_PACKAGE);
              Unmarshaller unmarshaller = context.createUnmarshaller();              
              unmarshaller.setClassLoader(getClass().getClassLoader());
              _appInfo.getJdoContent().add(unmarshaller.unmarshal(node));
          }           
          //-- add to appInfo
          _appInfo.add(node);
View Full Code Here

        verbose("\n================================================");
        verbose("Test suite '"+_test.getName()+"': setting up test '" + _name+"'");
        verbose("================================================\n");
        if (getXMLContext() == null) {
            // not wrapped inside a TestWithXy test!
            setXMLContext(new XMLContext());
        }
        _sourceGenerator.setXMLContext(getXMLContext());
        _sourceGenerator.setUp();
    }
View Full Code Here

    protected void setUp() throws Exception {
        if (_delegate == null) {
            throw new IllegalStateException("No test specified to set up.");
        }

        _delegate.setXMLContext(new XMLContext());
        _delegate.setUp();
//        if (_delegate instanceof MarshallingFrameworkTestCase) {
//            ((MarshallingFrameworkTestCase)_delegate).setUp();
//        } else if (_delegate instanceof SourceGeneratorTestCase) {
//            ((SourceGeneratorTestCase)_delegate).setUp();
View Full Code Here

        } catch (IOException e) {
            fail("IOException copying support files " + e);
        }
        if (getXMLContext() == null) {
         // not wrapped inside a TestWithXy test!
            setXMLContext(new XMLContext());
        }
    }
View Full Code Here

     * Provides setup for our delegated test case, depending on the type of
     * test case we are delegating for.
     * @throws Exception if anything goes wrong during setup
     */
    protected void setUp() throws Exception {
        _delegate.setXMLContext(new XMLContext());

        if (_delegate instanceof MarshallingFrameworkTestCase) {
            ((MarshallingFrameworkTestCase)_delegate).setUp();
        } else if (_delegate instanceof SourceGeneratorTestCase) {
            ((SourceGeneratorTestCase)_delegate).setUp();
View Full Code Here

     * Provides setup for our delegated test case, depending on the type of
     * test case we are delegating for.
     * @throws Exception if anything goes wrong during setup
     */
    protected void setUp() throws Exception {
        _delegate.setXMLContext(new XMLContext());
        _delegate.setUp();
//        if (_delegate instanceof MarshallingFrameworkTestCase) {
//            ((MarshallingFrameworkTestCase)_delegate).setUp();
//        } else if (_delegate instanceof SourceGeneratorTestCase) {
//            ((SourceGeneratorTestCase)_delegate).setUp();
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.XMLContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.