Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-1584

[NXRuntimeTestCase] allow loading of resources with no duplication nor ambiguity

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.2, 5.2 M1
    • Component/s: Runtime

      Description

      The current deploy() method looks for xml contributions in the current classpath. First one hence wins. To be sure which resource is actually loaded it led everyone to override basic xml configuration that doesn't need to in their integration JUnit tests.

      Here are the use cases NXRuntimeTestCase should implement (summary of discussion with Bogdan S)

      • deploy a whole jar with its OSGI-INF configuration: typical for an integration test: we want e.g, the schema service to be available in the same way it is in the application. Maybe follow dependencies, here, or at least loudly stop in case some are missing
      • control which jars are actually deployed: we might have a dependency to core packages to get an interface/class and still not want to construct a full Nuxeo Core instance
      • override the configuration that sits in the jar (we could use test/resources as an equivalent to /config in nuxeo.ear, but this has to stay manual). Typical use-case: fake ram repository,
      • true unit tests can go on using
      • I don't think we need to load test resources from a jar in dependencies: we've always used separated *-test packages for generic helpers; they can provide resources for their test clients in src/main/resources

      A good deal of the problems with non nxruntime resources (schemas etc) can be solved, I guess, by the fact that they would be now deployed where they are defined, as normal (non test) resources, if one deploys the whole jar that usually defines them.

        Attachments

          Activity

            People

            • Assignee:
              gracinet Georges Racinet
              Reporter:
              gracinet Georges Racinet
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: