+ @Test(expected = NullPointerException.class)
+ public void findDataSchemaNodeFromXPathIllegalArgumentTest() {
+ SchemaContextUtil.findDataSchemaNode(mock(SchemaContext.class), mock(Module.class), null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void findDataSchemaNodeFromXPathIllegalArgumentTest2() {
+ final SchemaContext mockContext = mock(SchemaContext.class);
+ final PathExpression xpath = new PathExpressionImpl("my:my-grouping/my:my-leaf-in-gouping2", true);
+
+ SchemaContextUtil.findDataSchemaNode(mockContext, null, xpath);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void findDataSchemaNodeFromXPathIllegalArgumentTest3() {
+ final Module module = mock(Module.class);
+ final PathExpression xpath = new PathExpressionImpl("my:my-grouping/my:my-leaf-in-gouping2", true);
+
+ SchemaContextUtil.findDataSchemaNode(null, module, xpath);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void findDataSchemaNodeFromXPathIllegalArgumentTest4() {
+ final SchemaContext mockContext = mock(SchemaContext.class);
+ final Module module = mock(Module.class);
+ final PathExpression xpath = new PathExpressionImpl("my:my-grouping[@con='NULL']/my:my-leaf-in-gouping2", true);
+
+ SchemaContextUtil.findDataSchemaNode(mockContext, module, xpath);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void findParentModuleIllegalArgumentTest() {
+ SchemaContextUtil.findParentModule(mock(SchemaContext.class), null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void findParentModuleIllegalArgumentTest2() {
+ doReturn(SchemaPath.create(true, QName.create("foo", "bar"))).when(schemaNode).getPath();
+ SchemaContextUtil.findParentModule(null, schemaNode);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void findDataSchemaNodeIllegalArgumentTest() {
+ SchemaContextUtil.findDataSchemaNode(mock(SchemaContext.class), null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void findDataSchemaNodeIllegalArgumentTest2() {
+ SchemaContextUtil.findDataSchemaNode(null, SchemaPath.create(true,
+ QName.create(URI.create("uri:my-module"), Revision.of("2014-10-07"), "foo")));
+ }
+
+ @Test
+ public void findDataSchemaNodeFromXPathNullTest2() {
+ final SchemaContext mockContext = mock(SchemaContext.class);
+ final Module module = mock(Module.class);
+ final PathExpression xpath = new PathExpressionImpl("my:my-grouping/my:my-leaf-in-gouping2", false);
+
+ assertNull(SchemaContextUtil.findDataSchemaNode(mockContext, module, xpath));
+ }
+