]> jaekl.net Git - frank.git/commitdiff
Upgrade to Debian Jessie and JDK 7.
authorChris Jaekl <chris@ringo.jaekl.net>
Sat, 22 Aug 2015 03:24:06 +0000 (12:24 +0900)
committerChris Jaekl <chris@ringo.jaekl.net>
Sat, 22 Aug 2015 03:24:06 +0000 (12:24 +0900)
15 files changed:
WEB-INF/web.xml
go.sh
test/net/jaekl/frank/ForceUtf8EncodingFilterTest.java
test/net/jaekl/frank/ScheduleTest.java
test/net/jaekl/frank/ServletRequestMock.java
test/net/jaekl/frank/StyleTest.java
test/net/jaekl/frank/octranspo/ServerTest.java
test/net/jaekl/qd/http/HttpServletRequestMock.java
test/net/jaekl/qd/http/RequestBrokerTest.java
test/net/jaekl/qd/util/ExceptionUtilsTest.java
test/net/jaekl/qd/util/InputStreamWrapperTest.java
test/net/jaekl/qd/util/ParseUtilsTest.java
test/net/jaekl/qd/util/StringUtilsTest.java
test/net/jaekl/qd/xml/MissingInfoExceptionTest.java
test/net/jaekl/qd/xml/ParseResultTest.java

index e07bdc1b10bc10964bf7ba7b8c4e1b76e3f49b26..837bfb4379fe0e70a5dff57023b4c3f19b7893fe 100644 (file)
            <url-pattern>/ViewSchedule</url-pattern>
          </servlet-mapping>
 
