Home » xmlbeans-2.5.0-src » org.apache » xmlbeans » [javadoc | source]

    1   /*=============================================================================*
    2    *  Copyright 2005 The Apache Software Foundation
    3    *
    4    *  Licensed under the Apache License, Version 2.0 (the "License");
    5    *  you may not use this file except in compliance with the License.
    6    *  You may obtain a copy of the License at
    7    *
    8    *      http://www.apache.org/licenses/LICENSE-2.0
    9    *
   10    *  Unless required by applicable law or agreed to in writing, software
   11    *  distributed under the License is distributed on an "AS IS" BASIS,
   12    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13    *  See the License for the specific language governing permissions and
   14    *  limitations under the License.
   15    *=============================================================================*/
   16   package org.apache.xmlbeans;
   17   
   18   import junit.framework.TestCase;
   19   
   20   import java.net.URL;
   21   import java.io.File;
   22   
   23   import org.apache.xmlbeans.impl.newstore2.Saaj;
   24   
   25   import javax.xml.soap.SOAPEnvelope;
   26   
   27   /**
   28    * TODO
   29    */
   30   public class BugTester extends TestCase
   31   {
   32   
   33       public void testParseMgmtEventXml() throws Exception
   34       {
   35           XmlObject xBean = XmlObject.Factory.parse( "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2003/03/addressing\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsa:Action>http://docs.oasis-open.org/wsn/2004/06/WS-BaseNotification/Notify</wsa:Action><wsa:MessageID>uuid:9ef8b30f-0887-4e48-a922-b06fa6f5964b</wsa:MessageID><wsa:To>http://156.152.12.172:9101/</wsa:To></soap:Header><soap:Body><Notify xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd\"><NotificationMessage><Topic xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdm=\"http://docs.oasis-open.org/wsdm/2004/12/mows/wsdm-mows-events.xml\" xmlns:wsn=\"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd\" Dialect=\"http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple\">wsdm:RequestProcessingObservations</Topic><Message><ManagementEvent ReportTime=\"2005-04-13T13:34:09.6562816-04:00\" xmlns=\"http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd\"><EventId>eid:c2e0fc75-272a-4ac7-b08f-28de513e1219</EventId><SourceComponent><ResourceId>rid:e3a0b27a-45e0-40af-a15b-1cdc263f24ce</ResourceId></SourceComponent><RequestProcessingNotification CurrentTime=\"2005-04-13T13:34:09.6562816-04:00\" xmlns=\"http://docs.oasis-open.org/wsdm/2004/12/mows/wsdm-mows.xsd\"><Request><Message><Size Unit=\"byte\">350</Size><Text>" +
   36                           "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;&lt;soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"&gt;&lt;soap:Body&gt;&lt;GetCurrentTemperature xmlns=\"http://everest.org/\"&gt;&lt;altitude&gt;8000&lt;/altitude&gt;&lt;/GetCurrentTemperature&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;\n" +
   37                           "</Text></Message></Request><StateInformation><StateTransition Time=\"2005-04-13T13:34:09.6562816-04:00\" xmlns=\"http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd\"><EnteredState><RequestReceivedState xmlns=\"http://docs.oasis-open.org/wsdm/2004/12/mows/wsdm-mows.xsd\" /></EnteredState></StateTransition></StateInformation></RequestProcessingNotification></ManagementEvent></Message></NotificationMessage></Notify></soap:Body></soap:Envelope>" );
   38           System.out.println( xBean );  // visually verify that both Message elements are serialized with the correct namespaces
   39       }
   40   
   41       public void testParseURLWithNoTerminatingNewline() throws Exception
   42       {
   43           XmlObject.Factory.parse(
   44                   new URL(
   45                           "file:///C:/Projects/Apache/muse/trunk/src/site/content/interop/src/test/org/apache/xmlbeans/NoNewLine.xml" ) );
   46           // TODO: try w/ http URL
   47       }
   48   
   49       public void testSaajProxy() throws Exception
   50       {
   51           XmlOptions xmlOpts = new XmlOptions();
   52           xmlOpts.put( Saaj.SAAJ_IMPL, new Object() );
   53           XmlObject xBean = XmlObject.Factory.parse( new File( "C:\\Projects\\Apache\\apollo\\trunk\\src\\site\\content\\tutorial\\requests\\Destroy.soap" ), xmlOpts );
   54           assertTrue( xBean instanceof SOAPEnvelope );
   55       }
   56           
   57       public void testXmlObjectValueEquals() throws Exception
   58       {
   59           // TODO: test if XmlObject#valueEquals() works when comparing two complex types
   60       }
   61   
   62   }

Home » xmlbeans-2.5.0-src » org.apache » xmlbeans » [javadoc | source]