Oli Bye (JIRA | 10 Jan 02:06

[jira] (JMOCK-166) please upload -source / -javadoc attachments to iblio site


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

Oli Bye closed JMOCK-166.
-------------------------

    Resolution: Won't Fix
      Assignee: Oli Bye  (was: Mauro Talevi)

Source included in 2.6.0-RC2 maven artifacts.

Source for old versions is in https://github.com/jmock/jmock-library

Going backwards is too much work given the amount we need to move forwards

                
> please upload -source / -javadoc attachments to iblio site
> ----------------------------------------------------------
>
>                 Key: JMOCK-166
>                 URL: https://jira.codehaus.org/browse/JMOCK-166
>             Project: jMock
>          Issue Type: Improvement
>          Components: Maven Packaging
>            Reporter: Kai Grabfelder
>            Assignee: Oli Bye
>            Priority: Trivial
>             Fix For: Chore (ASAP)
>
(Continue reading)

Dan Haywood (JIRA | 21 Dec 00:20

[jira] (JMOCK-258) Extend the @Mock annotation to be able to also specify expectations.

Dan Haywood created JMOCK-258:
---------------------------------

             Summary: Extend the @Mock annotation to be able to also specify expectations.
                 Key: JMOCK-258
                 URL: https://jira.codehaus.org/browse/JMOCK-258
             Project: jMock
          Issue Type: Improvement
          Components: JMock 2.x.x Library
    Affects Versions: 2.5.1
            Reporter: Dan Haywood
            Priority: Minor

For example, 

@Mock(Never.class)
private SomeCollaborator collaborator;

where:

public class Never implements MockExpectations {

  @Override
  public void apply(Mockery context, final Object mock) {
    context.checking( new Expectations() {{ never(mock); }} );
  }
}

The idea here is that Never, Ignoring, Allowing etc would be predefined implementations of
MockExpectations, but that also developers could write their own implemnetations.  One could also,
(Continue reading)

Hristo Sabev (JIRA | 19 Nov 16:17

[jira] Created: (JMOCK-257) deploy 2.6 RC2 in central maven repository or sonatype.org

deploy 2.6 RC2 in central maven repository or sonatype.org
----------------------------------------------------------

                 Key: JMOCK-257
                 URL: https://jira.codehaus.org/browse/JMOCK-257
             Project: jMock
          Issue Type: Task
          Components: Maven Packaging
    Affects Versions: 2.6.0
            Reporter: Hristo Sabev

Hi, I can't find the RC2 in any of the central repositories. Would you upload the 2.6 RC2 in the central repo?
I've seen several such requests around... not in jmock jira but in stackoverflow.com and few other forums

Would it make sense in your oppinion to deploy snapshopts of 2.6, 2.7 in sonatype.org so that folks around
(including me) have easier access to latest development?

Regards,
Hristo

--
This message is automatically generated by JIRA.
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

(Continue reading)

[jira] Created: (JMOCK-256) Mocks being finalized report "the Mockery is not thread-safe: use a Synchroniser to ensure thread safety"

Mocks being finalized report "the Mockery is not thread-safe: use a Synchroniser to ensure thread safety"
---------------------------------------------------------------------------------------------------------

                 Key: JMOCK-256
                 URL: https://jira.codehaus.org/browse/JMOCK-256
             Project: jMock
          Issue Type: Bug
          Components: JMock 2.x.x Library
    Affects Versions: 2.5.1, 2.6.0
            Reporter: John Stoneham
            Priority: Minor

In using JMock to test Grails classes, I'm using the 'grails interactive' mode which can repeatedly invoke
test cases without shutting down the JVM. My tests all extend a common superclass that uses reflection to
introspect and clear out instance variables, including my Mockery instances, so all of these instances
are available for garbage collection. We're using ClassImposteriser as well.

The finalizer comes along and runs finalize() on the mocks. That invocation comes along into the proxy's
callback within ClassImposteriser which gets into SingleThreadedPolicy's
checkRunningOnTestThread method, but you're on the finalizer thread, not the test thread, so you get the
thread-safety message.

--
This message is automatically generated by JIRA.
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
(Continue reading)

[jira] Created: (JMOCK-255) Allow resetting expectations

Allow resetting expectations
----------------------------

                 Key: JMOCK-255
                 URL: https://jira.codehaus.org/browse/JMOCK-255
             Project: jMock
          Issue Type: New Feature
          Components: JMock 2.x.x Library
    Affects Versions: 2.5.1
            Reporter: Mehran Heidarzadeh

Currently there is no reset method for the mockery. This is usually a good thing, because it calls for
smaller test cases. However, it creates issues when testing legacy code that make static calls to the DI
container, or the dependencies that are automatically injected (e.g. using @Autowired annotation in
Spring). Those dependencies are created once upon the initialization of the dependency injection
framework, and stay there throughout the life of the unit test. In these situations mocks which are
created by the DI container(singletons) need to be reset between test methods. 

See the discussion about the same feature in mockito:
http://code.google.com/p/mockito/issues/detail?id=55. 

--
This message is automatically generated by JIRA.
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

(Continue reading)

Fedor Bobin | 3 Sep 11:45
Picon

Please review my work on jmock project.

There is some work on jmock done by me:


  git read-only                  git://github.com/Fuud/jmock-library.git
  project page at github: https://github.com/Fuud/jmock-library

  fixed issues:
    
  enchancments:
  •     can mix parameters and matchers in expectations
  •     Mockery.reset to reset expectations.
  •     Mockery.waitForSatisfaction() (can realy help when test multithread code)
  •     added some useful actions (return list, return set, delegateTo, checkEDT (for swing developers), sleep)
  •     will() now accept vargargs (do not need to write will(doAll(...)), now it is possible to use will(...)).

  also separate project to isolate modules, build system changed from ant to maven.

Can anyone review my changes?
Can anyone push them into main repo?

Thanks.

[jira] Created: (JMOCK-254) Ability to allow to invoke a method in legacy code.

Ability to allow to invoke a method in legacy code.
---------------------------------------------------

                 Key: JMOCK-254
                 URL: https://jira.codehaus.org/browse/JMOCK-254
             Project: jMock
          Issue Type: Improvement
            Reporter: Ignat Zapolsky
            Priority: Minor
         Attachments: Code_that_enables_fall-through_logic_for_legacy_classes_.patch

Hi,

Sometimes when there is a lot of poorly structured code in a project it might be easier to call original
method of mocked object to capture all it's expectations and interactions before doing refactoring.

Currently jMock does not allow to do this, but there is quite simple enhancement to be done for such dire situation.

Please find a patch (few changed + new classes + test demonstrating how it works) attached. 

--
This message is automatically generated by JIRA.
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

Matthew Hussey (JIRA | 31 Aug 14:39

[jira] Created: (JMOCK-253) Website appears to be down

Website appears to be down
--------------------------

                 Key: JMOCK-253
                 URL: https://jira.codehaus.org/browse/JMOCK-253
             Project: jMock
          Issue Type: Bug
          Components: Website
         Environment: Windows XP ie, Windows 7 Chrome, Android Opera Mobile, http://www.downforeveryoneorjustme.com/www.jmock.org
            Reporter: Matthew Hussey

The website doesn't appear to work. downforeveryoneorjustme confirms that the site is down.
I've been trying to get to the cookbook and API documentation but cannot.

--
This message is automatically generated by JIRA.
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] Created: (JMOCK-252) Mockery.describeTo() throws ConcurrentModificationException when an invocation's toString() makes another invocation

Mockery.describeTo() throws ConcurrentModificationException when an invocation's toString() makes
another invocation
--------------------------------------------------------------------------------------------------------------------

                 Key: JMOCK-252
                 URL: http://jira.codehaus.org/browse/JMOCK-252
             Project: jMock
          Issue Type: Bug
          Components: JMock 2.x.x Library
    Affects Versions: 2.5.1
            Reporter: Richard Barnett
            Priority: Minor

This can occur when a test has already failed, & JMock is producing its description of what's happened & what
was expected.  The exception prevents display of this description, making it hard to work out how the test failed.

Mockery.describeTo:

{code}
    public void describeTo(Description description) {
        description.appendDescriptionOf(dispatcher)
                   .appendText("\nwhat happened before this:");

        if (actualInvocations.isEmpty()) {
            description.appendText(" nothing!");
        }
        else {
            description.appendList("\n  ", "\n  ", "\n", actualInvocations);
        }
    }
{code}

If actualInvocations is modified because an invocation's description caused another invocation, then
the iteration in BaseDescription.appendList throws ConcurrentModificationException:

{code}
java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
	at java.util.AbstractList$Itr.next(AbstractList.java:343)
	at org.hamcrest.BaseDescription.appendList(BaseDescription.java:78)
	at org.hamcrest.BaseDescription.appendList(BaseDescription.java:69)
	at org.jmock.Mockery.describeTo(Mockery.java:208)
	at org.jmock.api.ExpectationError.describeTo(ExpectationError.java:43)
	at org.hamcrest.BaseDescription.appendDescriptionOf(BaseDescription.java:21)
	at org.hamcrest.StringDescription.toString(StringDescription.java:28)
	at org.jmock.lib.AssertionErrorTranslator.translate(AssertionErrorTranslator.java:20)
	at org.jmock.Mockery.dispatch(Mockery.java:223)
	at org.jmock.Mockery.access$000(Mockery.java:43)
	at org.jmock.Mockery$MockObject.invoke(Mockery.java:258)
	at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27)
	at org.jmock.internal.FakeObjectMethods.invoke(FakeObjectMethods.java:38)
	at org.jmock.lib.legacy.ClassImposteriser$4.invoke(ClassImposteriser.java:137)
	at scratch.ConcurrentModificationExceptionTest$Collaborator$$EnhancerByCGLIB$$11593041.message(<generated>)
	at scratch.ConcurrentModificationExceptionTest$Subject.doIt(ConcurrentModificationExceptionTest.java:102)
	at scratch.ConcurrentModificationExceptionTest.test(ConcurrentModificationExceptionTest.java:54)
{code}

Possible solutions:
* Pass a copy of actualInvocations to appendList()
* Change Mockery state to ignore further invocations
* Handle this exception

Where the original failure is due to an unexpected invocation, overriding Mockery.describeTo() to do
nothing allows the AssertionError to be displayed.

Attachment reproduces the issue.

--

-- 
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

Romilly Cocking | 20 Apr 12:12
Picon

Cardinality - missing cases

The description of Cardinality covers a lot of cases, but not 'at least once'
or 'at most once'.

I've created a patch (for tests as well), and will mail it if wanted.

I found the problem while working on my Python port, which is coming along
nicely.

Romilly

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

    http://xircles.codehaus.org/manage_email

Dwayne D'Souza (JIRA | 24 Jan 12:58

[jira] Created: (JMOCK-251) Including JMock 1 and JMock2

Including JMock 1 and JMock2
----------------------------

                 Key: JMOCK-251
                 URL: http://jira.codehaus.org/browse/JMOCK-251
             Project: jMock
          Issue Type: Improvement
            Reporter: Dwayne D'Souza

I would like to include JMock 1 & JMock 2 using Maven...However I cannot add both dependencies:

<dependency>
    <groupId>org.jmock</groupId>
    <artifactId>jmock</artifactId>
    <version>1.2.0</version>   
</dependency>
<!--Include Both Jmock 1&2 is cool: http://www.jmock.org/upgrade1to2.html -->
    <dependency>
      <groupId>org.jmock</groupId>
      <artifactId>jmock</artifactId>
      <version>2.5.1</version>
    </dependency>  

Could you add that JMock 1 artifacts under a different id?

Thanks,
D

--

-- 
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


Gmane