From 54837759f36eddb80af22c8d73e103a948221dc7 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 19 Oct 2020 22:25:29 +0100 Subject: Tests: fixed unit.log print. --- test/unit/applications/lang/java.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/applications/lang/java.py') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index 01cbfa0b..a034d9a4 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -10,7 +10,7 @@ from unit.applications.proto import TestApplicationProto class TestApplicationJava(TestApplicationProto): def load(self, script, name='app', **kwargs): - app_path = self.temp_dir + '/java' + app_path = option.temp_dir + '/java' web_inf_path = app_path + '/WEB-INF/' classes_path = web_inf_path + 'classes/' script_path = option.test_dir + '/java/' + script + '/' -- cgit From 8956e668cc3b4088a7bdd3d82ca99ac1445c8814 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 27 Oct 2020 04:09:52 +0000 Subject: Tests: fixed isolation detection. --- test/unit/applications/lang/java.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/unit/applications/lang/java.py') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index a034d9a4..0aa1a7af 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -9,7 +9,7 @@ from unit.applications.proto import TestApplicationProto class TestApplicationJava(TestApplicationProto): - def load(self, script, name='app', **kwargs): + def prepare_env(self, script): app_path = option.temp_dir + '/java' web_inf_path = app_path + '/WEB-INF/' classes_path = web_inf_path + 'classes/' @@ -75,6 +75,9 @@ class TestApplicationJava(TestApplicationProto): except: pytest.fail('Cann\'t run javac process.') + def load(self, script, **kwargs): + self.prepare_env(script) + self._load_conf( { "listeners": {"*:7080": {"pass": "applications/" + script}}, @@ -83,8 +86,11 @@ class TestApplicationJava(TestApplicationProto): "unit_jars": option.current_dir + '/build', "type": 'java', "processes": {"spare": 0}, - "working_directory": script_path, - "webapp": app_path, + "working_directory": option.test_dir + + '/java/' + + script + + '/', + "webapp": option.temp_dir + '/java', } }, }, -- cgit From 6a00bab41e2ebffe5f61f6fb9641162624db41d1 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 28 Oct 2020 00:01:46 +0300 Subject: Tests: improving get_application_type() and fixing its name. This patch also enables multiversion tests running for Java. --- test/unit/applications/lang/java.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/unit/applications/lang/java.py') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index 0aa1a7af..fe0dde7a 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -9,6 +9,8 @@ from unit.applications.proto import TestApplicationProto class TestApplicationJava(TestApplicationProto): + application_type = "java" + def prepare_env(self, script): app_path = option.temp_dir + '/java' web_inf_path = app_path + '/WEB-INF/' @@ -84,7 +86,7 @@ class TestApplicationJava(TestApplicationProto): "applications": { script: { "unit_jars": option.current_dir + '/build', - "type": 'java', + "type": self.get_application_type(), "processes": {"spare": 0}, "working_directory": option.test_dir + '/java/' -- cgit From 4ba9e1d0058bc1710a0078af6e9a1f7e4bee986a Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 2 Nov 2020 21:05:04 +0300 Subject: Java: upgrading 3rd-party components. --- test/unit/applications/lang/java.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/applications/lang/java.py') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index fe0dde7a..b57d48bf 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -52,7 +52,7 @@ class TestApplicationJava(TestApplicationProto): os.makedirs(classes_path) classpath = ( - option.current_dir + '/build/tomcat-servlet-api-9.0.13.jar' + option.current_dir + '/build/tomcat-servlet-api-9.0.39.jar' ) ws_jars = glob.glob( -- cgit From 5182d2c398a07f65f2b2334bc04d79130a40808c Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 3 Nov 2020 01:31:05 +0000 Subject: Tests: force applications to build for JVM 8. This change is made to avoid situations when an application is compiled for a version newer than the Java module used. --- test/unit/applications/lang/java.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test/unit/applications/lang/java.py') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index b57d48bf..e1bd5e0c 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -64,6 +64,7 @@ class TestApplicationJava(TestApplicationProto): javac = [ 'javac', + '-target', '8', '-source', '8', '-nowarn', '-encoding', 'utf-8', '-d', classes_path, '-classpath', classpath + ':' + ws_jars[0], -- cgit From 567f0a7b3049f4532524ac35cb232cbeedb868bf Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 16 Nov 2020 20:37:01 +0300 Subject: Tests: fixing tests interrupt in terminal. KeyboardInterrupt re-raised. --- test/unit/applications/lang/java.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/unit/applications/lang/java.py') diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index e1bd5e0c..0ff85187 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -71,12 +71,18 @@ class TestApplicationJava(TestApplicationProto): ] javac.extend(src) + if option.detailed: + print("\n$ " + " ".join(javac)) + try: process = subprocess.Popen(javac, stderr=subprocess.STDOUT) process.communicate() + except KeyboardInterrupt: + raise + except: - pytest.fail('Cann\'t run javac process.') + pytest.fail('Can\'t run javac process.') def load(self, script, **kwargs): self.prepare_env(script) -- cgit