-         <filter-mapping>
-           <filter-name>ForceUtf8Encoding</filter-name>
-           <url-pattern>/*</url-pattern>
-         </filter-mapping>
-
          <filter>
            <filter-name>ForceUtf8Encoding</filter-name>
            <filter-class>net.jaekl.frank.ForceUtf8EncodingFilter</filter-class>
          </filter>
         
+         <filter-mapping>
+           <filter-name>ForceUtf8Encoding</filter-name>
+           <url-pattern>/*</url-pattern>
+         </filter-mapping>
+
 <!--
          <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
diff --git a/go.sh b/go.sh
index 43eefcd73fc3feaa7bdc9c1b998f143229421c75..b853754d72fe5625ff57960f12cae87dca1ff739 100755 (executable)
--- a/go.sh
+++ b/go.sh
@@ -5,4 +5,4 @@ find "${WEB_ROOT}/prod" -name "*.java" | xargs javac -classpath ${WEB_ROOT}/prod
 cp -r ${WEB_ROOT}/prod/* ${WEB_ROOT}/WEB-INF/classes/
 find "${WEB_ROOT}/prod" -name '*.class' -exec rm {} \;
 echo Launching...
-java -jar /usr/share/java/jenkins-winstone.jar --httpPort=8002 "${WEB_ROOT}"
+java -Djsse.enableSNIExtension=false -jar /usr/share/java/jenkins-winstone.jar --httpPort=8002 "${WEB_ROOT}"
index 602b35f9a66016de2368a698da98c96f56ab09cc..9a34be0da79576b75870a2cb38495a3f5feaddd6 100644 (file)
@@ -6,7 +6,7 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.junit.Test;
 
index 7f3068031af593085b2819f870a2fa6acefbfea7..6c81937e720ef9f8f76a2530e88e356a8289e5f1 100644 (file)
@@ -6,7 +6,7 @@ import java.io.PrintWriter;
 import java.util.Date;
 import java.util.Locale;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import net.jaekl.frank.octranspo.RouteMock;
 import net.jaekl.frank.octranspo.RouteSummaryMock;
index 5458d8aa22140b175aa13035a82b03cf478e6d6e..65bf383fdf7d3e2926746174272dd52e1359e9f3 100644 (file)
@@ -7,9 +7,13 @@ import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
 import javax.servlet.ServletInputStream;
 import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 
 public class ServletRequestMock implements ServletRequest {
        String m_encodingName;
@@ -25,7 +29,7 @@ public class ServletRequestMock implements ServletRequest {
        }
 
        @Override
-       public Enumeration<?> getAttributeNames() {
+       public Enumeration<String> getAttributeNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -78,7 +82,7 @@ public class ServletRequestMock implements ServletRequest {
        }
 
        @Override
-       public Enumeration<?> getLocales() {
+       public Enumeration<Locale> getLocales() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -90,13 +94,13 @@ public class ServletRequestMock implements ServletRequest {
        }
 
        @Override
-       public Map<?, ?> getParameterMap() {
+       public Map<String, String[]> getParameterMap() {
                // TODO Auto-generated method stub
                return null;
        }
 
        @Override
-       public Enumeration<?> getParameterNames() {
+       public Enumeration<String> getParameterNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -192,4 +196,46 @@ public class ServletRequestMock implements ServletRequest {
                m_encodingName = arg0;
        }
 
+       @Override
+       public AsyncContext getAsyncContext() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public DispatcherType getDispatcherType() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public ServletContext getServletContext() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public boolean isAsyncStarted() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean isAsyncSupported() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public AsyncContext startAsync() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
 }
index f08f649400a297ac4ab8d85d593b4004f362023c..53c922998973ca22bbd26c92d329020a64497c1f 100644 (file)
@@ -4,9 +4,8 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
 
-import junit.framework.Assert;
-
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
index ef90944896bdb5c4198f1674e556164909956c12..1062567660e05ebb2ce4f48cb0e8aadc2c59adf2 100644 (file)
@@ -7,7 +7,7 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 import net.jaekl.frank.FrankException;
 import net.jaekl.qd.QDException;
 import net.jaekl.qd.http.RequestBrokerMock;
@@ -17,6 +17,7 @@ import org.apache.http.message.BasicNameValuePair;
 import org.junit.Test;
 
 public class ServerTest {
+       private static final double TINY_DELTA = 0.00000000001;
        private static final String ROUTE_SUMMARY_FOR_STOP = 
                        "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
                                        + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" 
@@ -221,24 +222,24 @@ public class ServerTest {
                expectedDate = hourMinFormat.parse("11:10");
                Assert.assertEquals(expectedDate, trip.getStart());
                Assert.assertEquals(20, trip.getAdjTime());
-               Assert.assertEquals(0.18, trip.getAdjAge());
+               Assert.assertEquals(0.18, trip.getAdjAge(), TINY_DELTA);
                Assert.assertEquals(false, trip.isLastTrip());
                Assert.assertEquals("4LA - DEH", trip.getBusType());
-               Assert.assertEquals(50.0, trip.getSpeed());
-               Assert.assertEquals(45.352026, trip.getLatitude());
-               Assert.assertEquals(-75.649993, trip.getLongitude());
+               Assert.assertEquals(50.0, trip.getSpeed(), TINY_DELTA);
+               Assert.assertEquals(45.352026, trip.getLatitude(), TINY_DELTA);
+               Assert.assertEquals(-75.649993, trip.getLongitude(), TINY_DELTA);
                
                trip = route.getTrip(2);
                Assert.assertEquals("Ottawa Rockcliffe", trip.getDest());
                expectedDate = hourMinFormat.parse("12:00");
                Assert.assertEquals(expectedDate, trip.getStart());
                Assert.assertEquals(71, trip.getAdjTime());
-               Assert.assertEquals(-1.0, trip.getAdjAge());
+               Assert.assertEquals(-1.0, trip.getAdjAge(), TINY_DELTA);
                Assert.assertEquals(false, trip.isLastTrip());
                Assert.assertEquals("4E - DEH", trip.getBusType());
-               Assert.assertEquals(0.0, trip.getSpeed());
-               Assert.assertEquals(0.0, trip.getLatitude());
-               Assert.assertEquals(0.0, trip.getLongitude());
+               Assert.assertEquals(0.0, trip.getSpeed(), TINY_DELTA);
+               Assert.assertEquals(0.0, trip.getLatitude(), TINY_DELTA);
+               Assert.assertEquals(0.0, trip.getLongitude(), TINY_DELTA);
        }
 
        @Test
@@ -275,24 +276,24 @@ public class ServerTest {
                expectedDate = hourMinFormat.parse("11:40");
                Assert.assertEquals(expectedDate, trip.getStart());
                Assert.assertEquals(2, trip.getAdjTime());
-               Assert.assertEquals(0.55, trip.getAdjAge());
+               Assert.assertEquals(0.55, trip.getAdjAge(), TINY_DELTA);
                Assert.assertEquals(false, trip.isLastTrip());
                Assert.assertEquals("4E - DEH", trip.getBusType());
-               Assert.assertEquals(35.7, trip.getSpeed());
-               Assert.assertEquals(45.392965, trip.getLatitude());
-               Assert.assertEquals(-75.682561, trip.getLongitude());
+               Assert.assertEquals(35.7, trip.getSpeed(), TINY_DELTA);
+               Assert.assertEquals(45.392965, trip.getLatitude(), TINY_DELTA);
+               Assert.assertEquals(-75.682561, trip.getLongitude(), TINY_DELTA);
                
                trip = route.getTrip(2);
                Assert.assertEquals("Ottawa Rockcliffe", trip.getDest());
                expectedDate = hourMinFormat.parse("12:20");
                Assert.assertEquals(expectedDate, trip.getStart());
                Assert.assertEquals(37, trip.getAdjTime());
-               Assert.assertEquals(-1.0, trip.getAdjAge());
+               Assert.assertEquals(-1.0, trip.getAdjAge(), TINY_DELTA);
                Assert.assertEquals(false, trip.isLastTrip());
                Assert.assertEquals("4E - DEH", trip.getBusType());
-               Assert.assertEquals(0.0, trip.getSpeed());
-               Assert.assertEquals(0.0, trip.getLatitude());
-               Assert.assertEquals(0.0, trip.getLongitude());
+               Assert.assertEquals(0.0, trip.getSpeed(), TINY_DELTA);
+               Assert.assertEquals(0.0, trip.getLatitude(), TINY_DELTA);
+               Assert.assertEquals(0.0, trip.getLongitude(), TINY_DELTA);
        }
 
 }
index 456bc822f53e412db403ddf1322c4bd63d9b1c13..2c65c8e6547aac74760b631d8221f7862ccb061e 100644 (file)
@@ -4,15 +4,24 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.Principal;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+import javax.servlet.http.Part;
 
 public class HttpServletRequestMock implements HttpServletRequest {
        Map<String, String[]> m_paramMap;
@@ -28,7 +37,7 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getAttributeNames() {
+       public Enumeration<String> getAttributeNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -82,7 +91,7 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getLocales() {
+       public Enumeration<Locale> getLocales() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -102,7 +111,7 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getParameterNames() {
+       public Enumeration<String> getParameterNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -230,13 +239,13 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getHeaderNames() {
+       public Enumeration<String> getHeaderNames() {
                // TODO Auto-generated method stub
                return null;
        }
 
        @Override
-       public Enumeration<?> getHeaders(String arg0) {
+       public Enumeration<String> getHeaders(String arg0) {
                // TODO Auto-generated method stub
                return null;
        }
@@ -350,4 +359,79 @@ public class HttpServletRequestMock implements HttpServletRequest {
                return false;
        }
 
+       @Override
+       public AsyncContext getAsyncContext() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public DispatcherType getDispatcherType() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public ServletContext getServletContext() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public boolean isAsyncStarted() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean isAsyncSupported() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public AsyncContext startAsync() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public boolean authenticate(HttpServletResponse arg0) throws IOException,
+                       ServletException {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public Part getPart(String arg0) throws IOException, IllegalStateException,
+                       ServletException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Collection<Part> getParts() throws IOException,
+                       IllegalStateException, ServletException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void login(String arg0, String arg1) throws ServletException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       public void logout() throws ServletException {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 307fe90f93ba675d6d47fef394fd5ca94f31bd62..b287348b8f381907e8411b6b656c6b4733cd4d36 100644 (file)
@@ -2,7 +2,7 @@ package net.jaekl.qd.http;
 
 import java.util.ArrayList;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 import net.jaekl.qd.QDException;
 import net.jaekl.qd.xml.ParseResult;
 import net.jaekl.qd.xml.XmlParseException;
index c1361ba6286863d40042ecf5afd05055d55e091b..b0a3e3e70516c5407e60a7c89f58348967bf15d7 100644 (file)
@@ -5,7 +5,7 @@ package net.jaekl.qd.util;
 import java.io.Closeable;
 import java.io.IOException;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 import net.jaekl.qd.QDException;
 
 import org.junit.Test;
index 9db2252ae4058ad538427bc6d3fbfcc9269e2e99..d399ce5399d0d5d0594d1c4966a942e0104bc268 100644 (file)
@@ -6,8 +6,7 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.nio.charset.Charset;
 
-import junit.framework.Assert;
-
+import org.junit.Assert;
 import org.junit.Test;
 
 public class InputStreamWrapperTest {
index 0f8d33ff1d8cd4980b9e39609ccbb8c95b4970fe..cd3eaf5bb4160888ec2da42094ece79859072347 100644 (file)
@@ -1,10 +1,11 @@
 package net.jaekl.qd.util;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.junit.Test;
 
 public class ParseUtilsTest {
+       private final double TINY_DELTA = 0.0000000001;
 
        @Test
        public void testParseDouble() {
@@ -14,7 +15,7 @@ public class ParseUtilsTest {
                
                for (int i = 0; i < inputs.length; ++i) {
                        actual = ParseUtils.parseDouble(inputs[i]);
-                       Assert.assertEquals(expected[i], actual);
+                       Assert.assertEquals(expected[i], actual, TINY_DELTA);
                }
        }
 
index b57f657a1b3703496445eaf8ae4eb2cc1486d71a..0a0d078645a5680ea99425019f66eaf07e99683c 100644 (file)
@@ -1,7 +1,6 @@
 package net.jaekl.qd.util;
 
-import junit.framework.Assert;
-
+import org.junit.Assert;
 import org.junit.Test;
 
 public class StringUtilsTest {
index 32b5ad80e2ab87468d5bdcfb7cee1133fbaa809c..8ce63bd63cf193aad5fac61e99f00c6b9dffb043 100644 (file)
@@ -1,6 +1,6 @@
 package net.jaekl.qd.xml;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.junit.Test;
 
index 040308d051e7e11c7612dcc213df94123b34efeb..41fd0ffde5987d03ff6779cd85fcbbe8bd98ef53 100644 (file)
@@ -6,7 +6,7 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.junit.Test;
 import org.xml.sax.InputSource;