KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > NullRootTestApp


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest;
5
6 import com.tc.object.config.ConfigVisitor;
7 import com.tc.object.config.DSOClientConfigHelper;
8 import com.tc.object.config.TransparencyClassSpec;
9 import com.tc.simulator.app.ApplicationConfig;
10 import com.tc.simulator.listener.ListenerProvider;
11 import com.tctest.runner.AbstractTransparentApp;
12
13 import java.util.HashMap JavaDoc;
14 import java.util.Map JavaDoc;
15
16 public class NullRootTestApp extends AbstractTransparentApp {
17
18   private Map JavaDoc root = null;
19   private static Map JavaDoc staticRoot = null;
20
21   public NullRootTestApp(String JavaDoc appId, ApplicationConfig cfg, ListenerProvider listenerProvider) {
22     super(appId, cfg, listenerProvider);
23   }
24
25   public void run() {
26     if (root == null) {
27       root = new HashMap JavaDoc();
28     } else {
29       root = null;
30     }
31
32     if (staticRoot == null) {
33       staticRoot = new HashMap JavaDoc();
34     } else {
35       staticRoot = null;
36     }
37
38   }
39
40   public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper config) {
41     String JavaDoc testClass = NullRootTestApp.class.getName();
42     TransparencyClassSpec spec = config.getOrCreateSpec(testClass);
43     spec.addRoot("root", "root");
44     spec.addRoot("staticRoot", "staticRoot");
45   }
46
47 }
48
Popular Tags