View Javadoc

1   package org.starobjects.tested.fitnesse.internal.helpers;
2   
3   import org.nakedobjects.runtime.context.NakedObjectsContext;
4   import org.nakedobjects.runtime.system.NakedObjectsSystem;
5   import org.starobjects.tested.fitnesse.StoryFixture;
6   
7   public class ShutdownNakedObjects {
8   
9       private final StoryFixture storyFixture;
10  
11      public ShutdownNakedObjects(final StoryFixture storyFixture) {
12          this.storyFixture = storyFixture;
13      }
14  
15      public void shutdown() {
16          final NakedObjectsSystem system = storyFixture.getSystem();
17  
18          NakedObjectsContext.closeAllSessions();
19  
20          if (system != null) {
21              system.shutdown();
22          }
23  
24      }
25  
26  }