On Tue, Apr 7, 2009 at 7:50 PM, ant elder <[email protected]> wrote:
> On Wed, Apr 8, 2009 at 1:06 AM, Raymond Feng <[email protected]> wrote:
>> Hi,
>>
>> This is interesting. One thing I'm not sure is if
>> SCAClientFactory.newInstance() should trigger the "start" of the node. What
>> I understand from the spec discussion is that the SCAClientFactory provides
>> an entry point to a running SCA domain. We may have to get clarifications
>> from the spec side.
>>
>> Thanks,
>> Raymond
>>
>
> Yes, that was an easy way to get it working simply, we need a way to
> get the SCAClient to find an already created node. To do that we
> probably need to change the SCAClient impl to be a new class instead
> of the NodeImpl and have that class find a Node and choose one based
> on the domain URI passed in on the SCAClient getService call. It does
> seem convenient to me in a JSE environment for that to create an
> underlying node to use if there's not an already started Node to use.
>
> ...ant
>
So lets explore this a bit using the testcase below as an example of
what we might want to do. It uses the tests setup and tearDown methods
to createand stop a Tuscany Node and then the in a test method uses an
SCAClient to get a service so that would need someway to find the
already created Node.
Some things are:
- the Tuscany Node doesn't have a domain URI so there isn't any way to
create or match existing Nodes to match the URI passed in on the
SCAClient getService call.
- there's no link between the Node and SCAClient instances for the
SCAClient to find the Node so it will probably have to use some static
in the factories
- we probably want to think about supporting multiple Nodes in a
domain so i'm wondering if we need to have an SCADomain again and have
the SCADomain know about multiple Nodes.
Comments?
...ant
public class SCAClientTestCase extends TestCase {
private Node node;
�...@override
protected void setUp() throws Exception {
node = NodeFactory.newInstance().createNode();
}
public void testInvoke() throws Exception {
HelloworldService service =
SCAClientFactory.newInstance().getService(HelloworldService.class,
"HelloworldComponent", "urn:someDomainUri");
assertEquals("Hello petra", service.sayHello("petra"));
}
�...@override
protected void tearDown() throws Exception {
node.stop();
}
}
...ant