|
| 1 | +/* Copyright 2025 Egon Willighagen <egonw@users.sf.net> |
| 2 | + * |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | + * use this file except in compliance with the License. You may obtain a copy |
| 5 | + * of the License at |
| 6 | + * |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | + * License for the specific language governing permissions and limitations under |
| 13 | + * the License. |
| 14 | + */ |
| 15 | +package org.pathvisio.libgpml.io; |
| 16 | + |
| 17 | +import org.junit.Assert; |
| 18 | +import org.junit.Test; |
| 19 | + |
| 20 | +import junit.framework.TestCase; |
| 21 | + |
| 22 | +/** |
| 23 | + * Test for reading and writing of a single GPML2021 file, for |
| 24 | + * troubleshooting and resolving specific issues. |
| 25 | + */ |
| 26 | +public class ConverterExceptionTest extends TestCase { |
| 27 | + |
| 28 | + @Test |
| 29 | + public void testConstructor() { |
| 30 | + Exception exception = new ConverterException("Something bad happened"); |
| 31 | + Assert.assertNotNull(exception); |
| 32 | + Assert.assertSame("Something bad happened", exception.getMessage()); |
| 33 | + } |
| 34 | + |
| 35 | + @Test |
| 36 | + public void testConstructor_Exception() { |
| 37 | + Exception exception = new ConverterException(new Exception("Something bad happened")); |
| 38 | + Assert.assertNotNull(exception); |
| 39 | + Assert.assertNotNull(exception.getMessage()); |
| 40 | + Assert.assertTrue(exception.getMessage().contains("Something bad happened")); |
| 41 | + } |
| 42 | + |
| 43 | +} |
0 commit comments