ComponentTypeModelRuleExtractorTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Improve fully qualified representation of nested model types

Use `.` instead of `$` to separate the enclosing type name from the

nested type name.

    • -1
    • +3
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 24 more files in changeset.
Replace `@BinaryType` and `@LanguageType` with `@ComponentType`

The original annotations have been retained for the purpose of

deprecation but they no longer work.

    • -4
    • +4
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 64 more files in changeset.
Split up `ComponentModelBasePlugin` to 2 separate plugins: one which deals with the very base `ComponentSpec` type and infrastructure, and one which deals with the higher level component types such as `LibrarySpec` and `ApplicationSpec`.

    • -6
    • +32
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 14 more files in changeset.
Removed some unnecessary or duplicate validation from type registration rule implementation:

- Implementation class does not necessarily need to extend some base class.

- Implementation class does not need to implement public or internal view types.

- Implementation classes does not necessarily need a no-args constructor.

    • -4
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 14 more files in changeset.
Another attempt to fix broken unit test on IBM Java 6

    • -2
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Another attempt to fix broken unit test on IBM Java 6

    • -2
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Another attempt to fix broken unit test on IBM Java 6

    • -2
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Fixed broken unit test on IBM Java 6

    • -2
    • +2
    ./ComponentTypeModelRuleExtractorTest.groovy
Removed the various subtypes of `TypeBuilder`. These have been replaced by `TypeBuilder`.

    • -3
    • +5
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 10 more files in changeset.
Replaced most usages of `BinaryTypeBuilder` and `ComponentTypeBuilder` with the more general `TypeBuilder`.

    • -15
    • +15
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 48 more files in changeset.
Changed the contract for @ComponentType, @BinaryType and @LanguageType rule methods so that they may accept a `TypeBuilder` instead of the annotation-specific subtype of `TypeBuilder`.

This will allow the removal of the annotation-specific subtypes. These subtypes are all now empty.

    • -3
    • +3
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
`ModelAction` no longer needs to be parameterized.

    • -1
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 35 more files in changeset.
Treat `@RuleInput` properties on `RuleSource` types as references to implicit inputs for all rules on the rule source.

Moved responsibility for applying a rule to a particular scope up from `ModelRegistry` to `ModelRuleExtractor`. Now, all `RuleAction` instances applied to a `ModelRegistry` are applied relative to the root element, and it is the caller's responsibility to scope the action as required before registering it.

+review REVIEW-5756

    • -2
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 16 more files in changeset.
Reworked when type registration rules are executed, so that they behave like real rules, and are executed as required.

This means better error reporting, plus the other benefits of rules execution. Downside is that the result is not reused across projects or build invocations, whereas it previously was. However this is currently true of rules in general, and there's a good chance the jvm can optimise this particular kind of rules given they are usually super simple.

+review REVIEW-5756

    • -1
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 8 more files in changeset.
Changed type registration so that rule method is invoked when the rule source is applied, rather then when it is inspected.

+review REVIEW-5756

    • -3
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 11 more files in changeset.
Reworked the parameters to `ExtractedModelRule.apply()` so that per-application context, such as explicit bindings, can be provided.

+review REVIEW-5756

    • -2
    • +5
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 12 more files in changeset.
Moved some classes from o.g.model.internal.core to o.g.model.internal.inspect.

Also moved a class that was only used by a single test to live in that test class.

+review REVIEW-5756

    • -0
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 27 more files in changeset.
Moved a bunch of singletons off several prod classes to live on `ProjectRegistrySpec`.

+review REVIEW-5756

    • -2
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 30 more files in changeset.
Collect several more `RuleSource` validation problems rather than failing on first problem.

In particular, problems with `@Model` and type registration rules are collected.

Also defer validation for whether the subject of a `@Model` rule can be created or not, until we know the set of element types that can be constructed.

+review REVIEW-5739

    • -17
    • +34
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 18 more files in changeset.
More improvements to validation of a RuleSource type.

- Fixed NPE when a rule method has no parameters.

- Collect more kinds of validation failures, rather than failing on first of these kinds of failures.

- Validate that the first parameter of a `@Rules` metod is assignable to `RuleSource`

+review REVIEW-5739

    • -3
    • +2
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 19 more files in changeset.
Remove some unused methods

+review REVIEW-5752

    • -4
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Add type parameter to ModelAction

AbstractModelAction already had a type parameter, so ModelAction should

have one too.

+review REVIEW-5738

    • -1
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 36 more files in changeset.
Removed irrelevant tests

We do allow configuring BinarySpec/ComponentSpec now.

+review REVIEW-5696

    • -1
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Moved test interfaces back to their tests themselves

Since IBM JDK 6 is not throwing errors about these anymore, might as

well move them back to the tests they belong to.

+review REVIEW-5658

    • -1
    • +9
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 21 more files in changeset.
Fixed classycle problem with InstanceFactories referencing base types

+review REVIEW-5651

    • -1
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 9 more files in changeset.
Don't require internal views to extend base interface type

+review REVIEW-5620

    • -7
    • +2
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 10 more files in changeset.
Model actions don't get access automatically to node view

+review REVIEW-5629

    • -1
    • +1
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 29 more files in changeset.
Test fixes for IBM JDK 6

+review REVIEW-5620

    • -32
    • +26
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 5 more files in changeset.
"Fixed" test

+review REVIEW-5620

    • -9
    • +0
    ./ComponentTypeModelRuleExtractorTest.groovy
Added error condition tests

+review REVIEW-5620

    • -16
    • +52
    ./ComponentTypeModelRuleExtractorTest.groovy
  1. … 2 more files in changeset.