Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.Message


  
   public void testAnnotationsToDescriptions() throws Exception
   {
      Map msgLookup = getMessageRegistry(XSDMessageImporterTest.class.getResource("annotations.xsd"));

      Message msg = (Message)msgLookup.get("PRPA_IN101103CA");
     
      assertNull(msg.getRoot().getDescription());

      Message msgBase = (Message)msgLookup.get("PRPA_IN101103CA_MCCI_MT002100CA_Message");
      MessagePart part = msgBase.getRoot().getPart("id");

      String sDescription = part.getDescription();
     
      assertTrue(sDescription.startsWith("A unique identifier for the message."));
      assertTrue(sDescription.endsWith("A root component is required or else the II value is NULL."));
View Full Code Here


   public void testNestedChoices() throws Exception
   {
      Map msgLookup = getMessageRegistry(XSDMessageImporterTest.class.getResource("nestedchoices.xsd"));

      Message msg = (Message)msgLookup.get("nestedGroups");

      assertEquals(msg.getRoot().getAggregation(), CompositeMessagePart.SEQUENTIAL);

      msg = (Message)msgLookup.get("sequenceChoice");
     
      assertEquals(msg.getRoot().getAggregation(), CompositeMessagePart.SEQUENTIAL);
   }
View Full Code Here

   /**
    * Tests parsing from a primitive to a composite, within a transformation.
    */
   public void testTransformParsePrimitive()
   {
      Message csvMessage = m_metadata.getMessage("CSVTestSuiteResult");
      MessageParser csvParser = (MessageParser)csvMessage.getFormat().getParser().getInstance(m_context);
      StringInput in;
      TransferObject root, result, sub;
      List list;

      in = new StringInput("date,status,result\n" +
View Full Code Here

    * Tests using the service TestTransform.
    */
   public void testTransformFormatPrimitive()
   {
      Metaclass serviceClass = m_metadata.getMetaclass(Metadata.SERVICE_CLASS_NAME);
      Message csvMessage = m_metadata.getMessage("CSVTestSuiteResult");
      MessageFormatter formatter = (MessageFormatter)csvMessage.getFormat().getFormatter().getInstance(m_context);
      TransferObject root, test, testData, result;
      List testList;
      StringWriter writer;
      WriterOutput out;

View Full Code Here

      m_resultWriter = new StringWriter();
   }

   public void testNillable() throws Exception
   {
      Message message = m_metadata.getMessage("XML_NillableSubMessage");

      m_exporter.export(message, m_resultWriter);

      assertEquals(
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

         m_resultWriter.toString());
   }

   public void testComprehensiveXSD() throws Exception
   {
      Message message = m_metadata.getMessage("XML_XSDExportComprehensive");

      m_exporter.export(message, m_resultWriter);

      assertEquals(
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

   public void testInheritance1() throws Exception
   {
      SchemaUniverse universe = new SchemaUniverse();
      XSDSchemaExporter xsdExporter = new XSDSchemaExporter(universe);
      MessageSchemaConverter schemaExporter = new MessageSchemaConverter(universe);
      Message msg = m_context.getMetadata().getMessage("XML_Inherit_Schema_Reference");
      Schema schema = schemaExporter.add(msg).getSchema();

      xsdExporter.exportSchema(schema, m_resultWriter);

      assertEquals(
View Full Code Here

   /**
    * TODO: Improve this test when additional format strings are fully supported.
    */
   public void testFormatStrings() throws Exception
   {
      Message message = m_metadata.getMessage("XML_FormatString");

      m_exporter.export(message, m_resultWriter);

      assertEquals(
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

         m_resultWriter.toString());
   }

   public void testCircular() throws Exception
   {
      Message message = m_metadata.getMessage("XML_XSDExportCircular1");

      m_exporter.export(message, m_resultWriter);

      assertEquals(
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

         "</definitions>", m_resultWriter.toString());
   }

   public void testMultipleNamespaces() throws Exception
   {
      Message message = m_metadata.getMessage("XML_XSDExportMultipleNamespaces");
      m_exporter.setOutputMode(XSDMessageExporter.OUTMODE_WSDL);
      m_exporter.export(message, m_resultWriter);

      assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
         "<definitions name=\"XML_XSDExportMultipleNamespaces\"" +
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.Message

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.