Commit 0d1b89a 1 parent f613499 commit 0d1b89a Copy full SHA for 0d1b89a
File tree 1 file changed +16
-0
lines changed
api/src/test/java/org/openmrs/module
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -155,4 +155,20 @@ public void shouldExcludePrevouslyStoppedModulesOnShutdown() {
155
155
assertTrue (moduleTestData .getStoppedCallCount (MODULE2_ID ) == 1 );
156
156
assertTrue (moduleTestData .getStoppedCallCount (MODULE3_ID ) == 1 );
157
157
}
158
+
159
+ @ Test
160
+ public void shouldCallWillStopAndStoppedOnUnloadModule () throws Exception {
161
+
162
+ ModuleFactory .unloadModule (ModuleFactory .getModuleById (MODULE3_ID ));
163
+
164
+ //should have called willStop() and stopped() for module3
165
+ assertTrue (moduleTestData .getWillStopCallCount (MODULE3_ID ) == 1 );
166
+ assertTrue (moduleTestData .getStoppedCallCount (MODULE3_ID ) == 1 );
167
+
168
+ //should not call willStop() and stopped() for module1 and module2
169
+ assertTrue (moduleTestData .getWillStopCallCount (MODULE1_ID ) == 0 );
170
+ assertTrue (moduleTestData .getWillStopCallCount (MODULE2_ID ) == 0 );
171
+ assertTrue (moduleTestData .getStoppedCallCount (MODULE1_ID ) == 0 );
172
+ assertTrue (moduleTestData .getStoppedCallCount (MODULE2_ID ) == 0 );
173
+ }
158
174
}
You can’t perform that action at this time.
0 commit comments