import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-
-import java.io.FileNotFoundException;
-import java.net.URISyntaxException;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.restconf.rest.api.schema.context.SchemaContextHandler;
+import org.opendaylight.restconf.common.handlers.api.SchemaContextHandler;
+import org.opendaylight.restconf.common.handlers.impl.SchemaContextHandlerImpl;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
/**
* Tests for handling {@link SchemaContext}
@Before
public void setup() throws Exception {
- schemaContextHandler = new SchemaContextHandlerImpl();
+ this.schemaContextHandler = new SchemaContextHandlerImpl();
- schemaContext = TestRestconfUtils.loadSchemaContext(PATH_FOR_ACTUAL_SCHEMA_CONTEXT);
- schemaContextHandler.onGlobalContextUpdated(schemaContext);
+ this.schemaContext = TestRestconfUtils.loadSchemaContext(PATH_FOR_ACTUAL_SCHEMA_CONTEXT);
+ this.schemaContextHandler.onGlobalContextUpdated(this.schemaContext);
}
/**
*/
@Test
public void schemaContextHandlerImplInitTest() {
- assertNotNull("Handler should be created and not null", schemaContextHandler);
+ assertNotNull("Handler should be created and not null", this.schemaContextHandler);
}
/**
@Test
public void getSchemaContextTest() {
assertEquals("SchemaContextHandler should has reference to actual SchemaContext",
- schemaContext, schemaContextHandler.getSchemaContext());
+ this.schemaContext, this.schemaContextHandler.getSchemaContext());
}
/**
@Test
public void onGlobalContextUpdateTest() throws Exception {
// create new SchemaContext and update SchemaContextHandler
- SchemaContext newSchemaContext = TestRestconfUtils.loadSchemaContext(PATH_FOR_NEW_SCHEMA_CONTEXT);
- schemaContextHandler.onGlobalContextUpdated(newSchemaContext);
+ final SchemaContext newSchemaContext = TestRestconfUtils.loadSchemaContext(PATH_FOR_NEW_SCHEMA_CONTEXT);
+ this.schemaContextHandler.onGlobalContextUpdated(newSchemaContext);
assertNotEquals("SchemaContextHandler should not has reference to old SchemaContext",
- schemaContext, schemaContextHandler.getSchemaContext());
+ this.schemaContext, this.schemaContextHandler.getSchemaContext());
assertEquals("SchemaContextHandler should has reference to new SchemaContext",
- newSchemaContext, schemaContextHandler.getSchemaContext());
+ newSchemaContext, this.schemaContextHandler.getSchemaContext());
}
}