Examples of IArgumentMatcher


Examples of org.easymock.IArgumentMatcher

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

Examples of org.easymock.IArgumentMatcher

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

Examples of org.easymock.IArgumentMatcher

   * applies an {@link IArgumentMatcher} to a {@link WeightedOccurrenceArray} that checks whether
   * it matches all {@link WeightedOccurrence}
   */
  static WeightedOccurrenceArray weightedOccurrenceArrayMatches(
      final Collection<WeightedOccurrence> occurrencesToMatch) {
    EasyMock.reportMatcher(new IArgumentMatcher() {
      @Override
      public boolean matches(Object argument) {
        if (argument instanceof WeightedOccurrenceArray) {
          WeightedOccurrence[] occurrences = ((WeightedOccurrenceArray) argument).getWeightedOccurrences();
          if (occurrences.length != occurrencesToMatch.size()) {
View Full Code Here

Examples of org.easymock.IArgumentMatcher

        Marshaller marshaller = control.createMock(Marshaller.class);
        ContextUtils.getJAXBContext().createMarshaller();
        EasyMock.expectLastCall().andReturn(marshaller);
        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
        EasyMock.expectLastCall();
        IArgumentMatcher matcher = new JAXBEltMatcher();
        int len = expectFaultTo ? expectedValues.length : expectedValues.length - 1;
        for (int i = 0; i < len; i++) {
            if (!requestor || i != 4) {
                EasyMock.reportMatcher(matcher);
                EasyMock.eq(header);
View Full Code Here

Examples of org.easymock.IArgumentMatcher

      verify(command);
   }

   public static Exception exceptionEq(final Class<? extends Exception> in, final String exceptionMessage) {
      reportMatcher(new IArgumentMatcher() {

         @Override
         public void appendTo(StringBuffer buffer) {
            buffer.append("exceptionEq(");
            buffer.append(in);
View Full Code Here

Examples of org.easymock.IArgumentMatcher

        Marshaller marshaller = control.createMock(Marshaller.class);
        ContextUtils.getJAXBContext().createMarshaller();
        EasyMock.expectLastCall().andReturn(marshaller);
        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
        EasyMock.expectLastCall();
        IArgumentMatcher matcher = new JAXBEltMatcher();
        int expectedMarshals = requestor
                               ? expectedValues.length - 1
                               : expectedValues.length;
        for (int i = 0; i < expectedMarshals; i++) {
            EasyMock.reportMatcher(matcher);
View Full Code Here

Examples of org.easymock.IArgumentMatcher

        verify();
    }

    private static BeanEditContext contextEq()
    {
        EasyMock.reportMatcher(new IArgumentMatcher()
        {
            public void appendTo(StringBuffer buf)
            {
                buf.append("BeanEditContextEq(RegistrationData.class)");
            }
View Full Code Here

Examples of org.easymock.IArgumentMatcher

        Marshaller marshaller = control.createMock(Marshaller.class);
        ContextUtils.getJAXBContext().createMarshaller();
        EasyMock.expectLastCall().andReturn(marshaller);
        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
        EasyMock.expectLastCall();
        IArgumentMatcher matcher = new JAXBEltMatcher();
        int expectedMarshals = requestor
                               ? expectedValues.length - 1
                               : expectedValues.length;
        for (int i = 0; i < expectedMarshals; i++) {
            EasyMock.reportMatcher(matcher);
View Full Code Here

Examples of org.easymock.IArgumentMatcher

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

Examples of org.easymock.IArgumentMatcher

  /**
   * 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
TOP
Copyright © 2018 www.massapi.com. 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.