import com.narirelays.ems.model.DimensionTreeNode;
public class CacheProviderTester {
public static void main(String[] argv) throws InterruptedException{
DimensionTree tree = new DimensionTree();
tree.setDimensionName("department");
tree.setShortDescription("shortDesc");
tree.setLongDescription("longDesc");
tree.setRoot(new DimensionTreeNode());
tree.getRoot().setText("root");
tree.getRoot().setId("rootid");
DimensionTreeNode sub = new DimensionTreeNode();
sub.setText("sub");
sub.setId("subid");
tree.getRoot().getChildren().add(sub);
CacheProvider.setObject("mytree", 0, tree);
// Thread.sleep(1000);
Object obj = CacheProvider.getObject("mytree");
if(obj instanceof DimensionTree){
DimensionTree cacheTree = (DimensionTree)obj;
System.out.println(JSONObject.fromObject(cacheTree).toString());
}
List<DimensionTree> treeList = new ArrayList<DimensionTree>();
treeList.add(tree);