Package org.mockito.internal.debugging

Examples of org.mockito.internal.debugging.Location


        ScenarioPrinter scenarioPrinter = new ScenarioPrinter();
        String scenario = scenarioPrinter.print(invocations);

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


    }

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

    }

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

        return temp;
    }

    public void stubbingStarted() {
        validateState();
        stubbingInProgress = new Location();
    }
View Full Code Here

    public void validateState() {
        validateMostStuff();
       
        //validate stubbing:
        if (stubbingInProgress != null) {
            Location temp = stubbingInProgress;
            stubbingInProgress = null;
            reporter.unfinishedStubbing(temp);
        }
    }
View Full Code Here

        //State is cool when GlobalConfiguration is already loaded
        //this cannot really be tested functionally because I cannot dynamically mess up org.mockito.configuration.MockitoConfiguration class
        GlobalConfiguration.validate();

        if (verificationMode != null) {
            Location location = verificationMode.getLocation();
            verificationMode = null;
            reporter.unfinishedVerificationException(location);
        }

        getArgumentMatcherStorage().validateState();
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

        List<Invocation> chunk = finder.findMatchingChunk(invocations, wanted, wantedCount, context);
       
        int actualCount = chunk.size();
       
        if (wantedCount > actualCount) {
            Location lastInvocation = finder.getLastLocation(chunk);
            reporter.tooLittleActualInvocationsInOrder(new Discrepancy(wantedCount, actualCount), wanted, lastInvocation);
        } else if (wantedCount < actualCount) {
            Location firstUndesired = chunk.get(wantedCount).getLocation();
            reporter.tooManyActualInvocationsInOrder(wantedCount, actualCount, wanted, firstUndesired);
        }
       
        invocationMarker.markVerifiedInOrder(chunk, wanted, context);
    }
View Full Code Here

    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(actualInvocations, wanted);
    }
View Full Code Here

        List<Invocation> chunk = finder.findAllMatchingUnverifiedChunks(invocations, wanted, orderingContext);
       
        int actualCount = chunk.size();
       
        if (wantedCount > actualCount) {
            Location lastLocation = finder.getLastLocation(chunk);
            reporter.tooLittleActualInvocationsInOrder(new AtLeastDiscrepancy(wantedCount, actualCount), wanted, lastLocation);
        }
       
        invocationMarker.markVerifiedInOrder(chunk, wanted, orderingContext);
    }
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.