[ 
https://ops4j1.jira.com/browse/QI-328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15155#comment-15155
 ] 

Niclas Hedhman commented on QI-328:
-----------------------------------

Here is the testcase for it;

{code}
    @Test
    public void 
givenValueCompositeWithInternalStateMixinWhenSerializingExpectInternalStateInOutput()
        throws Exception
    {
        ValueBuilder<OuterValue> builder = valueBuilderFactory.newValueBuilder( 
OuterValue.class );
        OuterValue.State prototype = builder.prototypeFor( 
OuterValue.State.class );
        builder.prototype().firstName().set( "Niclas" );
        prototype.lastName().set(  "Hedhman" );
        OuterValue value = builder.newInstance();
        System.out.println("Niclas: " + value);
        value.printName();
        assertEquals(  "{\"firstName\":\"Niclas\",\"lastName\":\"Hedhman\"}", 
value.toJSON() );
    }

    @Mixins( OuterValue.Mixin.class )
    public interface OuterValue extends ValueComposite
    {
        void printName();

        Property<String> firstName();

        public abstract class Mixin
            implements OuterValue
        {
            @This private State state;

            @Override
            public void printName()
            {
                System.out.println( firstName().get() + " " + 
state.lastName().get() );
            }
        }

        interface State
        {
            Property<String> lastName();
        }
    }
{code}


> Internal State in ValueComposite is not output in toString();
> -------------------------------------------------------------
>
>                 Key: QI-328
>                 URL: https://ops4j1.jira.com/browse/QI-328
>             Project: Qi4j
>          Issue Type: Bug
>            Reporter: Niclas Hedhman
>            Assignee: Niclas Hedhman
>             Fix For: 1.4
>
>
> Any internal mixin state in ValueComposites will not be part of the 
> toString() output

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to