You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2008/12/03 01:33:36 UTC
svn commit: r722703 -
/ode/branches/APACHE_ODE_1.X/axis2/src/test/java/org/apache/ode/axis2/ODEServerTest.java
Author: midon
Date: Tue Dec 2 16:33:36 2008
New Revision: 722703
URL: http://svn.apache.org/viewvc?rev=722703&view=rev
Log:
ODE-445: add a unit test
Added:
ode/branches/APACHE_ODE_1.X/axis2/src/test/java/org/apache/ode/axis2/ODEServerTest.java
Added: ode/branches/APACHE_ODE_1.X/axis2/src/test/java/org/apache/ode/axis2/ODEServerTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/test/java/org/apache/ode/axis2/ODEServerTest.java?rev=722703&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2/src/test/java/org/apache/ode/axis2/ODEServerTest.java (added)
+++ ode/branches/APACHE_ODE_1.X/axis2/src/test/java/org/apache/ode/axis2/ODEServerTest.java Tue Dec 2 16:33:36 2008
@@ -0,0 +1,48 @@
+package org.apache.ode.axis2;
+
+import junit.framework.TestCase;
+
+import javax.servlet.ServletException;
+import java.io.File;
+
+import org.junit.Test;
+
+/**
+ *
+ */
+public class ODEServerTest extends TestCase {
+
+ public void testNonExistingRootDir() {
+ String ghostDir = "/" + System.currentTimeMillis();
+ assertFalse("This test requires a non existing directory", new File(ghostDir).isDirectory());
+ System.setProperty("org.apache.ode.rootDir", ghostDir);
+ try {
+ new ODEServer().init((String) null, null);
+ fail("Should throw an IllegalArgumentException if the root dir does not exist");
+ } catch (IllegalArgumentException e) {
+ assertTrue(true);
+ } catch (ServletException se) {
+ fail("Should throw an IllegalArgumentException if the root dir does not exist");
+ }finally {
+ // reset to avoid side effects
+ System.getProperties().remove("org.apache.ode.rootDir");
+ }
+ }
+
+ public void testNonExistingConfigDir() {
+ String ghostDir = "/" + System.currentTimeMillis();
+ assertFalse("This test requires a non existing directory", new File(ghostDir).isDirectory());
+ System.setProperty("org.apache.ode.configDir", ghostDir);
+ try {
+ new ODEServer().init(System.getProperty("user.dir"), null);
+ fail("Should throw an IllegalArgumentException if the config dir does not exist");
+ } catch (IllegalArgumentException e) {
+ assertTrue(true);
+ } catch (ServletException se) {
+ fail("Should throw an IllegalArgumentException if the config dir does not exist");
+ }finally {
+ // reset to avoid side effects
+ System.getProperties().remove("org.apache.ode.configDir");
+ }
+ }
+}