Rework PCEPDeserializerException and move it into SPI
[bgpcep.git] / pcep / spi / src / test / java / org / opendaylight / protocol / pcep / spi / APITest.java
diff --git a/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/APITest.java b/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/APITest.java
new file mode 100644 (file)
index 0000000..9b45cf5
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.protocol.pcep.spi;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class APITest {
+
+       @Test
+       public void testDeserializerException() {
+               final PCEPDeserializerException e = new PCEPDeserializerException("Some error message.");
+               assertEquals("Some error message.", e.getMessage());
+
+               final PCEPDeserializerException e1 = new PCEPDeserializerException("Some error message.", new IllegalArgumentException());
+               assertEquals("Some error message.", e1.getMessage());
+               assertTrue(e1.getCause() instanceof IllegalArgumentException);
+       }
+}