Package com.dianping.cat.report.page.network

Source Code of com.dianping.cat.report.page.network.NetTopoModelTest

package com.dianping.cat.report.page.network;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import com.dianping.cat.home.nettopo.entity.NetGraph;
import com.dianping.cat.home.nettopo.entity.NetGraphSet;
import com.dianping.cat.home.nettopo.transform.DefaultXmlBuilder;
import com.dianping.cat.home.nettopo.transform.DefaultSaxParser;

@RunWith(JUnit4.class)
public class NetTopoModelTest {

  @Test
  public void test() throws Exception {
    NetGraphSet netGraphSet = new NetGraphSet();
    NetGraph netGraph = new NetGraph();
    netGraphSet.getNetGraphs().put(0, netGraph);
    netGraph = new NetGraph();
    netGraph.setMinute(1);
    netGraphSet.getNetGraphs().put(1, netGraph);
    System.out.println("0:"+netGraphSet.getNetGraphs().get(0));
    System.out.println("1:"+netGraphSet.getNetGraphs().get(1));
    DefaultXmlBuilder defaultXmlBuilder = new DefaultXmlBuilder();
    System.out.println(netGraphSet);
    String content = defaultXmlBuilder.buildXml(netGraphSet);
    System.out.println(content);
    NetGraphSet nGS = DefaultSaxParser.parse(content);
    System.out.println(nGS);
  }

}
TOP

Related Classes of com.dianping.cat.report.page.network.NetTopoModelTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.