[jira] Created: (JMOCK-198) Allow assert of State-Machine

View: New views
18 Messages — Rating Filter:   Alert me  

[jira] Created: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Allow assert of State-Machine
-----------------------------

                 Key: JMOCK-198
                 URL: http://jira.codehaus.org/browse/JMOCK-198
             Project: jMock
          Issue Type: Improvement
          Components: Library
    Affects Versions: 2.5.0
            Reporter: Marcos Sanchez
            Priority: Trivial


Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
     assertTrue(stateMachine.is("desired-state").isActive());
     assertTrue(stateMachine.isNot("undesirable-state").isActive())

I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
     assertTrue(stateMachine.isCurrently("state"));
     assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144087#action_144087 ]

Steve Freeman commented on JMOCK-198:
-------------------------------------

How about:

assertThat(stateMachine, isCurrently("state"))

for example?

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144131#action_144131 ]

Nat Pryce commented on JMOCK-198:
---------------------------------

What's wrong with

    assertStateMachine(banana.is("curved"))

    assertStateMachine(banana.isNot("overripe"));

as originally suggested?

That would be both readable and require less implementation effort and duplicated code.

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144145#action_144145 ]

Marcos Sanchez commented on JMOCK-198:
--------------------------------------

Simplest implementation (I can see):

State is implemented as a String so we

        Extend org.jmock.States to include a currentState getter:   {{currently()}}
        Implement in org.jmock.internal.StateMachine

Resulting code allows

        {{assertThat(machine.currently(), is("running"));}}
        {{assertThat(machine.currently(), is(not("broken")));}}

and, less elegantly, in Instinct

        {{expect.that(list.currently()).isEqualTo(UNMODIFIED);}}
        {{expect.that(list.currently()).isNotEqualTo(MODIFIED);}}

This really needs to be more robust, maybe Enumming possible states and forcing the check against the Enum, but the patch works.

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144146#action_144146 ]

Nat Pryce commented on JMOCK-198:
---------------------------------

That is not the simplest implementation.  It requires an additional getter on States and a new matcher method "is" that has a different implementation to the Matchers.is and would cause name clash.

The API I suggested requires one new assertion method that uses the existing internal API.

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: state-patch.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment: state-patch.txt

Minimal {{currently()}} patch as described

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: state-patch.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Issue Comment Edited: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144146#action_144146 ]

npryce edited comment on JMOCK-198 at 8/5/08 6:17 AM:
---------------------------------------------------------

That is not the simplest implementation.  It requires an additional getter on States and a new matcher method "is" that is a synonym for "eq" and therefore has a different meaning to the method with the same name in org.hamcrest.Matchers.

The API I suggested requires one new assertion method that uses the existing internal API.

      was (Author: npryce):
    That is not the simplest implementation.  It requires an additional getter on States and a new matcher method "is" that has a different implementation to the Matchers.is and would cause name clash.

The API I suggested requires one new assertion method that uses the existing internal API.
 

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: state-patch.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Issue Comment Edited: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144146#action_144146 ]

npryce edited comment on JMOCK-198 at 8/5/08 6:20 AM:
---------------------------------------------------------

That is not the simplest implementation.  It requires an additional getter on States and a new matcher method "is" that is a synonym for "eq" and therefore has a different meaning to the method with the same name in org.hamcrest.Matchers.

The getter also exposes the internal implementation details of the StateMachine class, in particular that it uses null to represent the unnamed initial state.

That violates the "never pass null between objects" design rule.

The assertions using matchers to compare strings also duplicate the implementations of the internal StatePredicate interface.

The API I suggested requires one new assertion method that uses the existing internal API and does not expose internal implementation details of the StateMachine class.

      was (Author: npryce):
    That is not the simplest implementation.  It requires an additional getter on States and a new matcher method "is" that is a synonym for "eq" and therefore has a different meaning to the method with the same name in org.hamcrest.Matchers.

The API I suggested requires one new assertion method that uses the existing internal API.
 

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: state-patch.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment: StateMachineMatchers.txt

Ok!  Point taken.

So here is your option and a couple of Matchers for good measure!

Supported Syntax includes

        {{assertStateMachine(list.isNot(MODIFIED));}}
        {{assertStateMachine(list.is(UNMODIFIED));}}

and

        {{assertThat(list, isCurrently(UNMODIFIED));}}
        {{assertThat(list, isNotCurrently(MODIFIED));}}

using

{{static import org.jmock.Assert;}}

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: state-patch.txt, StateMachineMatchers.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment:     (was: state-patch.txt)

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: StateMachineMatchers.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144184#action_144184 ]

Nat Pryce commented on JMOCK-198:
---------------------------------

I prefer the assertThat style.  We can write two matchers that call the internal state machine APIs.

The patch is not acceptable as it stands because:
 - it does not contain any acceptance or unit tests for the new functionality
 - it throws exceptions with no error messages
 - it mixes new functionality and irrelevant formatting changes
 - the matcher descriptions do not fit cleanly into a longer description: they should be a clause of a sentence, not start with a capital letter.


> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: StateMachineMatchers.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment:     (was: StateMachineMatchers.txt)

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment: StateMachineMatchers2.txt

removed assertStateMachine(boolean)

and addressed issues.

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: StateMachineMatchers2.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment: StateMachineMatchers2.txt

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: StateMachineMatchers2.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcos Sanchez updated JMOCK-198:
---------------------------------

    Attachment:     (was: StateMachineMatchers2.txt)

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>         Attachments: StateMachineMatchers2.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144552#action_144552 ]

Nat Pryce commented on JMOCK-198:
---------------------------------

Unfortunately that patch is still not acceptable.

* Matchers must be stateless (e.g. immutable). Your matcher stores the matched parameter in an instance variable.
* The patch contains commented out code
* The patch mixes formatting changes and new functionality.

I've committed an implementation to SVN head.


> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>             Fix For: 2.6.0
>
>         Attachments: StateMachineMatchers2.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Resolved: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nat Pryce resolved JMOCK-198.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.6.0

Implementation committed to SVN.

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: Improvement
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>             Fix For: 2.6.0
>
>         Attachments: StateMachineMatchers2.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-198) Allow assert of State-Machine

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nat Pryce updated JMOCK-198:
----------------------------

    Issue Type: New Feature  (was: Improvement)

> Allow assert of State-Machine
> -----------------------------
>
>                 Key: JMOCK-198
>                 URL: http://jira.codehaus.org/browse/JMOCK-198
>             Project: jMock
>          Issue Type: New Feature
>          Components: Library
>    Affects Versions: 2.5.0
>            Reporter: Marcos Sanchez
>            Priority: Trivial
>             Fix For: 2.6.0
>
>         Attachments: StateMachineMatchers2.txt
>
>
> Asserting a state-machine's state requires the internal API (not obvious, clear or documented) as in
>      assertTrue(stateMachine.is("desired-state").isActive());
>      assertTrue(stateMachine.isNot("undesirable-state").isActive())
> I suggest the creation of a become("state") counterpart. Maybe something like isCurrently("state") & isNotCurrently("state") which wrap the internal API, such that we get
>      assertTrue(stateMachine.isCurrently("state"));
>      assertTrue(stateMachine.isNotCurrently("state"));

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email