From 28e4df5a1a42f862054327f05346ee44a295fdff Mon Sep 17 00:00:00 2001 From: eknizat <26163420+eknizat@users.noreply.github.com> Date: Mon, 4 Feb 2019 10:02:26 +0000 Subject: [PATCH] REPO-3962: Remove context refresh from testOpenCloseOpenCloseFull (#336) * REPO-3962: Remove context refresh from testOpenCloseOpenCloseFull * The refreshing of minimal context does not work with Spring version greater than 5.1.0 * We don't need to test refreshing the core application context as that never happens, only the subsystem application contexts are refreshed * REPO-3962: Add test for application context refresh * Test is disabled for now until the bug in Spring is fixed --- .../org/alfresco/RepositoryStartStopTest.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/alfresco/RepositoryStartStopTest.java b/src/test/java/org/alfresco/RepositoryStartStopTest.java index fa6efa469f..641573ab76 100644 --- a/src/test/java/org/alfresco/RepositoryStartStopTest.java +++ b/src/test/java/org/alfresco/RepositoryStartStopTest.java @@ -164,8 +164,7 @@ public void testOpenCloseOpenCloseNoAutostart() throws Exception * a context twice without error, using it * when running. */ - // test ignored from 24 Oct 2018 - public void ignoredTestOpenCloseOpenCloseFull() throws Exception + public void testOpenCloseOpenCloseFull() throws Exception { assertNoCachedApplicationContext(); @@ -187,13 +186,35 @@ public void ignoredTestOpenCloseOpenCloseFull() throws Exception ctx = getFullContext(); assertEquals(ctx, ctx2); - // Refresh it, shouldn't break anything - ((AbstractApplicationContext)ctx).refresh(); - // And finally close it ApplicationContextHelper.closeApplicationContext(); assertNoCachedApplicationContext(); } + + /** + * + * Enable test after this issue is resolved: https://issues.alfresco.com/jira/browse/REPO-4176 + * @throws Exception + */ + public void ignoreTestFullContextRefresh() throws Exception + { + + assertNoCachedApplicationContext(); + + // Open it, and use it + ApplicationContext ctx = getFullContext(); + assertNotNull(ctx); + doTestBasicWriteOperations(ctx); + + // Refresh it, shouldn't break anything + ((AbstractApplicationContext)ctx).refresh(); + assertNotNull(ctx); + doTestBasicWriteOperations(ctx); + + // And finally close it + ApplicationContextHelper.closeApplicationContext(); + assertNoCachedApplicationContext(); + } /** * Tests that we can open a context, use it,