2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
10 import org.junit.Before;
11 import org.junit.Test;
12 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
17 public class DataTreeTransactionTest extends AbstractTestModelTest {
18 private DataTree tree;
22 tree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL, SCHEMA_CONTEXT);
26 public void testSealedValidate() throws DataValidationFailedException {
27 final DataTreeModification mod = tree.takeSnapshot().newModification();
33 public void testSealedPrepare() {
34 final DataTreeModification mod = tree.takeSnapshot().newModification();
39 @Test(expected = IllegalArgumentException.class)
40 public void testUnsealedValidate() throws DataValidationFailedException {
41 final DataTreeModification mod = tree.takeSnapshot().newModification();
45 @Test(expected = IllegalArgumentException.class)
46 public void testUnsealedPrepare() {
47 final DataTreeModification mod = tree.takeSnapshot().newModification();