DefaultCollectionBuilderTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce ModelMap extends CollectionBuilder and allow to use them interchangeably in rules

+review REVIEW-5491

    • -853
    • +0
    ./DefaultCollectionBuilderTest.groovy
  1. … 117 more files in changeset.
Add values() to CollectionBuilder and use it instead of iterator(). CollectionBuilder no longer implements Iterable.

+review REVIEW-5457

  1. … 12 more files in changeset.
Use CollectionBuilder<ComponentSpec> instead of ComponentSpecContainer in ComponentReport. Change CollectionBuilder to implement Iterable.

+review REVIEW-5457

    • -0
    • +11
    ./DefaultCollectionBuilderTest.groovy
  1. … 5 more files in changeset.
Make DirectInstantiator a singleton.

  1. … 89 more files in changeset.
Add withType(«type», «rules») to CollectionBuilder.

Allows having all elements of a certain type depend on a certain element.

    • -0
    • +159
    ./DefaultCollectionBuilderTest.groovy
  1. … 9 more files in changeset.
Always instiate collection builder items via an instantiator accessed as a model reference.

+review REVIEW-5382

    • -5
    • +24
    ./DefaultCollectionBuilderTest.groovy
  1. … 6 more files in changeset.
Push replaceOrCreate to model registry.

Realligned some other model registry methods.

+review REVIEW-5382

  1. … 14 more files in changeset.
Mutation rules are always executed in a reliable order

+review REVIEW-5384

  1. … 8 more files in changeset.
Define bridged collection items in terms of retrieval from the collection's model node, instead of the collection itself.

This is generally about reducing implicit state with our bridging, for the task container in particular.

Implicit state (i.e. state dragged in by function closure) is problematic when resetting ephemeral state.

References to epehemeral elements (e.g. the task container) closed over in item creators prevent the items being created fresh the next time around.

An important change here is that each bridged collection now has two implicit “invisible” nodes.

One for the backing store and one for the instantiator.

These are for item creators to depend on, in order to be defined in terms of the model node instead of the actual container.

+review REVIEW-5382

    • -25
    • +15
    ./DefaultCollectionBuilderTest.groovy
  1. … 18 more files in changeset.
Allow model nodes to be 'ephemeral'.

Ephemeral nodes are not “stable”.

Non stable nodes are reset when the registry is stabilized, allowing the registry to be reused.

This mechanism will be used to allow the model registry to be scrubbed of nodes that hold build instance state in between reusing the model state between builds.

+review

  1. … 17 more files in changeset.
Pull the error for trying to create model nodes as scopes other than root “up”.

+review REVIEW-5353

  1. … 26 more files in changeset.
Move some scoped rule related tests from collection builder test to their own test class

+review REVIEW-5353

    • -152
    • +7
    ./DefaultCollectionBuilderTest.groovy
  1. … 1 more file in changeset.
Change implemenation of @BinaryTasks to not mutate the task container and the binary in one rule.

  1. … 24 more files in changeset.
Re-enable a test.

+review REVIEW-5340

    • -21
    • +21
    ./DefaultCollectionBuilderTest.groovy
Rename validate() to bindAllReferences() and add some docs.

+review REVIEW-5368

  1. … 5 more files in changeset.
Add test case demonstrating current behaviour of combining and misaligning CollectionBuilder.withType(Class).named(String, Class<? extends RuleSource>).

+review REVIEW-5353

    • -0
    • +23
    ./DefaultCollectionBuilderTest.groovy
  1. … 2 more files in changeset.
Remove test case.

I don't think it's warranted. We can test rule ordering more generally elsewhere.

The review item that sparked this was badly worded.

+review REVIEW-5353

    • -26
    • +0
    ./DefaultCollectionBuilderTest.groovy
Push validation that a given RuleSource actually implements RuleSource down into general validation.

+review REVIEW-5353

  1. … 4 more files in changeset.
Move test for applying rule sources directly to model nodes out from collection builder specific tests into specific class.

+review REVIEW-5353

    • -55
    • +2
    ./DefaultCollectionBuilderTest.groovy
  1. … 2 more files in changeset.
Move nested interface out to top level because of insane issue with nested interfaces and IBM JDK.

+review REVIEW-5353

  1. … 1 more file in changeset.
More test coverage for applying rule sources in scope of collection elements.

+review REVIEW-5353

    • -1
    • +376
    ./DefaultCollectionBuilderTest.groovy
  1. … 6 more files in changeset.
Push the class to rule extractor into the registry, to allow nodes etc. to accept RuleSource classes.

While it bothers me slightly that we are pushing knowledge of a particular type of rule representation into the registry, it saves having to cart some extra stuff around.

+review REVIEW-5353

  1. … 38 more files in changeset.
Prepare for model registry based task placeholders, by preparing for giving DefaultTaskContainer access to its node in the model graph.

+review REVIEW-5340

  1. … 16 more files in changeset.
Collection mutation rule specifies input taking mutation rule for particular model element

+review REVIEW-5353

  1. … 68 more files in changeset.
Liberate some model registry test support from DefaultModelRegistryTest.

Includes some new/renamed API on ModelRegistry.

+review REVIEW-5350

    • -27
    • +27
    ./DefaultCollectionBuilderTest.groovy
  1. … 21 more files in changeset.
Revert selective task closing work.

Too much breakage.

+review REVIEW-5350

    • -27
    • +27
    ./DefaultCollectionBuilderTest.groovy
  1. … 67 more files in changeset.
Wire the model registry into the “task selector”, effectively enabling configure-on-demand for rule based task declarations.

Rather than eagerly “realize” the whole task container and its contents, we now only realize the container itself.

This means that we know of all the tasks that will exist without actually creating them.

If a task (declared by rules) is not needed for a build (i.e. not selected, not depended on) it will not be created.

However, our rule based plugins at this time contain coarse rules that don't allow this feature to be leveraged.

Benefits will only be seen right now for contrived domains.

    • -27
    • +27
    ./DefaultCollectionBuilderTest.groovy
  1. … 63 more files in changeset.
Added some query methods to `CollectionBuilder` to make it look somewhat like a `Map`. Also added support for read only `CollectionBuilder` view over bridged `PolymorphicDomainObjectContainer` instances.

    • -2
    • +90
    ./DefaultCollectionBuilderTest.groovy
  1. … 6 more files in changeset.
Removed the upper bounds on CollectionBuilder.beforeEach(), withType() and afterEach() - the type can be anything. Also added some javadocs and test coverage.

    • -14
    • +69
    ./DefaultCollectionBuilderTest.groovy
  1. … 3 more files in changeset.
Renamed ModelAction.mutate() to execute(), and ModelRegistrar.mutate() to apply()

  1. … 21 more files in changeset.