import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
+
+import java.io.File;
+import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.URI;
+import java.util.Collection;
+
import javax.ws.rs.core.MediaType;
+
import org.junit.BeforeClass;
import org.junit.Test;
+import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
import org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
+import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.Sets;
/**
* sal-rest-connector
}
@BeforeClass
- public static void initialization() throws NoSuchFieldException, SecurityException {
- schemaContext = schemaContextLoader("/instanceidentifier/yang", schemaContext);
- schemaContext = schemaContextLoader("/modules", schemaContext);
- schemaContext = schemaContextLoader("/invoke-rpc", schemaContext);
+ public static void initialization() throws NoSuchFieldException, SecurityException, FileNotFoundException, SourceException, ReactorException {
+ Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
+ testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
+ testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
+ schemaContext = TestRestconfUtils.parseYangSources(testFiles);
controllerContext.setSchemas(schemaContext);
}