summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-07-17 17:48:35 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-07-17 17:48:35 +0300
commita920215a5cec785e8e3f4bb675b18b5c8916f4dd (patch)
tree76bfe42b0dd11e16b1926849c96bb91ca2cb3af8
parent4153fad89dfeb694bf7f0c94d4c02da50af1852b (diff)
downloadunit-a920215a5cec785e8e3f4bb675b18b5c8916f4dd.tar.gz
unit-a920215a5cec785e8e3f4bb675b18b5c8916f4dd.tar.bz2
Tests: more Java tests.
Added test with war file and error configuration test.
-rw-r--r--test/java/empty_war/empty.warbin0 -> 484 bytes
-rw-r--r--test/test_java_application.py40
2 files changed, 40 insertions, 0 deletions
diff --git a/test/java/empty_war/empty.war b/test/java/empty_war/empty.war
new file mode 100644
index 00000000..4985e804
--- /dev/null
+++ b/test/java/empty_war/empty.war
Binary files differ
diff --git a/test/test_java_application.py b/test/test_java_application.py
index 54ae3366..e62720d1 100644
--- a/test/test_java_application.py
+++ b/test/test_java_application.py
@@ -5,6 +5,46 @@ from unit.applications.lang.java import TestApplicationJava
class TestJavaApplication(TestApplicationJava):
prerequisites = ['java']
+ def test_java_conf_error(self):
+ self.skip_alerts.extend(
+ [
+ r'realpath.*failed',
+ r'failed to apply new conf',
+ ]
+ )
+ self.assertIn(
+ 'error',
+ self.conf(
+ {
+ "listeners": {"*:7080": {"pass": "applications/app"}},
+ "applications": {
+ "app": {
+ "type": "java",
+ "processes": 1,
+ "working_directory": self.current_dir
+ + "/java/empty",
+ "webapp": self.testdir + "/java",
+ }
+ },
+ }
+ ),
+ 'conf error',
+ )
+
+ def test_java_war(self):
+ self.load('empty_war')
+
+ self.assertIn(
+ 'success',
+ self.conf(
+ '"' + self.testdir + '/java/empty.war"',
+ '/config/applications/empty_war/webapp',
+ ),
+ 'configure war',
+ )
+
+ self.assertEqual(self.get()['status'], 200, 'war')
+
def test_java_application_cookies(self):
self.load('cookies')