Package org.eclipse.sapphire.modeling

Examples of org.eclipse.sapphire.modeling.ByteArrayResourceStore


    @Test
   
    public void testMoveUp() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final TestElement element = TestElement.TYPE.instantiatenew RootXmlResource( xmlResourceStore ) );
       
        try
        {
View Full Code Here


   
    @Test
   
    public void testMoveDown() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final TestElement element = TestElement.TYPE.instantiatenew RootXmlResource( xmlResourceStore ) );
       
        try
        {
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

{
    @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

{
    @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

{
    @Test
   
    public void test() throws Exception
    {
        final ByteArrayResourceStore byteArrayResourceStore = new ByteArrayResourceStore( loadResourceAsStream( "initial.txt" ) );
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( byteArrayResourceStore );

        final TestElement root = TestElement.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
        root.setTestProperty( "abc" );
       
        root.resource().save();
        final String result = new String( byteArrayResourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( "expected.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

                       final String expected )
                              
        throws Exception
       
    {
        final ByteArrayResourceStore byteArrayResourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( byteArrayResourceStore );

        final TestElement root = type.instantiate( new RootXmlResource( xmlResourceStore ) );
        root.getCcc().insert().setText( "111" );
        root.getBbb().insert().setText( "222" );
        root.getAaa().insert().setText( "333" );
        root.getCcc().insert().setText( "444" );
        root.getBbb().insert().setText( "555" );
        root.getAaa().insert().setText( "666" );
       
        root.resource().save();
        final String result = new String( byteArrayResourceStore.getContents(), UTF8 );
       
        assertEqualsIgnoreNewLineDiffs( loadResource( expected ), 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

{
    @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.