File size: 1,518 Bytes
a757bd3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import json
import os
import time
import unittest
import sys
if "/www/server/panel" not in sys.path:
sys.path.insert(0, "/www/server/panel")
if "/www/server/panel/class" not in sys.path:
sys.path.insert(0, "/www/server/panel/class")
from mod.project.java.springboot_parser import SpringConfigParser, SpringLogConfigParser
class TestSpringConfigParser(unittest.TestCase):
# def test_parser_config(self):
# file = "/www/java_mall/yami-shop-admin-0.0.1-SNAPSHOT.jar"
# # file = "/www/lilishop/lili-shop-error_jar.jar"
# # file = "/www/wwwroot/111_java/demo.jar"
# # file = "/www/wwwroot/33_java/tduck-api.jar"
# # file = "/www/java_mall/yami-shop-api-0.0.1-SNAPSHOT.jar"
#
# scp = SpringConfigParser(file)
# print(scp.get_tip())
#
# def test_shell_env(self):
# SpringConfigParser.get_env_file_data("/www/wwwroot/33_java/test.sh")
def test_parser_log_config(self):
# file = "/www/java_mall/yami-shop-admin-0.0.1-SNAPSHOT.jar"
# file = "/www/lilishop/run_api/buyer-api-4.3.jar"
# file = "/www/wwwroot/111_java/demo.jar"
# file = "/www/wwwroot/33_java/tduck-api.jar"
file = "/www/wwwroot/55_MCMS_java/ms-mcms.jar"
# file = "/www/java_mall/yami-shop-api-0.0.1-SNAPSHOT.jar"
if not os.path.exists(file):
print("文件不存在")
scp = SpringLogConfigParser(file)
print(scp.get_all_log_ptah())
if __name__ == '__main__':
unittest.main()
|