BinaryTypeModelRuleExtractorTest.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.

    • -7
    • +9
    ./BinaryTypeModelRuleExtractorTest.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.

    • -33
    • +30
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 64 more files in changeset.
Merged the `BinarySpec` and `LanguageSourceSet` type registries into the `ComponentSpec` registry.

The type registration annotations have not changed, however they all now act on the same registry. The annotations will be merged later.

    • -3
    • +6
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 11 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
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 14 more files in changeset.
Removed the various subtypes of `TypeBuilder`. These have been replaced by `TypeBuilder`.

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

    • -16
    • +16
    ./BinaryTypeModelRuleExtractorTest.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.

    • -5
    • +2
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Changed `@LanguageType` and `@BinaryType` rule extractors so that they apply only the relevant plugin, rather than applying the universe.

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

    • -1
    • +1
    ./BinaryTypeModelRuleExtractorTest.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
    ./BinaryTypeModelRuleExtractorTest.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
    ./BinaryTypeModelRuleExtractorTest.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
    ./BinaryTypeModelRuleExtractorTest.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
    ./BinaryTypeModelRuleExtractorTest.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
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 27 more files in changeset.
Reworked `DefaultModelSchemaExtractor` construction so that default extraction strategies are included only when requested.

This allows a consumer to select which strategies are relevant to that consumer.

+review REVIEW-5756

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

+review REVIEW-5756

    • -4
    • +2
    ./BinaryTypeModelRuleExtractorTest.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

    • -20
    • +37
    ./BinaryTypeModelRuleExtractorTest.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

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

+review REVIEW-5752

    • -4
    • +0
    ./BinaryTypeModelRuleExtractorTest.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
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 36 more files in changeset.
Removed unused schema extraction strategy.

    • -3
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 1 more file in changeset.
Removed irrelevant tests

We do allow configuring BinarySpec/ComponentSpec now.

+review REVIEW-5696

    • -1
    • +0
    ./BinaryTypeModelRuleExtractorTest.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

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

+review REVIEW-5651

    • -1
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 9 more files in changeset.
Register binaries directly to `BinarySpecFactory`

+review REVIEW-5634

    • -4
    • +10
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 5 more files in changeset.
Implement internal views for binaries

+review REVIEW-5634

    • -30
    • +45
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 6 more files in changeset.
Model actions don't get access automatically to node view

+review REVIEW-5629

    • -1
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 29 more files in changeset.
Fixed tests

+review REVIEW-5620

    • -8
    • +16
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 4 more files in changeset.
Add schema aspect extraction

+review REVIEW-5587

    • -3
    • +4
    ./BinaryTypeModelRuleExtractorTest.groovy
  1. … 18 more files in changeset.
Fix test for IBM JDK 6

Apparently you can’t have nested interfaces in Groovy with IBM JDK 6

+review REVIEW-5561

    • -1
    • +1
    ./BinaryTypeModelRuleExtractorTest.groovy