You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2007/04/15 23:40:31 UTC

SDO Databinding test failure

I just made the following change in ImportSDOProcessorTestCase to make the
SDO tests work. See commented out/new line below. The loader in this case
dereferences the rolver so you can't pass in null without getting an NPE.
I'm not sure what the intention is here so I haven't checked this in. We
could either create the DefaultArtifactResolver here, test for null in the
loader and do nothing if null is passed in or preferably both.

  public void testFactory() throws Exception {
        String xml = "<import.sdo xmlns='
http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' " + "factory='"
                     + MockFactory.class.getName()
                     + "'/>";
        XMLStreamReader reader = getReader(xml);
        assertFalse(inited);
        ImportSDO importSDO = loader.read(reader);
        assertNotNull(importSDO);
        //loader.resolve(importSDO, null);
        loader.resolve(importSDO, new DefaultArtifactResolver());
        assertTrue(inited);
    }

Simon

Re: SDO Databinding test failure

Posted by Raymond Feng <en...@gmail.com>.
Hi,

This is a good fix. I just committed it.

Thanks,
Raymond

----- Original Message ----- 
From: "Simon Laws" <si...@googlemail.com>
To: "tuscany-dev" <tu...@ws.apache.org>
Sent: Sunday, April 15, 2007 2:40 PM
Subject: SDO Databinding test failure


>I just made the following change in ImportSDOProcessorTestCase to make the
> SDO tests work. See commented out/new line below. The loader in this case
> dereferences the rolver so you can't pass in null without getting an NPE.
> I'm not sure what the intention is here so I haven't checked this in. We
> could either create the DefaultArtifactResolver here, test for null in the
> loader and do nothing if null is passed in or preferably both.
>
>  public void testFactory() throws Exception {
>        String xml = "<import.sdo xmlns='
> http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' " + "factory='"
>                     + MockFactory.class.getName()
>                     + "'/>";
>        XMLStreamReader reader = getReader(xml);
>        assertFalse(inited);
>        ImportSDO importSDO = loader.read(reader);
>        assertNotNull(importSDO);
>        //loader.resolve(importSDO, null);
>        loader.resolve(importSDO, new DefaultArtifactResolver());
>        assertTrue(inited);
>    }
>
> Simon
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: SDO Databinding test failure

Posted by Simon Nash <na...@hursley.ibm.com>.
In addition to this code change, an additional import is also needed:

import org.apache.tuscany.contribution.resolver.DefaultArtifactResolver;

(the other) Simon

Simon Laws wrote:

> I just made the following change in ImportSDOProcessorTestCase to make the
> SDO tests work. See commented out/new line below. The loader in this case
> dereferences the rolver so you can't pass in null without getting an NPE.
> I'm not sure what the intention is here so I haven't checked this in. We
> could either create the DefaultArtifactResolver here, test for null in the
> loader and do nothing if null is passed in or preferably both.
> 
>  public void testFactory() throws Exception {
>        String xml = "<import.sdo xmlns='
> http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' " + "factory='"
>                     + MockFactory.class.getName()
>                     + "'/>";
>        XMLStreamReader reader = getReader(xml);
>        assertFalse(inited);
>        ImportSDO importSDO = loader.read(reader);
>        assertNotNull(importSDO);
>        //loader.resolve(importSDO, null);
>        loader.resolve(importSDO, new DefaultArtifactResolver());
>        assertTrue(inited);
>    }
> 
> Simon
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org