Package org.apache.ws.jaxme.xs.jaxb.impl

Examples of org.apache.ws.jaxme.xs.jaxb.impl.JAXBParser


  /** Tests typical element uses.
   */
  public void testElements() throws Exception {
    XSParser xsParser = newXSParser();
    testElements(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testElements(jaxbParser);
  }
View Full Code Here


  /** Tests various facets.
   */
  public void testFacets() throws Exception {
    XSParser xsParser = newXSParser();
    testFacets(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testFacets(jaxbParser);
  }
View Full Code Here

      "      <xsd:pattern value='\\d{3}-[A-Z]{2}'/>\n" +
      "    </xsd:restriction>\n" +
      "  </xsd:simpleType>\n" +
      "</xsd:schema>\n";

    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testPurchaseOrder.xsd");
    JAXBSchema schema = (JAXBSchema) parser.parse(isource);
    JAXBGlobalBindings globalBindings = schema.getJAXBGlobalBindings();
    assertNotNull(globalBindings);

    XSType[] schemaTypes = schema.getTypes();
    assertNotNull(schemaTypes);
View Full Code Here

      "   </xsd:restriction> \n" +
      "  </xsd:simpleType> \n" +
      " </xsd:element> \n" +
      "</xsd:schema> \n";

    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testRestrictionMaxExclusive.xsd");
    parser.parse(isource);
  }
View Full Code Here

    final String schemaSource1 =
      "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://test.com/namespaces'>\n" +
      "  <xs:element name='foo' type='xs:string'/>\n" +
      "</xs:schema>\n";

    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource1));
    isource.setSystemId("testTargetNamespace1.xsd");
    XSSchema schema = parser.parse(isource);
    XSElement[] schemaElements = schema.getElements();
    assertEquals(1, schemaElements.length);
    assertEquals(new XsQName("http://test.com/namespaces", "foo"), schemaElements[0].getName());
    assertNull(schemaElements[0].getName().getPrefix());

    final String schemaSource2 =
      "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:test='http://test.com/namespaces'" +
      " targetNamespace='http://test.com/namespaces'>\n" +
      "  <xs:element name='foo' type='xs:string'/>\n" +
      "</xs:schema>\n";

    parser = newJAXBParser();
    isource = new InputSource(new StringReader(schemaSource2));
    isource.setSystemId("testTargetNamespace1.xsd");
    schema = parser.parse(isource);
    schemaElements = schema.getElements();
    assertEquals(1, schemaElements.length);
    assertEquals(new XsQName("http://test.com/namespaces", "foo"), schemaElements[0].getName());
    assertEquals("test", schemaElements[0].getName().getPrefix());
View Full Code Here

      "      <xs:element ref='ns:head'/>\n" +
      "    </xs:sequence>\n" +
      "  </xs:complexType>\n" +
      "</xs:schema>\n";
   
    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource1));
    isource.setSystemId("testTargetNamespace1.xsd");
    XSSchema schema = parser.parse(isource);
    XSElement[] elements = schema.getElements();
    assertEquals(3, elements.length);
    XsQName headName = new XsQName("http://test.com/namespaces", "head");
    XsQName subst1Name = new XsQName("http://test.com/namespaces", "subst1");
    XsQName subst2Name = new XsQName("http://test.com/namespaces", "subst2");
View Full Code Here

    /** Tests definition of a key.
     */
    public void testSimpleKey() throws Exception {
      XSParser xsParser = newXSParser();
      testSimpleKey(xsParser);
      JAXBParser jaxbParser = newJAXBParser();
      testSimpleKey(jaxbParser);
    }
View Full Code Here

    /** <p>Tests whether xs:documentation may have arbitrary childs.</p>
     */
    public void testDocumentationChilds() throws Exception {
      XSParser xsParser = newXSParser();
        testDocumentationChilds(xsParser);
        JAXBParser jaxbParser = newJAXBParser();
        testDocumentationChilds(jaxbParser);
    }
View Full Code Here

    /** <p>Test the handling of namespace lists.</p>
     */
    public void testNamespaceLists() throws Exception {
        XSParser xsParser = newXSParser();
        testNamespaceLists(xsParser);
        JAXBParser jaxbParser = newJAXBParser();
        testNamespaceLists(jaxbParser);
    }
View Full Code Here

    // settings.
    final String schemaSource =
      "<?xml version='1.0'?>\n" +
      "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'/>\n";
   
    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testGlobalBindingsDefaults.xsd");
    JAXBSchema schema = (JAXBSchema) parser.parse(isource);
    JAXBGlobalBindings globalBindings = schema.getJAXBGlobalBindings();
    String collectionType = globalBindings.getCollectionType();
    assertNull(collectionType);
    JAXBJavaType[] javaTypes = globalBindings.getJavaType();
    assertNotNull(javaTypes);
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.jaxb.impl.JAXBParser

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.