2 * Copyright (c) 2013 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.controller.netconf.util;
10 import static org.junit.Assert.assertThat;
11 import static org.junit.Assert.fail;
12 import static org.hamcrest.CoreMatchers.containsString;
14 import org.junit.Test;
15 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
16 import org.w3c.dom.Document;
18 public class NetconfUtilTest {
21 public void testConflictingVersionDetection() throws Exception {
22 Document document = XmlUtil.readXmlToDocument(getClass().getResourceAsStream("/netconfMessages/conflictingversion/conflictingVersionResponse.xml"));
24 NetconfUtil.checkIsMessageOk(document);
26 }catch(IllegalStateException e){
27 assertThat(e.getMessage(), containsString("Optimistic lock failed. Expected parent version 21, was 18"));