Package org.eclipse.sapphire.modeling.xml

Examples of org.eclipse.sapphire.modeling.xml.RootXmlResource


    public void testXmlResourceToXmlElement() throws Exception
    {
        final MasterConversionService service = Sapphire.service( MasterConversionService.class );
       
        final XmlResourceStore xmlResourceStore = new XmlResourceStore();
        final RootXmlResource xmlResource = new RootXmlResource( xmlResourceStore );
        final XmlConversionTestElement elementOnXml = XmlConversionTestElement.TYPE.instantiate( xmlResource );
       
        xmlResource.save();

        final XmlElement xmlElement = service.convert( xmlResource, XmlElement.class );
       
        assertNotNull( xmlElement );
        assertSame( xmlElement, xmlResource.getXmlElement() );
        assertSame( xmlElement, xmlResource.adapt( XmlElement.class ) );
       
        final XmlConversionTestElement.ListEntry childElement = elementOnXml.getList().insert();
        final XmlElement childXmlElement = service.convert( childElement.resource(), XmlElement.class );
        final XmlResource childXmlResource = (XmlResource) childElement.resource();
       
View Full Code Here


    @Test
   
    public void testWorkspaceRelativePath() throws Exception
    {
        final ValueProperty property = TestElement.PROP_WORKSPACE_RELATIVE_PATH;
        final TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( this.aa ) ) ) );
       
        testValidationOk( element, property, this.a.getFullPath() );
        testValidationOk( element, property, this.aa.getFullPath() );
        testValidationOk( element, property, this.ab.getFullPath() );
        testValidationOk( element, property, this.aba.getFullPath() );
View Full Code Here

   
    public void testProjectRelativePath() throws Exception
    {
        final ValueProperty property = TestElement.PROP_PROJECT_RELATIVE_PATH;
       
        TestElement element = TestElement.TYPE.instantiate( new RootXmlResource( new XmlResourceStore( new WorkspaceFileResourceStore( this.aa ) ) ) );
       
        testValidationOk( element, property, this.aa.getProjectRelativePath() );
        testValidationOk( element, property, this.ab.getProjectRelativePath() );
        testValidationOk( element, property, this.aba.getProjectRelativePath() );
View Full Code Here

   
    public void testInsertOneAtEnd() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final TestElement element = TestElement.TYPE.instantiatenew RootXmlResource( xmlResourceStore ) );
       
       
        try
        {
            final TestListEntry x = element.getList().insert();
View Full Code Here

    public void testInsertTwoAtEnd() throws Exception
    {
        final ByteArrayResourceStore resourceStore = new ByteArrayResourceStore();
        final XmlResourceStore xmlResourceStore = new XmlResourceStore( resourceStore );
        final TestElement element = TestElement.TYPE.instantiatenew RootXmlResource( xmlResourceStore ) );
       
        try
        {
            final ElementList<TestListEntry> list = element.getList();
           
View Full Code Here

   
    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
        {
            final ElementList<TestListEntry> list = element.getList();
           
View Full Code Here

   
    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
        {
            final ElementList<TestListEntry> list = element.getList();
           
View Full Code Here

   
    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" );
View Full Code Here

   
    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" );
View Full Code Here

    @Test
   
    public void testInMapping() throws Exception
    {
        final XmlResourceStore xmlResourceStore = new XmlResourceStore();
        final TestXmlBinding0006A element = TestXmlBinding0006A.TYPE.instantiate( new RootXmlResource( xmlResourceStore ) );
       
        try
        {
            element.getTestProperty().insert();
            fail( "Did not catch the expected exception." );
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.xml.RootXmlResource

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.