Bug 4105: Add EntityOwnershipShard
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / utils / PruningDataTreeModificationTest.java
index b5e6caee9aa2353f399b26e8f5a64e071139d6a7..19460576684ee75c61a5cc1f08486e225216ec0d 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.controller.cluster.datastore.utils;
 
 import static org.junit.Assert.assertTrue;
@@ -18,6 +26,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModificationCursor;
+import org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaValidationFailedException;
 
 public class PruningDataTreeModificationTest {
 
@@ -53,7 +62,7 @@ public class PruningDataTreeModificationTest {
     @Test
     public void testDeleteOnException(){
         YangInstanceIdentifier path = CarsModel.BASE_PATH;
-        doThrow(IllegalArgumentException.class).when(delegate).delete(path);
+        doThrow(SchemaValidationFailedException.class).when(delegate).delete(path);
 
         pruningDataTreeModification.delete(path);
 
@@ -75,7 +84,7 @@ public class PruningDataTreeModificationTest {
         NormalizedNode<?, ?> normalizedNode = CarsModel.create();
         YangInstanceIdentifier path = CarsModel.BASE_PATH;
 
-        doThrow(IllegalArgumentException.class).when(delegate).merge(path, normalizedNode);
+        doThrow(SchemaValidationFailedException.class).when(delegate).merge(path, normalizedNode);
         doReturn(true).when(validNamespaces).contains(any(YangInstanceIdentifier.PathArgument.class));
 
         pruningDataTreeModification.merge(path, normalizedNode);
@@ -98,7 +107,7 @@ public class PruningDataTreeModificationTest {
         NormalizedNode<?, ?> normalizedNode = CarsModel.create();
         YangInstanceIdentifier path = CarsModel.BASE_PATH;
 
-        doThrow(IllegalArgumentException.class).when(delegate).write(path, normalizedNode);
+        doThrow(SchemaValidationFailedException.class).when(delegate).write(path, normalizedNode);
         doReturn(true).when(validNamespaces).contains(any(YangInstanceIdentifier.PathArgument.class));
 
         pruningDataTreeModification.write(path, normalizedNode);