You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Kevin Williams <kj...@gmail.com> on 2008/04/24 16:30:48 UTC

[vTest] Test design for ConversationAttributes.SinglePrincipal

I am adding a test to verify @ConversationalAttributes
(SinglePrincipal = true).  Here is the related text from the Java
API/Annot specification:

    1669 • singlePrincipal (optional) – If true, only the principal
(the user) that started the conversation has
    1670 authority to continue the conversation. The default value is false

I would like to create the simplest test possible and this is what I
have come up with so far:

   --Three components each with a single service: A, B, C.  C is
conversational with SinglePrincipal = true.
   --A and B are configured such that each "requires" a policy set
(jassAuthentication1 and jassAuthentication2 respectively)
   --A will initiate a conversation with C
   --A will pass its C-reference to B
   --B will attempt to continue the conversation and this should fail
since B represents a different "principal"

I'll start  implementing this but would appreciate any suggestions ...
especially if I am way out in the weeds :-)

Thanks,

--Kevin

Re: [vTest] Test design for ConversationAttributes.SinglePrincipal

Posted by Kevin Williams <kj...@gmail.com>.
I am getting errors during SCADomain initialization:

org.osoa.sca.ServiceRuntimeException:
org.osoa.sca.ServiceRuntimeException:
org.apache.tuscany.sca.contribution.service.ContributionResolveException:
PolicyValidation exception when processing implementation of component
'AComponent' due to Policy Intent
'{http://tuscany.apache.org/xmlns/sca/1.0}jaasAuthentication' is not
defined in this domain
	at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:276)
	at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:70)
	at org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.SinglePricipalTestCase.init(SinglePricipalTestCase.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	
It seems this is related to warnings received during processing of the
Definitions.xml:

Apr 24, 2008 11:55:22 AM
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
read
WARNING: Element
{http://tuscany.apache.org/xmlns/sca/1.0}jaasAuthentication cannot be
processed. ([row,col,system-id]:
[28,9,"file:/C:/tuscanysvn/java/sca/vtest/java-api/annotations/conversationattributes/target/classes/definitions.xml"])
Apr 24, 2008 11:55:22 AM
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
read
WARNING: Element
{http://tuscany.apache.org/xmlns/sca/1.0}configurationName cannot be
processed. ([row,col,system-id]:
[29,13,"file:/C:/tuscanysvn/java/sca/vtest/java-api/annotations/conversationattributes/target/classes/definitions.xml"])
Apr 24, 2008 11:55:22 AM
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
read
WARNING: Element
{http://tuscany.apache.org/xmlns/sca/1.0}callbackHandler cannot be
processed. ([row,col,system-id]:
[30,13,"file:/C:/tuscanysvn/java/sca/vtest/java-api/annotations/conversationattributes/target/classes/definitions.xml"])
Cleaning up

Here is my definitions file:

<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
    xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
    xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
    xmlns:convatt="http://convatt">

    <!-- PolicySets -->
    <policySet name="JaasPolicy" provides="tuscany:jaasAuthentication"
appliesTo="sca:implementation.java"
        xmlns="http://www.osoa.org/xmlns/sca/1.0">
        <tuscany:jaasAuthentication>
            <tuscany:configurationName>AService</tuscany:configurationName>
            <tuscany:callbackHandler>org.apache.tuscany.sca.vtest.javaapi.annotations.conversationattributes.security.ACallbackHandler</tuscany:callbackHandler>
        </tuscany:jaasAuthentication>
    </policySet>

</definitions>


I have patterned this test after the Calculator-policy sample but I
think I am missing some piece of configuration.  Any help is
appreciated.

Thanks,

--Kevin

On Thu, Apr 24, 2008 at 8:30 AM, Kevin Williams <kj...@gmail.com> wrote:
> I am adding a test to verify @ConversationalAttributes
>  (SinglePrincipal = true).  Here is the related text from the Java
>  API/Annot specification:
>
>     1669 • singlePrincipal (optional) – If true, only the principal
>  (the user) that started the conversation has
>     1670 authority to continue the conversation. The default value is false
>
>  I would like to create the simplest test possible and this is what I
>  have come up with so far:
>
>    --Three components each with a single service: A, B, C.  C is
>  conversational with SinglePrincipal = true.
>    --A and B are configured such that each "requires" a policy set
>  (jassAuthentication1 and jassAuthentication2 respectively)
>    --A will initiate a conversation with C
>    --A will pass its C-reference to B
>    --B will attempt to continue the conversation and this should fail
>  since B represents a different "principal"
>
>  I'll start  implementing this but would appreciate any suggestions ...
>  especially if I am way out in the weeds :-)
>
>  Thanks,
>
>  --Kevin
>