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
10 package org.opendaylight.yangtools.yang.data.api;
12 import static org.junit.Assert.assertEquals;
13 import static org.junit.Assert.assertFalse;
14 import static org.junit.Assert.assertTrue;
15 import static org.junit.Assert.fail;
17 import org.junit.Test;
19 public class ModifyActionTest {
22 public void testModifyAction() {
23 final ModifyAction modifyAction = ModifyAction.fromXmlValue("create");
24 assertEquals(ModifyAction.CREATE, modifyAction);
25 assertEquals(ModifyAction.DELETE, ModifyAction.fromXmlValue("delete"));
26 assertEquals(ModifyAction.MERGE, ModifyAction.fromXmlValue("merge"));
27 assertEquals(ModifyAction.NONE, ModifyAction.fromXmlValue("none"));
28 assertEquals(ModifyAction.REMOVE, ModifyAction.fromXmlValue("remove"));
29 assertEquals(ModifyAction.REPLACE, ModifyAction.fromXmlValue("replace"));
30 assertFalse(modifyAction.isAsDefaultPermitted());
31 assertTrue(modifyAction.isOnElementPermitted());
34 ModifyAction.fromXmlValue("exception call");
36 } catch (IllegalArgumentException e) {