ManagedNodeBackedModelMapTest.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
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 24 more files in changeset.
Moved checking for custom constructors and fields in managed types to bindings discovery

+review REVIEW-5761

    • -3
    • +3
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 13 more files in changeset.
Remove ConstructibleTypesRegistry

These types have been unused in production since commit

bbd7579916c603e268cb41d568b548cc1cec2c59.

    • -33
    • +0
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 3 more files in changeset.
Collect problems with constructors of `@Managed` type, rather than failing on first problem.

Also fixed traversal of type hierarchy of a `@Managed` type so that super-types are visited once rather than potentially many times.

+review REVIEW-5756

    • -1
    • +1
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 3 more files in changeset.
Started to collect the problems discovered during model element type inspection, rather than failing on the first problem found.

Only a couple of problems are handled this way currently.

Also use consistent formatting for model type problems and rule source problems.

+review REVIEW-5756

    • -1
    • +2
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 8 more files in changeset.
Change "constructable" to "constructible" in code

    • -11
    • +11
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 13 more files in changeset.
List only constructible types that match ModelMap filtering in error message

Make sure only the types that match the type of the ModelMap are listed.

+review REVIEW-5752

    • -2
    • +16
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 7 more files in changeset.
Simplify by using static method

+review REVIEW-5752

    • -1
    • +2
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 8 more files in changeset.
NodeBackedModelMap.create() to respect chained filtering

Previously NodeBackedModelMap’s create() methods didn’t take filtering

into account, and allowed creating any type that the underlying factory

was able to construct. Now that is fixed. Further update is coming to

make the resulting error message nicer.

+review REVIEW-5738

    • -6
    • +8
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 4 more files in changeset.
Make NodeBasedModelMap respect chained filtering

NodeBackedModelMap now respects chained filtering. That is:

modelMap.withType(Serializable).withType(Thing)

will return only elements that implement both Serializable and Thing.

All the rule-assigning methods (all(), beforeEach(), afterEach() and

withType()) are also aware of chained filtering.

+review REVIEW-5738

    • -96
    • +1
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 3 more files in changeset.
Extract shared code from NodeBackedModelMapTests

+review REVIEW-5738

    • -850
    • +13
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 2 more files in changeset.
Clarify purpose of method

+review REVIEW-5738

    • -9
    • +9
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 4 more files in changeset.
Simplify the use of ModelRegistryHelperExtension

+review REVIEW-5738

    • -3
    • +3
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 9 more files in changeset.
Allow nesting rule descriptors in an easier way

Instead of NestedModelRuleDescriptor.append(…), use descriptor.append().

+review REVIEW-5738

    • -0
    • +1
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 10 more files in changeset.
Make sure node registrations and actions always have descriptors

Let’s fail early if no descriptor is specified.

    • -6
    • +13
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 5 more files in changeset.
Require that rule methods in a `RuleSource` must not be private, and that all methods that are not rule methods must be private.

    • -1
    • +1
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 5 more files in changeset.
No need to track implicit dependencies

We weren’t really using this feature, either, just passing empty lists

(or even nulls) around, and never using them.

    • -6
    • +6
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 16 more files in changeset.
Introduce convenience methods on ModelRegistry

+review REVIEW-5685

    • -2
    • +3
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 24 more files in changeset.
Revert "Fix tests on Java 1.9"

This reverts commit 71ab259efc81a5c1f41ab2d1b2a69321e4b7a271.

    • -14
    • +0
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 6 more files in changeset.
Fix tests on Java 1.9

Previously, because of http://jira.codehaus.org/browse/GROOVY-7010, we

had to move some test interfaces out to separate top-level classes.

These top-level types then got shared between tests, and led to

classloader issues where we were generating classes based on these

types.

The original problem is not solved, but we use getDeclaredClasses()

less often, and it allows these tests to work with nested interfaces.

So some of these types (the ones that were making the tests fail on

Java 1.9) were moved back to their parent tests.

+review REVIEW-5689

    • -0
    • +14
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 6 more files in changeset.
Enabled nested DSL rules for the API methods of `ModelMap`.

For example, `all { ... }` or `beforeEach(Type) { ... }`. This means that the closures passed to these methods will be treated as nested rules, with their own inputs, descriptor and so on.

    • -8
    • +105
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 2 more files in changeset.
Fix test

+review REVIEW-5689

    • -1
    • +1
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 5 more files in changeset.
Turn NodeInitializer into a set of actions to be applied in given roles

A NodeInitializer can now apply any number of actions to a node when

it’s registered, in any of the available action roles.

This allowed turning some constructor-injected services into real

inputs of these actions.

+review REVIEW-5689

    • -7
    • +2
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 24 more files in changeset.
Enable nested DSL rules for subjects of type `ModelMap`.

This is the first step of enabling the DSL for creating and configuring items in a `ModelMap`. It is currently only supported for `name(Type) { ... }` and `name { ... }` syntax.

With this change, the closures in the syntax above are treated as rule actions, so that their input references are not treated as inputs for the outer closure but are instead treated as inputs of the nested rule. These actions are also given their own descriptor.

    • -8
    • +52
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 3 more files in changeset.
Tests refinements on ModelMap non-constructible types

Issue: langos#15 +review REVIEW-5670

    • -5
    • +4
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 1 more file in changeset.
Rename ModelRegistry.create() to register() +review REVIEW-5678

    • -14
    • +14
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 67 more files in changeset.
Assert report of avail. types in ModelMap on not constructible type

Add tests that assert available constructible types are reported when

attempting to create an element of a ModelMap for a given

non-constructible type.

This commit change test code only.

    • -0
    • +13
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 4 more files in changeset.
Add temporary ModelMap.put()

+review REVIEW-5664

    • -0
    • +10
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 4 more files in changeset.
Introduce TestNodeInitializerRegistry

Simpler singleton access to a registry in tests.

+review REVIEW-5651

    • -4
    • +3
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 6 more files in changeset.
Passes context when asking for a node initializer - Reomves the method taking a schema from NodeInitializerRegistry

+review REVIEW-5652

    • -1
    • +1
    ./ManagedNodeBackedModelMapTest.groovy
  1. … 14 more files in changeset.