liangzai-cool / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

IsCollectionContaining and other classes missing from Hamcrest 1.2 #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following classes were in hamcrest-library-1.1.jar but are missing from
hamcrest-library-1.2.jar:

org/hamcrest/collection/IsCollectionContaining
org/hamcrest/number/IsGreaterThan
org/hamcrest/number/OrderingComparisons
org/hamcrest/text/StringContains
org/hamcrest/text/StringEndsWith
org/hamcrest/text/StringStartsWith
org/hamcrest/text/SubstringMatcher
org/hamcrest/text/X

This means that any tests, custom matchers or factory methods that refer
directly to these types (instead of through the Matchers factory methods)
are broken by an update to 1.2.

Adding simple forwarding classes like this seems to fix both binary and
source compatibility:

package org.hamcrest.collection;

import org.hamcrest.Matcher;

@Deprecated
public class IsCollectionContaining<T> extends
org.hamcrest.core.IsCollectionContaining<T> {
  public IsCollectionContaining(Matcher<? super T> elementMatcher) {
    super(elementMatcher);
  }
}

I suppose these could be put in hamcrest-compat-1.2.jar or something to
keep the main hamcrest-library-1.2.jar clean.

Original issue reported on code.google.com by petur...@gmail.com on 2 Jun 2009 at 5:29

GoogleCodeExporter commented 9 years ago
check in core. I think most of the got moved there. You might have to 
reorganise your imports, but that should 
be straightforward in an IDE

Original comment by smgfree...@gmail.com on 2 Jun 2009 at 11:05

GoogleCodeExporter commented 9 years ago
It is possible to update the imports, but it's a lot of files that need to be
updated. When the code containing the import has been compiled into a jar, that 
jar
needs to be recompiled and updated along with Hamcrest.

Original comment by petur...@gmail.com on 3 Jun 2009 at 10:51

GoogleCodeExporter commented 9 years ago
Not sure it's worth it for us to fix this. For builds, it's probably best to 
import hamcrest-all

Original comment by smgfree...@gmail.com on 25 Apr 2012 at 10:26