2 * Copyright (c) 2016 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.api;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13 import static org.junit.Assert.fail;
15 import org.junit.Test;
17 public class ModifyActionTest {
20 public void testModifyAction() {
21 final ModifyAction modifyAction = ModifyAction.fromXmlValue("create");
22 assertEquals(ModifyAction.CREATE, modifyAction);
23 assertEquals(ModifyAction.DELETE, ModifyAction.fromXmlValue("delete"));
24 assertEquals(ModifyAction.MERGE, ModifyAction.fromXmlValue("merge"));
25 assertEquals(ModifyAction.NONE, ModifyAction.fromXmlValue("none"));
26 assertEquals(ModifyAction.REMOVE, ModifyAction.fromXmlValue("remove"));
27 assertEquals(ModifyAction.REPLACE, ModifyAction.fromXmlValue("replace"));
28 assertFalse(modifyAction.isAsDefaultPermitted());
29 assertTrue(modifyAction.isOnElementPermitted());
32 ModifyAction.fromXmlValue("exception call");
34 } catch (IllegalArgumentException e) {