Package org.mockito.internal.debugging

Examples of org.mockito.internal.debugging.Location


    public void check(List<Invocation> invocations, InvocationMatcher wanted, int wantedCount) {
        List<Invocation> actualInvocations = finder.findInvocations(invocations, wanted);
       
        int actualCount = actualInvocations.size();
        if (wantedCount > actualCount) {
            Location lastLocation = finder.getLastLocation(actualInvocations);
            reporter.tooLittleActualInvocations(new AtLeastDiscrepancy(wantedCount, actualCount), wanted, lastLocation);       
        }
       
        invocationMarker.markVerified(invocations, wanted);
    }
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

    }
   
    public void noMoreInteractionsWanted(PrintableInvocation undesired) {
        throw new NoInteractionsWanted(join(
                "No interactions wanted here:",
                new Location(),
                "But found this interaction:",
                undesired.getLocation(),
                ""
                ));
    }
View Full Code Here

    }

    public void smartNullPointerException(Location location) {
        throw new SmartNullPointerException(join(
                "You have a NullPointerException here:",
                new Location(),
                "Because this method was *not* stubbed correctly:",
                location,
                ""
                ));
    }
View Full Code Here

        this.method = method;
        this.realMethod = realMethod;
        this.arguments = expandVarArgs(method.isVarArgs(), args);
        this.rawArguments = args;
        this.sequenceNumber = sequenceNumber;
        this.location = new Location();
    }
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.