+/*
+ * 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;
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 {
@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);
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);
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);