java.py (1596:b7e2d4d92624) java.py (1621:275b26bbd3ae)
1import glob
2import os
3import pytest
4import shutil
5import subprocess
6
7from unit.applications.proto import TestApplicationProto
8from conftest import option

--- 35 unchanged lines hidden (view full) ---

44 shutil.copy2(file_path, web_inf_path)
45 else:
46 shutil.copy2(file_path, app_path)
47
48 if src:
49 if not os.path.isdir(classes_path):
50 os.makedirs(classes_path)
51
1import glob
2import os
3import pytest
4import shutil
5import subprocess
6
7from unit.applications.proto import TestApplicationProto
8from conftest import option

--- 35 unchanged lines hidden (view full) ---

44 shutil.copy2(file_path, web_inf_path)
45 else:
46 shutil.copy2(file_path, app_path)
47
48 if src:
49 if not os.path.isdir(classes_path):
50 os.makedirs(classes_path)
51
52 classpath = self.pardir + '/build/tomcat-servlet-api-9.0.13.jar'
52 classpath = (
53 option.current_dir + '/build/tomcat-servlet-api-9.0.13.jar'
54 )
53
54 ws_jars = glob.glob(
55
56 ws_jars = glob.glob(
55 self.pardir + '/build/websocket-api-java-*.jar'
57 option.current_dir + '/build/websocket-api-java-*.jar'
56 )
57
58 if not ws_jars:
59 pytest.fail('websocket api jar not found.')
60
61 javac = [
62 'javac',
63 '-encoding', 'utf-8',

--- 9 unchanged lines hidden (view full) ---

73 except:
74 pytest.fail('Cann\'t run javac process.')
75
76 self._load_conf(
77 {
78 "listeners": {"*:7080": {"pass": "applications/" + script}},
79 "applications": {
80 script: {
58 )
59
60 if not ws_jars:
61 pytest.fail('websocket api jar not found.')
62
63 javac = [
64 'javac',
65 '-encoding', 'utf-8',

--- 9 unchanged lines hidden (view full) ---

75 except:
76 pytest.fail('Cann\'t run javac process.')
77
78 self._load_conf(
79 {
80 "listeners": {"*:7080": {"pass": "applications/" + script}},
81 "applications": {
82 script: {
81 "unit_jars": self.pardir + '/build',
83 "unit_jars": option.current_dir + '/build',
82 "type": 'java',
83 "processes": {"spare": 0},
84 "working_directory": script_path,
85 "webapp": app_path,
86 }
87 },
88 },
89 **kwargs
90 )
84 "type": 'java',
85 "processes": {"spare": 0},
86 "working_directory": script_path,
87 "webapp": app_path,
88 }
89 },
90 },
91 **kwargs
92 )