net.sf.json;uses:="net.sf.json.processors,net.sf.json.util,org.apache.commons.lang.exception",
org.aopalliance.aop,
org.apache.commons.collections;uses:="org.apache.commons.collections.keyvalue,new org.apache.commons.collections",
+ org.apache.commons.collections.buffer,
org.apache.commons.dbcp,
org.apache.commons.io;uses:="org.apache.commons.io.filefilter",
org.apache.commons.lang;uses:="org.apache.commons.lang.exception",
lib/poi-ooxml-3.10-FINAL.jar,\\r
lib/poi-ooxml-schemas-3.10-FINAL.jar,\\r
lib/xmlbeans-2.3.0.jar,\\r
- lib/cdmlib-commons-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-commons-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-ext-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-ext-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-io-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-io-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-model-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-model-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-persistence-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-persistence-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-print-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-print-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-remote-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-remote-3.6.1-SNAPSHOT.jar,\\r
- lib/cdmlib-services-3.6.1-SNAPSHOT-sources.jar,\\r
lib/cdmlib-services-3.6.1-SNAPSHOT.jar,\\r
lib/swagger-annotations-1.3.5.jar\r
\r
in your hibernate configuration, using hibernate-specific configuration keys.\r
All other properties must be defined as usual in a c3p0.properties file.\r
This is confusing, and will hopefully be simplified some time in the future, but for now...\r
+ \r
+ DOCUMENTATION UPDATE (2015-05-22):\r
+ Hibernate's C3P0ConnectionProvider renames 7 c3p0 configuration properties, which, \r
+ if set in your hibernate configuration, will override any configuration you may have set \r
+ in a c3p0.properties file.\r
+ TODO: are points (2) and (3) still valid? I don't think so! (AK)\r
\r
hibernate.c3p0.acquire_increment\r
hibernate.c3p0.idle_test_period\r
<mapping class="eu.etaxonomy.cdm.model.taxon.Taxon"/>\r
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonBase"/>\r
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNode"/>\r
+ <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation"/>\r
<mapping class="eu.etaxonomy.cdm.model.taxon.Classification"/>\r
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationship"/>\r
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType"/>\r
Bundle-ManifestVersion: 2
Bundle-Name: eu.etaxonomy.taxeditor.test
Bundle-SymbolicName: eu.etaxonomy.taxeditor.test;singleton:=true
-Bundle-Version: 3.5.2.qualifier
+Bundle-Version: 3.6.1.qualifier
Bundle-ActivationPolicy: lazy
Bundle-Vendor: EDIT
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
<parent>\r
<groupId>eu.etaxonomy</groupId>\r
<artifactId>taxeditor-parent</artifactId>\r
- <version>3.5.2-SNAPSHOT</version>\r
+ <version>3.6.1-SNAPSHOT</version>\r
</parent>\r
<modelVersion>4.0.0</modelVersion>\r
<artifactId>eu.etaxonomy.taxeditor.test</artifactId>\r
<artifactId>tycho-surefire-plugin</artifactId>\r
<version>${tycho.version}</version>\r
<configuration>\r
- <!-- currently we run only the non-ui unit tests so we don't the harness-->\r
+ <!-- currently we run only the non-ui unit tests so we don't the \r
+ harness -->\r
<!-- <useUIHarness>true</useUIHarness> -->\r
<dependencies>\r
- <!-- This will pull the feature and its dependent plugins into the classpath\r
- for the tests. Note that this requires ALL taxeditor projects to be\r
- installed. -->\r
+ <!-- This will pull the feature and its dependent plugins into \r
+ the classpath for the tests. Note that this requires ALL taxeditor projects \r
+ to be installed. -->\r
<dependency>\r
<type>eclipse-feature</type>\r
<artifactId>eu.etaxonomy.taxeditor.feature</artifactId>\r
</dependencies>\r
</configuration>\r
</plugin>\r
+ <plugin>\r
+ <groupId>org.eclipse.jetty</groupId>\r
+ <artifactId>jetty-maven-plugin</artifactId>\r
+ <version>9.2.9.v20150224</version>\r
+ <configuration>\r
+ <systemProperties>\r
+ <systemProperty>\r
+ <name>spring.profiles.active</name>\r
+ <value>remoting</value>\r
+ </systemProperty>\r
+ <systemProperty>\r
+ <name>cdm.beanDefinitionFile</name>\r
+ <value>${basedir}/src/test/resources/datasources.xml</value>\r
+ </systemProperty>\r
+ <systemProperty>\r
+ <name>cdm.datasource</name>\r
+ <value>cdmTest</value>\r
+ </systemProperty>\r
+ </systemProperties>\r
+ <stopPort>9191</stopPort>\r
+ <stopKey>jetty-cdm-server</stopKey>\r
+ <stopWait>10</stopWait>\r
+ <httpConnector>\r
+ <port>9090</port>\r
+ </httpConnector>\r
+ <war>${project.parent.basedir}/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/etc/jetty/cdmlib-remote-webapp.war</war>\r
+ <daemon>true</daemon>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <id>start-jetty</id>\r
+ <phase>pre-integration-test</phase>\r
+ <goals>\r
+ <goal>deploy-war</goal>\r
+ </goals>\r
+ <configuration>\r
+ <scanIntervalSeconds>0</scanIntervalSeconds> \r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>stop-jetty</id>\r
+ <phase>post-integration-test</phase>\r
+ <goals>\r
+ <goal>stop</goal>\r
+ </goals>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
</plugins>\r
</build>\r
</project>
\ No newline at end of file
import java.util.Set;
import java.util.UUID;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Before;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
@BeforeClass
public static void initializePolytomousKeyTest() {
- logger.setLevel(Level.INFO);
- CDMServer.getInstance().setKeepServerRunning(true);
+
}
@Before
import java.util.Set;
import java.util.UUID;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.hibernate.collection.spi.PersistentCollection;
import org.junit.Assert;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
import eu.etaxonomy.cdm.model.media.Rights;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
import eu.etaxonomy.taxeditor.remoting.cache.EntityCacherDebugResult;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
@BeforeClass
public static void initializePolytomousKeyTest() {
- logger.setLevel(Level.INFO);
- CDMServer.getInstance().setKeepServerRunning(true);
- initializeController("default",
- "localhost",
- 8080,
- "",
- NomenclaturalCode.ICNAFP,
- "admin",
- "00000");
}
@Before
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.name.BotanicalName;
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
import eu.etaxonomy.taxeditor.operations.OperationTestBase;
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
@BeforeClass
public static void initializePolytomousKeyTest() {
- //logger.setLevel(Level.INFO);
- CDMServer.getInstance().setKeepServerRunning(true);
- initializeController("default",
- "localhost",
- 8080,
- "",
- NomenclaturalCode.ICNAFP,
- "admin",
- "00000");
}
@Before
*/
package eu.etaxonomy.cdm.model;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.BeforeClass;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
import eu.etaxonomy.taxeditor.operations.OperationTestBase;
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
@BeforeClass
public static void initializePolytomousKeyTest() {
- logger.setLevel(Level.INFO);
- CDMServer.getInstance().setKeepServerRunning(true);
- initializeController("default",
- "localhost",
- 8080,
- "",
- NomenclaturalCode.ICNAFP,
- "admin",
- "00000");
}
*/
package eu.etaxonomy.taxeditor.httpinvoker;
+import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.Map;
+import java.util.Properties;
+import org.apache.log4j.Logger;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
*/
@Transactional(TransactionMode.DISABLED)
@SpringApplicationContext("file:./target/classes/eu/etaxonomy/cdm/testRemotingApplicationContext.xml")
-public abstract class BaseRemotingTest extends UnitilsJUnit4 {
- //private static final Logger logger = Logger.getLogger(BaseRemotingTest.class);
+public class BaseRemotingTest extends UnitilsJUnit4 {
+ private static final Logger logger = Logger.getLogger(BaseRemotingTest.class);
- private static final Resource TEST_REMOTE_APPLICATION_CONTEXT_RESOURCE =
- new ClassPathResource("/eu/etaxonomy/cdm/testRemotingApplicationContext.xml");
+
+ public static final Resource SERVER_PROPERTIES_FILE =
+ new ClassPathResource("server.properties");
private static CdmApplicationRemoteController remoteApplicationController;
private static ICdmRemoteSource cdmRemoteSource;
private static CdmPersistentRemoteSource remotePersistentSource;
- public static boolean useManagedServer = false;
+ public static boolean useManagedServer = true;
protected static ICdmEntitySessionManager cdmEntitySessionManager;
+ private final static String DEFAULT_USER = "admin";
+ private final static String DEFAULT_PASSWORD = "00000";
+
+ private static String user = DEFAULT_USER;
+ private static String password = DEFAULT_PASSWORD;
@BeforeClass
public static void initializeBaseRemotingTest() {
useManagedServer = (System.getProperty("use.managed.server") == null) ? useManagedServer : Boolean.valueOf(System.getProperty("use.managed.server"));
if(useManagedServer) {
try {
- CDMServer.getInstance().start();
+ CDMServer cdmServer = CDMServer.getInstance();
+ Properties prop = new Properties();
+ InputStream inputStream = SERVER_PROPERTIES_FILE.getInputStream();
+
+ if (inputStream != null) {
+ prop.load(inputStream);
+ }
+
+ if(prop.getProperty("httpPort") != null) {
+ cdmServer.setHttpPort(Integer.valueOf(prop.getProperty("httpPort")));
+ }
+
+ if(prop.getProperty("stopPort") != null) {
+ cdmServer.setStopPort(Integer.valueOf(prop.getProperty("stopPort")));
+ }
+
+ if(prop.getProperty("stopKey") != null) {
+ cdmServer.setStopKey(prop.getProperty("stopKey"));
+ }
+
+ if(prop.getProperty("user") != null) {
+ user = prop.getProperty("user");
+ }
+
+ if(prop.getProperty("password") != null) {
+ password = prop.getProperty("password");
+ }
+
+ cdmServer.start();
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Server failed to start. Reason : " + e.getMessage());
CDMServer.getInstance().getPort(),
CDMServer.getInstance().getContextPath(),
NomenclaturalCode.ICNAFP,
- "admin",
- "00000");
+ user,
+ password);
}
DatabaseUnitils.disableConstraints();
}
+
public static void initializeController(String sourceName, String host, int port, String contextPath, NomenclaturalCode ncode, String username, String password) {
+ if(remoteApplicationController != null) {
+ return;
+ }
cdmRemoteSource = CdmRemoteSource.NewInstance(sourceName, host, port, contextPath, ncode);
remoteApplicationController =
CdmApplicationRemoteController.NewInstance(cdmRemoteSource,
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.net.Socket;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
import javax.sql.DataSource;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
private final String name = "default";
private final String host = "127.0.0.1";
- private final int port = 9090;
- private final int stopPort = 9191;
- private final String stopKey = "jetty-cdm-server";
+ private int httpPort = 9090;
+ private int stopPort = 9191;
+ private String stopKey = "jetty-cdm-server";
private final String contextPath = "";
- private boolean keepServerRunning = false;
-
public static final Resource DEFAULT_CDM_WEBAPP_RESOURCE =
new ClassPathResource("/etc/jetty/cdmlib-remote-webapp.war");
- public static final Resource DEFAULT_JETTY_CONFIG_RESOURCE =
- new ClassPathResource("/etc/jetty/jetty.xml");
-
- public static final Resource DEFAULT_JETTY_TEMP_RESOURCE =
- new ClassPathResource("/etc/jetty/temp");
-
- public static final Resource DEFAULT_JETTY_TEMP_WAR_LIB_RESOURCE =
- new ClassPathResource("/etc/jetty/temp/webapp/WEB-INF/lib");
-
public static final Resource DEFAULT_DATASOURCE_FILE =
new ClassPathResource("datasources.xml");
public static final Resource DEFAULT_JETTY_RESOURCE =
new ClassPathResource("/etc/jetty/start-9.2.3.v20140905.jar");
-
-
private static CDMServer cdmServer = null;
private static CDMServerException cdmse = null;
- private void CDMServer() {
- logger.setLevel(Level.INFO);
- }
+ private void CDMServer() {}
public static CDMServer getInstance() {
if(cdmServer == null) {
}
public int getPort() {
- return port;
+ return httpPort;
}
public String getContextPath() {
return contextPath;
}
- public boolean getKeepServerRunning() {
- return keepServerRunning;
+ public void setHttpPort(int port) {
+ this.httpPort = port;
+ }
+
+ public void setStopPort(int stopPort) {
+ this.stopPort = stopPort;
}
- public void setKeepServerRunning(boolean keepServerRunning) {
- this.keepServerRunning = keepServerRunning;
+ public void setStopKey(String stopKey) {
+ this.stopKey = stopKey;
}
+
public static boolean isRunningInEclipse() {
return (System.getProperty("sun.java.command") != null &&
System.getProperty("sun.java.command").startsWith("org.eclipse.jdt.internal.junit.runner.RemoteTestRunner"));
return sb.toString();
}
- private String getStartServerArgs() {
+ private String getStartServerArgs() throws IOException {
StringBuilder sb = new StringBuilder();
- sb.append(" --port ");
- sb.append(port);
+ sb.append(" --port " + httpPort);
return sb.toString();
}
return sb.toString();
}
+
public void start() throws CDMServerException {
/**
* has started but incorrectly, in which case we try to force stop it (if we can)
* and start a new server.
*/
- if(isRunning(1)) {
- logger.info("[CDM-Server] Server already running @ " + host + ":" + port );
+ if(isStarted(1)) {
+ logger.info("[CDM-Server] Server already running @ " + host + ":" + httpPort );
return;
- } else if (isAvailable(1)){
- logger.info("[CDM-Server] Server available, but not started correctly @ " + host + ":" + port );
- logger.info("[CDM-Server] .... trying to force stop server @ " + host + ":" + port );
- try {
- stop(true);
- } catch (Exception e) {
- throw new CDMServerException("CDM Server could not be stopped : " + e.getMessage());
- }
}
Thread t = new Thread() {
@Override
public void run() {
+
StringBuffer output = new StringBuffer();
try{
Process p;
logger.info("[CDM-Server] Starting server with Command : " + command);
p = Runtime.getRuntime().exec(command);
- BufferedReader reader =
+ BufferedReader inpReader =
new BufferedReader(new InputStreamReader(p.getInputStream()));
+ BufferedReader errReader =
+ new BufferedReader(new InputStreamReader(p.getErrorStream()));
+
String line = "";
- while ((line = reader.readLine())!= null) {
- logger.info("[CDM-Server] Start : " + line);
+ while ((line = inpReader.readLine())!= null) {
+ logger.info("[CDM-Server Start] : " + line);
+ }
+
+ while ((line = errReader.readLine())!= null) {
+ logger.info("[CDM-Server Start] : " + line);
}
} catch (Exception e) {
e.printStackTrace();
cdmse = new CDMServerException(e);
}
-
}
};
cdmse = null;
t.start();
- if(isRunning(60)) {
- logger.info("[CDM-Server] Started Server @ " + host + ":" + port );
+ if(isStarted(50)) {
+ logger.info("[CDM-Server] Server running @ " + host + ":" + httpPort );
} else {
logger.info("[CDM-Server] Server not started within given interval");
// making sure to kill server if it is not started correctly
}
- public boolean isAvailable(int checkingIntervals) throws CDMServerException {
- int intervalsCount = 0;
- do {
- try {
- Socket s = new Socket(host, port);
- logger.info("[CDM-Server] Available @ " + host + ":" + port );
- return true;
- } catch (IOException ioe) {
- }
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ie) {
- throw new CDMServerException("Error checking CDM Server status", ie);
- }
- intervalsCount++;
- } while (intervalsCount < checkingIntervals);
-
- return false;
- }
-
- public boolean isStopped(int checkingIntervals) throws CDMServerException {
- int intervalsCount = 0;
- do {
- try {
- Socket s = new Socket(host, port);
- } catch (IOException ioe) {
- return true;
- }
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ie) {
- throw new CDMServerException("Error checking CDM Server status", ie);
- }
- intervalsCount++;
- } while (intervalsCount < checkingIntervals);
-
- return false;
- }
-
- public boolean isRunning(int checkingIntervals) throws CDMServerException {
+ public boolean isStarted(int checkingIntervals) throws CDMServerException {
CdmRemoteSourceBase crsb = new CdmRemoteSourceBase("local-cdm-server",
host,
- port,
+ httpPort,
contextPath,
null);
int intervalsCount = 0;
}
boolean check = crsb.checkConnection();
if(check) {
- logger.info("[CDM-Server] Running @ " + host + ":" + port );
+ logger.info("[CDM-Server] Running @ " + host + ":" + httpPort );
return true;
}
} catch (Exception e) {
public void stop() throws Exception {
stop(false);
}
+
public void stop(boolean force) throws Exception {
if(!force) {
- if(!getInstance().isAvailable(1)) {
- logger.info("[CDM-Server] Server already stopped @ " + host + ":" + port );
- return;
- }
-
- if(getInstance().getKeepServerRunning()) {
- logger.info("[CDM-Server] Server @ " + host + ":" + port + " is set to keep running");
+ if(!getInstance().isStarted(1)) {
+ logger.info("[CDM-Server] Server already stopped @ " + host + ":" + httpPort );
return;
}
}
+
Thread t = new Thread() {
@Override
public void run() {
+ getStopServerArgs() + " --stop ";
logger.info("[CDM-Server] Stop Command : " + command);
p = Runtime.getRuntime().exec(command);
- p.waitFor();
- BufferedReader reader =
+
+ BufferedReader inpReader =
new BufferedReader(new InputStreamReader(p.getInputStream()));
+
+ BufferedReader errReader =
+ new BufferedReader(new InputStreamReader(p.getErrorStream()));
+
String line = "";
- while ((line = reader.readLine())!= null) {
- logger.info("CDM-Server Stop : " + line + "\n");
+ while ((line = inpReader.readLine())!= null) {
+ logger.info("[CDM-Server Stop] : " + line);
+ }
+
+ while ((line = errReader.readLine())!= null) {
+ logger.info("[CDM-Server Stop] : " + line);
}
+ logger.info("CDM-Server Stopped : ");
} catch (Exception e) {
- e.printStackTrace();
+ logger.info("[CDM-Server] Could not stop @ " + host + ":" + httpPort + ". Please kill it manually");
+
}
}
t.setDaemon(true);
t.start();
- if(isStopped(5)) {
- logger.info("[CDM-Server] Stopped Server @ " + host + ":" + port );
- } else {
- logger.info("[CDM-Server] Could not stop @ " + host + ":" + port + ". Please kill it manually");
+ }
+
+ public static void stopServerViaJMX(int jmxPort) throws CDMServerException {
+ String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:" + jmxPort + "/jmxrmi";
+ logger.warn("Shutting down Jetty instance ... ");
+
+ try {
+ JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), null);
+ connector.connect(null);
+ MBeanServerConnection connection = connector.getMBeanServerConnection();
+ ObjectName objectName = new ObjectName("org.eclipse.jetty.server:type=server,id=0");
+ connection.invoke(objectName, "stop", null, null);
+ logger.warn("Shutdown command sent");
+ } catch (InstanceNotFoundException e) {
+ throw new CDMServerException(e);
+ } catch (MBeanException e) {
+ throw new CDMServerException(e);
+ } catch (ReflectionException e) {
+ throw new CDMServerException(e);
+ } catch (IOException e) {
+ throw new CDMServerException(e);
+ } catch (MalformedObjectNameException e) {
+ throw new CDMServerException(e);
}
+
+
+
}
}
*/
package eu.etaxonomy.taxeditor.httpinvoker;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import org.unitils.UnitilsJUnit4;
-import eu.etaxonomy.taxeditor.lazyloading.AbstractLazyInitializerTest;
+import eu.etaxonomy.taxeditor.remoting.server.CDMServerException;
/**
* @author cmathew
private static final Logger logger = Logger.getLogger(CdmServerTest.class);
+ @Test
+ public void startCdmServer() throws CDMServerException {
+ CDMServer.getInstance().start();
+ }
+
@Test
public void stopCdmServer() {
- Logger.getRootLogger().setLevel(Level.INFO);
- CDMServer.getInstance().setKeepServerRunning(false);
try {
CDMServer.getInstance().stop(true);
} catch (Exception e) {
+ e.printStackTrace();
Assert.fail("Server could not be stopped. Reason : " + e.getMessage());
}
}
import java.util.UUID;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.hibernate.collection.spi.PersistentCollection;
import org.junit.Assert;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
/**
* @author cmathew
@BeforeClass
public static void initializePolytomousKeyTest() {
- logger.setLevel(Level.INFO);
- CDMServer.getInstance().setKeepServerRunning(true);
-
- //initializeController("default", "127.0.0.1", 8080, "", NomenclaturalCode.ICNAFP);
}
@Test
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
public class ServiceInterceptorTest extends BaseRemotingTest {
-
+
private static final Logger logger = Logger.getLogger(ServiceInterceptorTest.class);
ITermService termService = getRemoteApplicationController().getTermService();
-
+
@BeforeClass
- public static void initializeServiceInterceptorTest() {
- CDMServer.getInstance().setKeepServerRunning(true);
+ public static void initializeServiceInterceptorTest() {
}
-
+
@Test
public void termServiceInterceptorTest() {
List<DefinedTermBase<?>> terms = termService.listByTermType(TermType.Language, null, null, null, null);
Assert.assertEquals(terms.size(),CdmCacher.getDefaultCache().getSize());
- // TO DO : get the static termTypeMap from TermServiceRequestExecutor and check the size
+ // TO DO : get the static termTypeMap from TermServiceRequestExecutor and check the size
}
}
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
-import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
public class CdmEntitySessionManagerTest extends BaseRemotingTest {
@BeforeClass
public static void initializeCdmEntitySessionManagerTest() {
- CDMServer.getInstance().setKeepServerRunning(true);
- //initializeController("default", "127.0.0.1", 8080, "", NomenclaturalCode.ICNAFP);
}
@Before
--- /dev/null
+httpPort=9090
+stopPort=9191
+stopKey=jetty-cdm-server
+user=admin
+password=00000
</url>
</repository>
</distributionManagement>
+
</project>