@@ -0,0 +1,2539 @@
+/*******************************************************************************%0A * PathVisio, a tool for data visualization and analysis using biological pathways%0A * Copyright 2006-2022 BiGCaT Bioinformatics, WikiPathways%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may not%0A * use this file except in compliance with the License.  You may obtain a copy%0A * of the License at%0A * %0A *   http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations under%0A * the License.%0A ******************************************************************************/%0Apackage org.pathvisio.libgpml.conversion;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.net.URL;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.pathvisio.libgpml.io.ConverterException;%0Aimport org.pathvisio.libgpml.model.GPML2013aWriter;%0Aimport org.pathvisio.libgpml.model.GPML2021Writer;%0Aimport org.pathvisio.libgpml.model.PathwayModel;%0A%0Aimport junit.framework.TestCase;%0A%0A/**%0A * Test for reading, writing, and conversion of a single GPML2013a file, for%0A * troubleshooting and resolving specific issues.%0A * %0A * @author finterly%0A */%0Apublic class TestConversionToGPML2021 extends TestCase %7B%0A%09private PathwayModel pathwayModel;%0A%09private String inputFile = %22example-v2013a.gpml%22;%0A%09private URL url = Thread.currentThread().getContextClassLoader().getResource(inputFile);%0A%0A%09/**%0A%09 * Reads a GPML2013a%0A%09 * %0A%09 * @throws ConverterException%0A%09 * @throws IOException%0A%09 */%0A%09@Before%0A%09public void setUp() throws IOException, ConverterException %7B%0A%09%09File file = new File(url.getPath());%0A%09%09assertTrue(file.exists());%0A%09%09pathwayModel = new PathwayModel();%0A%09%09pathwayModel.readFromXml(file, true);%0A%09%7D%0A%0A%09/**%0A%09 * Writes pathway mode to a GPML2013a and GPML2021 file.%0A%09 * %0A%09 * @throws ConverterException%0A%09 * @throws IOException%0A%09 */%0A%09@Test%0A%09public void testWrite() throws IOException, ConverterException %7B%0A%09%09File tmp = File.createTempFile(inputFile + %22_testwriteGPML2013a_%22, %22.gpml%22);%0A%09%09GPML2013aWriter.GPML2013aWRITER.writeToXml(pathwayModel, tmp, true);%0A%09%09System.out.println(tmp);%0A%09%09%0A%09%09File tmp2 = File.createTempFile(inputFile + %22_testwriteGPML2021_%22, %22.gpml%22);%0A%09%09GPML2021Writer.GPML2021WRITER.writeToXml(pathwayModel, tmp2, false);%0A%09%09System.out.println(tmp2);%0A%09%7D%0A%0A%0A%0A%7D%0A

Create TestConversionToGPML2021.java