Repository: tomee Updated Branches: refs/heads/master 7993bfd75 -> 45cb0ee73
for app rule we need to propagate the workaround for lazy test instance usage Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/45cb0ee7 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/45cb0ee7 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/45cb0ee7 Branch: refs/heads/master Commit: 45cb0ee730914e59d063f96f533f6cceb384f2b0 Parents: 7993bfd Author: Romain Manni-Bucau <[email protected]> Authored: Fri Nov 20 12:37:55 2015 -0800 Committer: Romain Manni-Bucau <[email protected]> Committed: Fri Nov 20 12:38:03 2015 -0800 ---------------------------------------------------------------------- .../java/org/apache/openejb/testing/ApplicationComposers.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/45cb0ee7/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java b/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java index ef07bf9..1a85edd 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java @@ -732,7 +732,12 @@ public class ApplicationComposers { System.getProperties().put(OPENEJB_APPLICATION_COMPOSER_CONTEXT, appContext.getGlobalJndiContext()); // test injections - final ClassFinder testClassFinder = testClassFinders.remove(inputTestInstance); + ClassFinder testClassFinder = testClassFinders.remove(inputTestInstance); + if (testClassFinder == null) { + testClassFinders.put(inputTestInstance, testClassFinders.remove(this)); + testClassFinder = testClassFinders.remove(inputTestInstance); + } + final List<Field> fields = new ArrayList<>(testClassFinder.findAnnotatedFields(AppResource.class)); fields.addAll(testClassFinder.findAnnotatedFields(org.apache.openejb.junit.AppResource.class)); for (final Field field : fields) {
