Package org.eclipse.sapphire.modeling

Examples of org.eclipse.sapphire.modeling.ByteArrayResourceStore


   
    @Test
   
    public void testValueProperties2() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final XmlBindingTestModelAltB model = XmlBindingTestModelAltB.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
       
        testValueProperties( resourceStore, model, loadResource( XmlBindingTests.class.getSimpleName() + ".testValueProperties2.txt" ) );
    }
View Full Code Here


   
    @Test
   
    public void testValueProperties3() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final XmlBindingTestModelAltC model = XmlBindingTestModelAltC.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
       
        testValueProperties( resourceStore, model, loadResource( XmlBindingTests.class.getSimpleName() + ".testValueProperties3.txt" ) );
    }
View Full Code Here

   
    @Test
   
    public void testInsertOrder() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final TestXmlXsd0002ModelRoot model = TestXmlXsd0002ModelRoot.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( resourceStore ) ) );
       
        model.setCcc( "ccc" );
        model.setAaa( "aaa" );
       
        TestXmlXsd0002Element2b element2b = model.getElement2();
        element2b.setCcc2( "ccc2" );
        element2b.setBbb2( "bbb2" );
        element2b.setAaa2( "aaa2" );

        model.setBbb( "bbb" );
       
        model.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "0002.txt" ), result );
    }
View Full Code Here

   
    @Test
   
    public void testInsertOrder() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final TestXmlXsd0003Element model = TestXmlXsd0003Element.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( resourceStore ) ) );
       
        model.setCcc( "ccc" );
        model.setBbb( "bbb" );
        TestXmlXsd0003Circle circle=  model.getCircle();
        circle.setCircle3( "333");
        circle.setCircle2( "222");
        circle.setCircle1( "111");
        model.setAaa( "aaa" );
        TestXmlXsd0003Square square =  model.getSquare();
        square.setSquare3( "333");
        square.setSquare2( "222");
        square.setSquare1( "111");

        model.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "0003.txt" ), result );
    }
View Full Code Here

   
    @Test
   
    public void testInsertOrder() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final TestXmlXsd0004Workbook workbook = TestXmlXsd0004Workbook.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( resourceStore ) ) );
       
        final TestXmlXsd0004Circle circle = workbook.getShapes().insert( TestXmlXsd0004Circle.class );
        circle.setRadius( 3 );
        circle.setY( 2 );
        circle.setX( 1 );
       
        final TestXmlXsd0004Rectangle rectangle = workbook.getShapes().insert( TestXmlXsd0004Rectangle.class );
        rectangle.setHeight( 4 );
        rectangle.setWidth( 3 );
        rectangle.setY( 2 );
        rectangle.setX( 1 );

        workbook.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "ExpectedInsertionOrder.txt" ), result );
    }
View Full Code Here

       
    {
        final String initial = loadResource( initialResourceName );
        final String expected = loadResource( expectedResourceName );
       
        final ByteArrayResourceStore byteArrayResourceStore = new ByteArrayResourceStore( initial );
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( byteArrayResourceStore );
       
        op.run( xmlResourceStore.getDomDocument() );
       
        xmlResourceStore.save();
       
        final String actual = new String( byteArrayResourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( expected, actual );
    }
View Full Code Here

   
    @Test
   
    public void testInsertOrder() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final TestXmlXsd0001ModelRoot model = TestXmlXsd0001ModelRoot.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( resourceStore ) ) );
       
        model.setDdd( "ddd" );
        model.setCcc( "ccc" );
        model.setBbb( "bbb" );
        model.setAaa( "aaa" );
       
        model.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "0001.txt" ), result );
    }
View Full Code Here

   
    @Test
   
    public void testInsertOrder() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final TestXmlXsd0005Workbook workbook = TestXmlXsd0005Workbook.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( resourceStore ) ) );
       
        final TestXmlXsd0005Circle circle = workbook.getShapes().insert( TestXmlXsd0005Circle.class );
        circle.setRadius( 3 );
        circle.setY( 2 );
        circle.setX( 1 );
       
        final TestXmlXsd0005Rectangle rectangle = workbook.getShapes().insert( TestXmlXsd0005Rectangle.class );
        rectangle.setHeight( 4 );
        rectangle.setWidth( 3 );
        rectangle.setY( 2 );
        rectangle.setX( 1 );

        workbook.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "ExpectedInsertionOrder.txt" ), result );
    }
View Full Code Here

   
    @Test
   
    public void testInsertOrder() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final TestElement root = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( resourceStore ) ) );
       
        final TestElement.B b = root.getB().content( true );
       
        b.setBd( "1" );
        b.setBb( "2" );
        b.setBc( "3" );
        b.setBa( "4" );

        final TestElement.A a = root.getA().content( true );
       
        a.setAd( "1" );
        a.setAa( "2" );
        a.setAc( "3" );
        a.setAb( "4" );
       
        root.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "InsertOrderExpectedResult.txt" ), result );
    }
View Full Code Here

{
    @Test
   
    public void test() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final TestModelRoot root = TestModelRoot.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
       
        ( (TestModelElementA1) root.getList().insert( TestModelElementA1.TYPE ) ).setValue( "1111" );
        ( (TestModelElementA2) root.getList().insert( TestModelElementA2.TYPE ) ).setValue( "2222" );
       
        ( (TestModelElementB2) root.getElement().content( true, TestModelElementB2.TYPE ) ).setValue( "3333" );
       
        root.resource().save();
       
        final String result = new String( resourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "TestData.txt" ), result );
    }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.ByteArrayResourceStore

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.