aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/web/WebServerTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-13 08:25:16 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-13 08:25:16 +1300
commit63ab6dcd5b23b517c9bd810773ae8535b1006c83 (patch)
tree35d14e462dde6c86eb454bcf56b906d064b65dd7 /test/org/traccar/web/WebServerTest.java
parent55f11c9dda7394d4c8c96bfe5da9497756df6866 (diff)
downloadtrackermap-server-63ab6dcd5b23b517c9bd810773ae8535b1006c83.tar.gz
trackermap-server-63ab6dcd5b23b517c9bd810773ae8535b1006c83.tar.bz2
trackermap-server-63ab6dcd5b23b517c9bd810773ae8535b1006c83.zip
Rename web server JNDI context test
Diffstat (limited to 'test/org/traccar/web/WebServerTest.java')
-rw-r--r--test/org/traccar/web/WebServerTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/org/traccar/web/WebServerTest.java b/test/org/traccar/web/WebServerTest.java
new file mode 100644
index 000000000..5a79fbac2
--- /dev/null
+++ b/test/org/traccar/web/WebServerTest.java
@@ -0,0 +1,29 @@
+package org.traccar.web;
+
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+public class WebServerTest {
+
+ @Test
+ public void contextTest() throws NamingException {
+ DataSource mockDataSource = (DataSource) Proxy.newProxyInstance(getClass().getClassLoader(),
+ new Class[] { DataSource.class }, new InvocationHandler() {
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ return null;
+ }
+ });
+
+ Context context = new InitialContext();
+ context.bind("java:/DefaultDS", mockDataSource);
+ }
+
+}