提交 b9bfd389 编写于 作者: M michaelm

6513803: httpserver regression test Test13 failing and causing NullPointerException

Summary: check for NPEs
Reviewed-by: chegar
上级 b2bc82b6
...@@ -86,9 +86,12 @@ public class Test1 extends Test { ...@@ -86,9 +86,12 @@ public class Test1 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
s1.stop(2); if (s1 != null)
s2.stop(2); s1.stop(2);
executor.shutdown (); if (s2 != null)
s2.stop(2);
if (executor != null)
executor.shutdown ();
} }
} }
......
...@@ -85,9 +85,12 @@ public class Test12 extends Test { ...@@ -85,9 +85,12 @@ public class Test12 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
s1.stop(2); if (s1 != null)
s2.stop(2); s1.stop(2);
executor.shutdown (); if (s2 != null)
s2.stop(2);
if (executor != null)
executor.shutdown ();
} }
} }
......
...@@ -81,9 +81,12 @@ public class Test13 extends Test { ...@@ -81,9 +81,12 @@ public class Test13 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
s1.stop(2); if (s1 != null)
s2.stop(2); s1.stop(2);
executor.shutdown (); if (s2 != null)
s2.stop(2);
if (executor != null)
executor.shutdown ();
} }
} }
......
...@@ -62,8 +62,10 @@ public class Test3 extends Test { ...@@ -62,8 +62,10 @@ public class Test3 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
server.stop(2); if (server != null)
exec.shutdown(); server.stop(2);
if (exec != null)
exec.shutdown();
} }
} }
......
...@@ -60,8 +60,10 @@ public class Test4 extends Test { ...@@ -60,8 +60,10 @@ public class Test4 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
server.stop(2); if (server != null)
exec.shutdown(); server.stop(2);
if (exec != null)
exec.shutdown();
} }
} }
......
...@@ -61,8 +61,10 @@ public class Test5 extends Test { ...@@ -61,8 +61,10 @@ public class Test5 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay (); delay ();
server.stop(2); if (server != null)
exec.shutdown(); server.stop(2);
if (exec != null)
exec.shutdown();
} }
} }
......
...@@ -97,9 +97,12 @@ public class Test9 extends Test { ...@@ -97,9 +97,12 @@ public class Test9 extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
s1.stop(2); if (s1 != null)
s2.stop(2); s1.stop(2);
executor.shutdown (); if (s2 != null)
s2.stop(2);
if (executor != null)
executor.shutdown ();
} }
} }
......
...@@ -92,8 +92,10 @@ public class Test9a extends Test { ...@@ -92,8 +92,10 @@ public class Test9a extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
server.stop(2); if (server != null)
executor.shutdown (); server.stop(2);
if (executor != null)
executor.shutdown();
} }
} }
......
...@@ -89,8 +89,10 @@ public class TestLogging extends Test { ...@@ -89,8 +89,10 @@ public class TestLogging extends Test {
System.out.println ("OK"); System.out.println ("OK");
} finally { } finally {
delay(); delay();
s1.stop(2); if (s1 != null)
executor.shutdown (); s1.stop(2);
if (executor != null)
executor.shutdown();
} }
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册