Ignore cdmlib war file
authorCherian Mathew <c.mathew@bgbm.org>
Mon, 16 Nov 2015 14:10:39 +0000 (15:10 +0100)
committerCherian Mathew <c.mathew@bgbm.org>
Mon, 16 Nov 2015 14:12:00 +0000 (15:12 +0100)
.gitignore
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmPersistentRemoteSourceTest.java [deleted file]

index 8912e41..40d481b 100644 (file)
@@ -40,6 +40,7 @@ eu.etaxonomy.taxeditor.test/screenshots/*.jpeg
 eu.etaxonomy.taxeditor.test/src/test/resources/.cdm-server-ehcache
 eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/remote-webapp
 eu.etaxonomy.taxeditor.test/target
+eu.etaxonomy.taxeditor.webapp/lib/cdmlib-remote-webapp.war
 eu.etaxonomy.taxeditor/.settings
 eu.etaxonomy.taxeditor/target
 /runtime-taxeditor.product
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmPersistentRemoteSourceTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmPersistentRemoteSourceTest.java
deleted file mode 100644 (file)
index 97ec1d2..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/**
- * Copyright (C) 2014 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-package eu.etaxonomy.taxeditor.httpinvoker;
-
-
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import eu.etaxonomy.cdm.config.CdmPersistentSourceUtils;
-import eu.etaxonomy.cdm.config.CdmSourceException;
-import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource;
-import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
-import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
-import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
-
-/**
- * Class to test the cdm persistent source functionality, including
- * initialising / saving / updating and deleting
- *
- * Corresponding test sources settings can be found at
- * /src/text/resources/eu.etaxonomy.cdm/cdm.datasources.xml
- *
- */
-public class CdmPersistentRemoteSourceTest extends BaseRemotingTest {
-    private static final Logger logger = Logger.getLogger(CdmPersistentRemoteSourceTest.class);
-
-    private CdmPersistentRemoteSource remotePersistentSource;
-
-    @BeforeClass
-    public static void initialize() {
-    }
-
-    @Test
-    public void whenLoadingExistingCompleteRemoteSourceThenLoadIsSuccessful() {
-
-        remotePersistentSource = getCdmPersistentRemoteSource();
-
-        String expectedServer = "127.0.0.1";
-        String expectedPort = "9090";
-        String expectedContextPath = "";
-        logger.info("Default remote source server : " + remotePersistentSource.getServer());
-        Assert.assertTrue("Default server should be " + expectedServer,
-                expectedServer.equals(remotePersistentSource.getServer()));
-
-        logger.info("Default remote source port : " + remotePersistentSource.getPort());
-        Assert.assertTrue("Default port should be 9090",
-                expectedPort.equals(String.valueOf(remotePersistentSource.getPort())));
-
-        logger.info("Default remote source context path : " + remotePersistentSource.getContextPath());
-        Assert.assertTrue("Default remote source context path should be " + expectedContextPath,
-                expectedContextPath.equals(remotePersistentSource.getContextPath()));
-
-        logger.info("Default remote source nomenclatural code : " + remotePersistentSource.getNomenclaturalCode().toString());
-        Assert.assertTrue("Default NomenclaturalCode should be ICNAFP",
-                NomenclaturalCode.ICNAFP.equals(remotePersistentSource.getNomenclaturalCode()));
-    }
-
-
-
-
-    @Test
-    public void whenConnectingToAnActiveServerThenConnectSuccessfully() {
-        // check if active server throws the right exception
-
-        remotePersistentSource = getCdmPersistentRemoteSource();
-
-        String dbSchemaVersion = "";
-        try {
-            dbSchemaVersion = remotePersistentSource.getDbSchemaVersion();
-        } catch (CdmSourceException e) {
-            Assert.fail("getDbSchemaVersion() on active cdm server should not have thrown CdmSourceException");
-        }
-        logger.info("dbSchemaVersion is " + dbSchemaVersion);
-
-
-        boolean isDbEmpty = false;
-        try {
-            isDbEmpty = remotePersistentSource.isDbEmpty();
-        } catch (CdmSourceException e) {
-            Assert.fail("isDbEmpty() on active cdm server should not have thrown CdmSourceException");
-        }
-        Assert.assertFalse(isDbEmpty);
-
-
-        boolean check = false;
-        try {
-            check = remotePersistentSource.checkConnection();
-        } catch (CdmSourceException e) {
-            Assert.fail("checkConnection() on active cdm server should not have thrown CdmSourceException");
-        }
-        Assert.assertTrue(check);
-
-
-    }
-
-    @Test
-    public void whenRequestingMetadatFromRemoteSourceThenMetaDataIsRetrieved() {
-        try {
-            remotePersistentSource = getCdmPersistentRemoteSource();
-            Map<MetaDataPropertyName, String> cdmMetaDataMap = remotePersistentSource.getMetaDataMap();
-            for(MetaDataPropertyName mdpn : cdmMetaDataMap.keySet()) {
-                String value = cdmMetaDataMap.get(mdpn);
-                logger.info("MetaData Property " + mdpn.name() + " has value " + value);
-                Assert.assertNotNull("Meta Data Value for property for " + mdpn.name() + " should not be null", value);
-            }
-        } catch (CdmSourceException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void whenLoadingNonExistingRemoteSourceThenThrowException() {
-        try {
-            remotePersistentSource = CdmPersistentRemoteSource.NewInstance("nonExistingSource");
-            Assert.fail("Initialising a non-existing remote source should throw an exception");
-        } catch (CdmRemoteSourceException e) {
-            logger.info(e.getMessage());
-        }
-    }
-
-    @Test
-    public void whenLoadingExistingIncompleteRemoteSourceThenThrowException() {
-        try {
-            remotePersistentSource = CdmPersistentRemoteSource.NewInstance("incomplete");
-            Assert.fail("Initialising an incomplete remote source should throw an exception");
-        } catch (CdmRemoteSourceException e) {
-            //Assert.assertThat(e.getMessage(), containsString("Required property '" + CdmSourceProperties.SERVER.toString() + "' is missing"));
-        }
-    }
-
-    @Test
-    public void whenSavingUpdatingDeletingNewCompleteRemoteSourceThenSaveUpdateDeleteIsSuccessful() {
-        String strRemoteSource = "local";
-        Assert.assertFalse("New remote source '" + strRemoteSource + "' should not yet exist in source settings file",
-                CdmPersistentRemoteSource.exists(strRemoteSource));
-        try {
-            ICdmRemoteSource remoteSource =
-                    CdmRemoteSource.NewInstance(strRemoteSource,
-                            "127.0.0.1",
-                            8080,
-                            "col",
-                            NomenclaturalCode.ICNAFP);
-            remotePersistentSource = CdmPersistentRemoteSource.save(strRemoteSource,remoteSource);
-
-            logger.info("Server : " + remotePersistentSource.getServer());
-            Assert.assertTrue("Server value should be equal",
-                    remoteSource.getServer().equals(remotePersistentSource.getServer()));
-
-            logger.info("Port : " + remotePersistentSource.getPort());
-            Assert.assertTrue("Port value should be equal",
-                    remoteSource.getPort() == remotePersistentSource.getPort());
-
-            logger.info("Context Path : " + remotePersistentSource.getContextPath());
-            Assert.assertTrue("Context Path value should be equal",
-                    remoteSource.getContextPath().equals(remotePersistentSource.getContextPath()));
-
-            logger.info("Nomenclatural Code : " + remotePersistentSource.getNomenclaturalCode().name());
-            Assert.assertTrue("Nomenclatural Code value should be equal",
-                    remoteSource.getNomenclaturalCode().name().equals(remotePersistentSource.getNomenclaturalCode().name()));
-
-            Assert.assertTrue("New remote source '" + strRemoteSource + "' should be saved in source settings file",
-                    CdmPersistentRemoteSource.exists(strRemoteSource));
-
-            remoteSource = CdmRemoteSource.NewInstance(strRemoteSource,
-                    "127.0.0.55",
-                    9090,
-                    "cyprus",
-                    NomenclaturalCode.ICNB);
-            remotePersistentSource = CdmPersistentRemoteSource.update(strRemoteSource,remoteSource);
-
-            logger.info("Server : " + remotePersistentSource.getServer());
-            Assert.assertTrue("Server value should be equal",
-                    remoteSource.getServer().equals(remotePersistentSource.getServer()));
-
-            logger.info("Port : " + remotePersistentSource.getPort());
-            Assert.assertTrue("Port value should be equal",
-                    remoteSource.getPort() == remotePersistentSource.getPort());
-
-            logger.info("Context Path : " + remotePersistentSource.getContextPath());
-            Assert.assertTrue("Context Path value should be equal",
-                    remoteSource.getContextPath().equals(remotePersistentSource.getContextPath()));
-
-            logger.info("Nomenclatural Code : " + remotePersistentSource.getNomenclaturalCode().name());
-            Assert.assertTrue("Nomenclatural Code value should be equal",
-                    remoteSource.getNomenclaturalCode().name().equals(remotePersistentSource.getNomenclaturalCode().name()));
-
-            Assert.assertTrue("New remote source '" + strRemoteSource + "' should be saved in source settings file",
-                    CdmPersistentRemoteSource.exists(strRemoteSource));
-
-            CdmPersistentSourceUtils.delete(remotePersistentSource);
-
-            Assert.assertFalse("New remote source '" + strRemoteSource + "' should no longer exist in source settings file",
-                    CdmPersistentRemoteSource.exists(strRemoteSource));
-
-        } catch (CdmRemoteSourceException e) {
-            Assert.fail("Saving a new complete remote source should not throw an exception");
-            logger.info(e.getMessage());
-        }
-    }
-
-
-
-}