Package org.mockito.internal.debugging

Examples of org.mockito.internal.debugging.Location


    private final Matcher actualMatcher;
    private Location location;

    public LocalizedMatcher(Matcher actualMatcher) {
        this.actualMatcher = actualMatcher;
        this.location = new Location();
    }
View Full Code Here


    private final Matcher actualMatcher;
    private Location location;

    public LocalizedMatcher(Matcher actualMatcher) {
        this.actualMatcher = actualMatcher;
        this.location = new Location();
    }
View Full Code Here

        this.mock = mock;
        this.realMethod = realMethod;
        this.arguments = expandVarArgs(mockitoMethod.isVarArgs(), args);
        this.rawArguments = args;
        this.sequenceNumber = sequenceNumber;
        this.location = new Location();
    }
View Full Code Here

              + _aberration);
    }

    int minNumberOfInvocations = _wantedNumberOfInvocations - _aberration;
    if (invocationCount < minNumberOfInvocations) {
      Location lastLocation = finder.getLastLocation(invocations);
      reporter.tooLittleActualInvocations(new AtLeastDiscrepancy(minNumberOfInvocations, invocationCount), wanted,
              lastLocation);
    }
    int maxNumberOfInvocations = _wantedNumberOfInvocations + _aberration;
    if (invocationCount > maxNumberOfInvocations) {
View Full Code Here

    }   

    public void argumentsAreDifferent(String wanted, String actual, Location actualLocation) {
        String message = join("Argument(s) are different! Wanted:",
                wanted,
                new Location(),
                "Actual invocation has different arguments:",
                actual,
                actualLocation,
                ""
                );
View Full Code Here

    private String createWantedButNotInvokedMessage(PrintableInvocation wanted) {
        return join(
                "Wanted but not invoked:",
                wanted.toString(),
                new Location(),
                ""
        );
    }
View Full Code Here

    public void wantedButNotInvokedInOrder(PrintableInvocation wanted, PrintableInvocation previous) {
        throw new VerificationInOrderFailure(join(
                    "Verification in order failure",
                    "Wanted but not invoked:",
                    wanted.toString(),
                    new Location(),
                    "Wanted anywhere AFTER following interaction:",
                    previous.toString(),
                    previous.getLocation(),
                    ""
        ));
View Full Code Here

    private String createTooManyInvocationsMessage(int wantedCount, int actualCount, PrintableInvocation wanted,
            Location firstUndesired) {
        return join(
                wanted.toString(),
                "Wanted " + Pluralizer.pluralize(wantedCount) + ":",
                new Location(),
                "But was " + pluralize(actualCount) + ". Undesired invocation:",
                firstUndesired,
                ""
        );
    }
View Full Code Here

   
    public void neverWantedButInvoked(PrintableInvocation wanted, Location firstUndesired) {
        throw new NeverWantedButInvoked(join(
                wanted.toString(),
                "Never wanted here:",
                new Location(),
                "But invoked here:",
                firstUndesired,
                ""
        ));
    }   
View Full Code Here

            (lastActualInvocation != null)? lastActualInvocation + "\n" : "\n";
           
            String message = join(
                    wanted.toString(),
                    "Wanted " + discrepancy.getPluralizedWantedCount() + ":",
                    new Location(),
                    "But was " + discrepancy.getPluralizedActualCount() + ":",
                    ending
            );
            return message;
    }
View Full Code Here

TOP

Related Classes of org.mockito.internal.debugging.Location

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.