Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Commit

Permalink
REPO-3962: Remove context refresh from testOpenCloseOpenCloseFull (#336)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
eknidev committed Feb 4, 2019
1 parent 4ce947a commit 28e4df5
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/test/java/org/alfresco/RepositoryStartStopTest.java
Expand Up @@ -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();

Expand All @@ -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,
Expand Down

0 comments on commit 28e4df5

Please sign in to comment.