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.common;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertTrue;
13 import org.junit.Test;
15 public class OperationFailedExceptionTest {
18 public void testOperationFailedException() {
19 final Throwable cause = new Throwable( "mock cause" );
20 final RpcError rpcErrorShort = RpcResultBuilder.newError(RpcError.ErrorType.RPC, "tag", "msg");
21 final OperationFailedException operationFailedException1 = new OperationFailedException("error msg", cause,
23 final OperationFailedException operationFailedException2 = new OperationFailedException("error msg", rpcErrorShort);
24 assertEquals(operationFailedException1.getErrorList(), operationFailedException2.getErrorList());
25 assertTrue(operationFailedException1.toString().contains("error msg"));