Code ReOrganization and Re-Architecture changes
[ovsdb.git] / library / src / test / java / org / opendaylight / ovsdb / lib / schema / OvsDBSchemaTest.java
1 /*
2  * Copyright (C) 2014 EBay Software Foundation
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  * Authors : Ashwin Raveendran
9  */
10 package org.opendaylight.ovsdb.lib.schema;
11
12 import com.fasterxml.jackson.databind.JsonNode;
13 import com.fasterxml.jackson.databind.ObjectMapper;
14 import org.junit.Test;
15 import static org.junit.Assert.assertNotNull;
16 import java.io.IOException;
17 import java.io.InputStream;
18
19
20 public class OvsDBSchemaTest {
21
22     @Test
23     public void testSchema() throws IOException {
24         InputStream resourceAsStream = OvsDBSchemaTest.class.getResourceAsStream("test_schema.json");
25         ObjectMapper mapper = new ObjectMapper();
26         JsonNode jsonNode = mapper.readTree(resourceAsStream);
27         System.out.println("jsonNode = " + jsonNode.get("id"));
28
29         DatabaseSchema schema = DatabaseSchema.fromJson(jsonNode.get("result"));
30         assertNotNull(schema);
31
32     }
33 }