Package org.easymock

Examples of org.easymock.IArgumentMatcher


    EasyMock.verify(ctx);
  }

  static FeatureVectorWithRatingWritable matchFeatureVector(final Vector.Element... elements) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof FeatureVectorWithRatingWritable) {
          Vector v = ((FeatureVectorWithRatingWritable) argument).getFeatureVector();
          return MathHelper.consistsOf(v, elements);
View Full Code Here


  /**
   * verifies the {@link Vector} included in a {@link VectorOrPrefWritable}
   */
  private static VectorOrPrefWritable vectorOfVectorOrPrefWritableMatches(final Vector.Element... elements) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof VectorOrPrefWritable) {
          Vector v = ((VectorOrPrefWritable) argument).getVector();
          return MathHelper.consistsOf(v, elements);
View Full Code Here

  /**
   * verifies a preference in a {@link VectorOrPrefWritable}
   */
  private static VectorOrPrefWritable prefOfVectorOrPrefWritableMatches(final long userID, final float prefValue) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof VectorOrPrefWritable) {
          VectorOrPrefWritable pref = ((VectorOrPrefWritable) argument);
          return pref.getUserID() == userID && pref.getValue() == prefValue;
View Full Code Here

  /**
   * verifies that a preference value is NaN in a {@link VectorOrPrefWritable}
   */
  private static VectorOrPrefWritable prefOfVectorOrPrefWritableMatchesNaN(final long userID) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof VectorOrPrefWritable) {
          VectorOrPrefWritable pref = ((VectorOrPrefWritable) argument);
          return pref.getUserID() == userID && Float.isNaN(pref.getValue());
View Full Code Here

  /**
   * verifies a {@link VectorAndPrefsWritable}
   */
  private static VectorAndPrefsWritable vectorAndPrefsWritableMatches(final List<Long> userIDs,
      final List<Float> prefValues, final Vector.Element... elements) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof VectorAndPrefsWritable) {
          VectorAndPrefsWritable vectorAndPrefs = ((VectorAndPrefsWritable) argument);

View Full Code Here

    EasyMock.verify(context);
  }

  static VectorAndPrefsWritable vectorAndPrefsForFilteringMatches(final long itemID, final long... userIDs) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof VectorAndPrefsWritable) {
          VectorAndPrefsWritable vectorAndPrefs = (VectorAndPrefsWritable) argument;
          Vector vector = vectorAndPrefs.getVector();
View Full Code Here

  /**
   * verifies a {@link RecommendedItemsWritable}
   */
  static RecommendedItemsWritable recommendationsMatch(final RecommendedItem... items) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof RecommendedItemsWritable) {
          RecommendedItemsWritable recommendedItemsWritable = ((RecommendedItemsWritable) argument);
          List<RecommendedItem> expectedItems = new LinkedList<RecommendedItem>(Arrays.asList(items));
View Full Code Here

  /**
   * applies an {@link IArgumentMatcher} to {@link MatrixEntryWritable}s
   */
  public static MatrixEntryWritable matrixEntryMatches(final int row, final int col, final double value) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof MatrixEntryWritable) {
          MatrixEntryWritable entry = (MatrixEntryWritable) argument;
          return (row == entry.getRow()
View Full Code Here

  /**
   * applies an {@link IArgumentMatcher} to a {@link VectorWritable} that checks whether all elements are included
   */
  public static VectorWritable vectorMatches(final Vector.Element... elements) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof VectorWritable) {
          Vector v = ((VectorWritable) argument).get();
          return consistsOf(v, elements);
View Full Code Here

  /**
   * Applies an {@link IArgumentMatcher} to a {@link CountUsersKeyWritable} checking whether it matches the userID
   */
  static CountUsersKeyWritable keyForUserID(final long userID) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof CountUsersKeyWritable) {
          CountUsersKeyWritable key = (CountUsersKeyWritable) argument;
          return userID == key.getUserID();
View Full Code Here

TOP

Related Classes of org.easymock.IArgumentMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.