Enable test for taxon nodes deletion
authorCherian Mathew <c.mathew@bgbm.org>
Mon, 7 Sep 2015 10:26:16 +0000 (12:26 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Mon, 7 Sep 2015 10:26:16 +0000 (12:26 +0200)
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceExportTest.java

index db768a81997d2762d76b28075e7131ad1913e8de..b9d3cf61628df6a5a2d13a1f012e24bd83c34d32 100644 (file)
@@ -18,7 +18,6 @@ import java.util.UUID;
 import org.apache.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.junit.Assert;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.unitils.dbunit.annotation.DataSet;
 
@@ -170,7 +169,6 @@ public class TaxonNavigatorTest extends BaseOperationTest {
         }
     }
 
-    @Ignore // waiting for #5019 to be fixed
     @Test
     public void testDeleteTaxonNodes() throws ExecutionException {
         UUID taxonNode1Uuid = UUID.fromString("99f03b56-67cd-4e01-9ceb-2362d48f9d07");
index 90873c4bb14bbd6537c2c58b78839bba08c10ceb..bf48ebddc9ccfd428cc092238cf85626f2069ad1 100644 (file)
@@ -9,7 +9,6 @@
 */
 package eu.etaxonomy.taxeditor.service;
 
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.HashSet;
@@ -42,7 +41,7 @@ public class IOServiceExportTest extends BaseRemotingTest {
     private final INameService nameService = CdmApplicationState.getCurrentAppConfig().getNameService();
 
     @Test
-    public void exportJaxbTest() {
+    public void exportJaxbTest() throws IOException {
         JaxbExportConfigurator config = JaxbExportConfigurator.NewInstance(null, null);
         ExportResult result = ioService.export(config);
         List<byte[]> dataList = result.getExportData();
@@ -50,27 +49,14 @@ public class IOServiceExportTest extends BaseRemotingTest {
         byte[] exportData = dataList.get(0);
         String savePath = "target/exportjaxb.xml";
         FileOutputStream stream = null;
-        try {
-            stream = new FileOutputStream(savePath);
-            stream.write(exportData);
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if(stream != null) {
-                    stream.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
 
+        stream = new FileOutputStream(savePath);
+        stream.write(exportData);
+        stream.close();
     }
 
     @Test
-    public void exportSDDTest() {
+    public void exportSDDTest() throws IOException {
         SDDExportConfigurator config = SDDExportConfigurator.NewInstance(null, null, null);
         ExportResult result = ioService.export(config);
         List<byte[]> dataList = result.getExportData();
@@ -78,26 +64,15 @@ public class IOServiceExportTest extends BaseRemotingTest {
         byte[] exportData = dataList.get(0);
         String savePath = "target/exportsdd.xml";
         FileOutputStream stream = null;
-        try {
-            stream = new FileOutputStream(savePath);
-            stream.write(exportData);
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if(stream != null) {
-                    stream.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
+
+        stream = new FileOutputStream(savePath);
+        stream.write(exportData);
+        stream.close();
+
     }
 
     @Test
-    public void exportCSVTest() {
+    public void exportCSVTest() throws IOException {
         HashSet<UUID> set = new HashSet<UUID>();
         set.add(UUID.fromString("0c2b5d25-7b15-4401-8b51-dd4be0ee5cab"));
         CsvDemoExportConfigurator config = CsvDemoExportConfigurator.NewInstance(null, null);
@@ -119,7 +94,7 @@ public class IOServiceExportTest extends BaseRemotingTest {
     }
 
     @Test
-    public void exportCSVNameTest() {
+    public void exportCSVNameTest() throws IOException {
         CsvNameExportConfigurator config = CsvNameExportConfigurator.NewInstance(null,null);
         ExportResult result = ioService.export(config);
         List<byte[]> dataList = result.getExportData();
@@ -130,7 +105,7 @@ public class IOServiceExportTest extends BaseRemotingTest {
     }
 
     @Test
-    public void exportCSVPrintTest() {
+    public void exportCSVPrintTest() throws IOException {
         CsvNameExportConfigurator config = CsvNameExportConfigurator.NewInstance(null,null);
         config.setNamesOnly(false);
         config.setClassificationUUID(UUID.fromString("0c2b5d25-7b15-4401-8b51-dd4be0ee5cab"));
@@ -142,23 +117,10 @@ public class IOServiceExportTest extends BaseRemotingTest {
         saveToFile(savePath, exportData);
     }
 
-    private static void saveToFile(String filePath, byte[] data) {
+    private static void saveToFile(String filePath, byte[] data) throws IOException {
         FileOutputStream stream = null;
-        try {
-            stream = new FileOutputStream(filePath);
-            stream.write(data);
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if(stream != null) {
-                    stream.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
+        stream = new FileOutputStream(filePath);
+        stream.write(data);
+        stream.close();
     }
 }