2f5d68dd720c9e7ceaf40fcdf3cfeb8087a312b9
[ccsdk/apps.git] / sdnr / wireless-transport / code-Carbon-SR1 / apps / route / impl / src / test / java / org / opendaylight / route / TestJson.java
1 /*
2  * Copyright © 2015 ZTE and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.route;
9
10 import com.highstreet.technologies.odl.app.impl.delegates.PredefinePath;
11 import com.highstreet.technologies.odl.app.impl.tools.JsonUtil;
12 import org.junit.Test;
13
14 import java.io.File;
15
16 /**
17  * Created by odl on 17-6-5.
18  */
19 public class TestJson
20 {
21     @Test
22     public void test_to_object_given_json() throws Exception
23     {
24         String fileName = "/home/odl/workspace/CENTENNIAL/code/apps/route/impl/src/main/resources/topology.json";
25         PredefinePath path = JsonUtil.toObject(new File(fileName), PredefinePath.class);
26
27         System.out.println("");
28     }
29
30     @Test
31     public void test_to_obj_from_file()
32     {
33         PredefinePath path = JsonUtil.toObject(
34                 new File(System.getenv().get("ODL_KARAF_HOME") + File.separator + "data" + File.separator + "topology.json"), PredefinePath.class);
35         System.out.println(path);
36     }
37
38 }