Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for RuleActionValidationException (0.28 sec)

  1. platforms/software/dependency-management/src/main/java/org/gradle/internal/rules/RuleActionValidationException.java

     */
    
    package org.gradle.internal.rules;
    
    import org.gradle.api.GradleException;
    
    public class RuleActionValidationException extends GradleException {
        public RuleActionValidationException(String message) {
            super(message);
        }
    
        public RuleActionValidationException(String message, Throwable cause) {
            super(message, cause);
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 967 bytes
    - Viewed (0)
  2. platforms/software/dependency-management/src/test/groovy/org/gradle/internal/rules/DefaultRuleActionAdapterTest.groovy

            failure.cause instanceof RuleActionValidationException
            failure.cause.message == "FAILED"
        }
    
        def "fails to adapt action when validation fails" () {
            def RuleActionValidator ruleActionValidator = Stub(RuleActionValidator) {
                validate(_) >> { RuleAction ruleAction -> throw new RuleActionValidationException("FAILED") }
            }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  3. platforms/software/dependency-management/src/test/groovy/org/gradle/internal/rules/DefaultRuleActionValidatorTest.groovy

            ruleValidator.validate(Stub(RuleAction) {
                getInputTypes() >> { [ Long ] }
            })
    
            then:
            def failure = thrown(RuleActionValidationException)
            failure.message == "Rule may not have an input parameter of type: java.lang.Long. Second parameter must be of type: java.lang.Integer."
        }
    
        def "rejects invalid type when no type configured" () {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  4. platforms/software/dependency-management/src/main/java/org/gradle/internal/rules/DefaultRuleActionAdapter.java

            try {
                return ruleActionValidator.validate(new ClosureBackedRuleAction<>(subjectType, closure));
            } catch (RuleActionValidationException e) {
                throw new InvalidUserCodeException(String.format(INVALID_CLOSURE_ERROR, context), e);
            }
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  5. platforms/software/dependency-management/src/test/groovy/org/gradle/internal/rules/ClosureBackedRuleActionTest.groovy

            given:
            def closure = { Integer val ->
            }
    
            when:
            action(closure)
    
            then:
            def e = thrown RuleActionValidationException
            e.message == "First parameter of rule action closure must be of type 'String'."
        }
    
        def "fails to construct with multiple arg closure with incorrect subject"() {
            given:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  6. platforms/software/dependency-management/src/test/groovy/org/gradle/api/internal/artifacts/dsl/DefaultComponentMetadataHandlerTest.groovy

    import org.gradle.internal.resolve.caching.ComponentMetadataRuleExecutor
    import org.gradle.internal.rules.RuleAction
    import org.gradle.internal.rules.RuleActionAdapter
    import org.gradle.internal.rules.RuleActionValidationException
    import org.gradle.internal.serialize.Serializer
    import org.gradle.internal.snapshot.ValueSnapshotter
    import org.gradle.util.AttributeTestUtil
    import org.gradle.util.SnapshotTestUtil
    import org.gradle.util.TestUtil
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 20.4K bytes
    - Viewed (0)
  7. platforms/software/dependency-management/src/main/java/org/gradle/internal/rules/DefaultRuleActionValidator.java

        private void validateInputTypes(RuleAction<?> ruleAction) {
            for (Class<?> inputType : ruleAction.getInputTypes()) {
                if (!validInputType.contains(inputType)) {
                    throw new RuleActionValidationException(invalidParameterMessage(inputType));
                }
            }
        }
    
        private String invalidParameterMessage(Class<?> inputType) {
            if (validInputType.isEmpty()) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  8. platforms/software/dependency-management/src/main/java/org/gradle/internal/rules/ClosureBackedRuleAction.java

                if (parameterTypes[0].isAssignableFrom(subjectType)) {
                    inputTypes.addAll(Arrays.asList(parameterTypes).subList(1, parameterTypes.length));
                } else {
                    throw new RuleActionValidationException(String.format("First parameter of rule action closure must be of type '%s'.", subjectType.getSimpleName()));
                }
            }
    
            return inputTypes;
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Dec 11 13:37:56 UTC 2023
    - 3K bytes
    - Viewed (0)
  9. platforms/software/dependency-management/src/main/java/org/gradle/internal/rules/RuleSourceBackedRuleAction.java

                    }
                }
            }
    
            if (problemsFormatter.hasProblems()) {
                throw new RuleActionValidationException(problemsFormatter.format());
            }
    
            return new RuleSourceBackedRuleAction<>(ruleSourceInstance, new JavaMethod<>(subjectType.getConcreteClass(), mutateMethods.get(0)));
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  10. platforms/software/dependency-management/src/test/groovy/org/gradle/internal/rules/RuleSourceBackedRuleActionTest.groovy

        }
    
        def "fails to create rule action for invalid rule source"() {
            when:
            action = RuleSourceBackedRuleAction.create(listType, ruleSource)
    
            then:
            def e = thrown RuleActionValidationException
            e.message.startsWith("Type ${fullyQualifiedNameOf(ruleSource.class)} is not a valid rule source:")
            def messageReasons = getReasons(e.message)
            messageReasons.size() == reasons.size()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 6.4K bytes
    - Viewed (0)
Back to top