Examples of Given


Examples of ch.unibe.jexample.Given

        this.expectedException = initExpectedException();
    }

    protected Iterable<MethodReference> collectDependencies() {
        Collection<MethodReference> all = new ArrayList<MethodReference>();
        Given a = method.getAnnotation(Given.class);
        if (a == null) return all;
        try {
            for (MethodLocator each: MethodLocator.parseAll(a.value()))
                all.add(each.resolve(method.jclass));
        } catch (InvalidDeclarationError ex) {
            errors.add(Kind.INVALID_DEPENDS_DECLARATION, ex);
        } catch (SecurityException ex) {
            errors.add(Kind.PROVIDER_NOT_FOUND, ex);
View Full Code Here

Examples of org.jbehave.core.annotations.Given

    public List<StepCandidate> listCandidates() {
        List<StepCandidate> candidates = new ArrayList<StepCandidate>();
        for (Method method : allMethods()) {
            if (method.isAnnotationPresent(Given.class)) {
                Given annotation = method.getAnnotation(Given.class);
                String value = annotation.value();
                int priority = annotation.priority();
                addCandidatesFromVariants(candidates, method, GIVEN, value, priority);
                addCandidatesFromAliases(candidates, method, GIVEN, priority);
            }
            if (method.isAnnotationPresent(When.class)) {
                When annotation = method.getAnnotation(When.class);
                String value = annotation.value();
                int priority = annotation.priority();
                addCandidatesFromVariants(candidates, method, WHEN, value, priority);
                addCandidatesFromAliases(candidates, method, WHEN, priority);
            }
            if (method.isAnnotationPresent(Then.class)) {
                Then annotation = method.getAnnotation(Then.class);
                String value = annotation.value();
                int priority = annotation.priority();
                addCandidatesFromVariants(candidates, method, THEN, value, priority);
                addCandidatesFromAliases(candidates, method, THEN, priority);
            }
        }
        return candidates;
View Full Code Here

Examples of org.jbehave.core.annotations.Given

    public List<StepCandidate> listCandidates() {
        List<StepCandidate> candidates = new ArrayList<StepCandidate>();
        for (Method method : allMethods()) {
            if (method.isAnnotationPresent(Given.class)) {
                Given annotation = method.getAnnotation(Given.class);
                String value = annotation.value();
                int priority = annotation.priority();
                addCandidate(candidates, method, GIVEN, value, priority);
                addCandidatesFromAliases(candidates, method, GIVEN, priority);
            }
            if (method.isAnnotationPresent(When.class)) {
                When annotation = method.getAnnotation(When.class);
                String value = annotation.value();
                int priority = annotation.priority();
                addCandidate(candidates, method, WHEN, value, priority);
                addCandidatesFromAliases(candidates, method, WHEN, priority);
            }
            if (method.isAnnotationPresent(Then.class)) {
                Then annotation = method.getAnnotation(Then.class);
                String value = annotation.value();
                int priority = annotation.priority();
                addCandidate(candidates, method, THEN, value, priority);
                addCandidatesFromAliases(candidates, method, THEN, priority);
            }
        }
        return candidates;
View Full Code Here

Examples of org.moresbycoffee.have.annotations.Given

    }

    private static <T extends Annotation> int getAnnotationPriority(final Class<T> annotation, final Method method) {
        if (annotation == Given.class) {
            if (method.isAnnotationPresent(Given.class)) {
                final Given given = method.getAnnotation(Given.class);
                return given.priority();
            }
        } else if (annotation == When.class) {
            if (method.isAnnotationPresent(When.class)) {
                final When when = method.getAnnotation(When.class);
                return when.priority();
View Full Code Here

Examples of org.moresbycoffee.have.annotations.Given

    }

    private static <T extends Annotation> String[] getAnnotationValue(final Class<T> annotation, final Method method) {
        if (annotation == Given.class) {
            if (method.isAnnotationPresent(Given.class)) {
                final Given given = method.getAnnotation(Given.class);
                return given.value();
            }
        } else if (annotation == When.class) {
            if (method.isAnnotationPresent(When.class)) {
                final When when = method.getAnnotation(When.class);
                return when.value();
View Full Code Here

Examples of restx.specs.Given

            return name;
        }

        private void recordGeneratedId(String name, ObjectId id) {
            String key = getGivenCollectionKey(name);
            Given given = givens.get(key);
            if (given instanceof GivenJongoCollection) {
                GivenJongoCollection collection = (GivenJongoCollection) given;
                givens.put(key, collection.addSequenceId(id.toString()));
                System.out.println(" >> recorded OID " + name + " > " + id);
            }
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.