diff --git a/core/add_project.sh b/core/add_project.sh index e5640839..07902fce 100755 --- a/core/add_project.sh +++ b/core/add_project.sh @@ -48,6 +48,16 @@ function setup_alluxio() { mvn clean install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dfindbugs.skip -Dmaven.javadoc.skip=true } +function setup_shenyu_common() { + # /home/kejiawu2/project/openctest/core/identify_param/app/ctest-shenyu/shenyu/shenyu-common/ + [ ! -d "app/ctest-shenyu" ] && git clone https://github.com/KobeNorris/shenyu.git app/ctest-shenyu + cd app/ctest-shenyu + git fetch && git checkout ctest-interception + home_dir=$PWD + cd $home_dir/shenyu-common/ + mvn package -DskipTests +} + function usage() { echo "Usage: add_project.sh
" exit 1 @@ -64,7 +74,8 @@ function main() { hbase) setup_hbase ;; zookeeper) setup_zookeeper ;; alluxio) setup_alluxio ;; - *) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper and alluxio." ;; + shenyu-common) setup_shenyu_common ;; + *) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper, alluxio and shenyu-common." ;; esac fi } diff --git a/core/ctest_const.py b/core/ctest_const.py index d0820f43..2967ed06 100644 --- a/core/ctest_const.py +++ b/core/ctest_const.py @@ -12,11 +12,13 @@ HBASE = "hbase-server" ZOOKEEPER = "zookeeper-server" ALLUXIO = "alluxio-core" +SYCOMMON = "shenyu-common" CTEST_HADOOP_DIR = os.path.join(APP_DIR, "ctest-hadoop") CTEST_HBASE_DIR = os.path.join(APP_DIR, "ctest-hbase") CTEST_ZK_DIR = os.path.join(APP_DIR, "ctest-zookeeper") CTEST_ALLUXIO_DIR = os.path.join(APP_DIR, "ctest-alluxio") +CTEST_SYCOMMON_DIR = os.path.join(APP_DIR, "ctest-shenyu") PROJECT_DIR = { HCOMMON: CTEST_HADOOP_DIR, @@ -24,6 +26,7 @@ HBASE: CTEST_HBASE_DIR, ZOOKEEPER: CTEST_ZK_DIR, ALLUXIO: CTEST_ALLUXIO_DIR, + SYCOMMON: CTEST_SYCOMMON_DIR, } @@ -34,6 +37,7 @@ HBASE: "hbase-server", ZOOKEEPER: "zookeeper-server", ALLUXIO: "core", + SYCOMMON: "shenyu-common", } @@ -58,6 +62,7 @@ os.path.join(CTEST_ALLUXIO_DIR, MODULE_SUBDIR[ALLUXIO], "server/worker", SUREFIRE_SUBDIR), os.path.join(CTEST_ALLUXIO_DIR, MODULE_SUBDIR[ALLUXIO], "server/master", SUREFIRE_SUBDIR), ], + SYCOMMON: [os.path.join(CTEST_SYCOMMON_DIR, MODULE_SUBDIR[SYCOMMON], SUREFIRE_SUBDIR)], } # default or deprecate conf path @@ -74,7 +79,8 @@ HDFS: os.path.join(DEFAULT_CONF_DIR, HDFS + "-default.tsv"), HBASE: os.path.join(DEFAULT_CONF_DIR, HBASE + "-default.tsv"), ALLUXIO: os.path.join(DEFAULT_CONF_DIR, ALLUXIO + "-default.tsv"), - ZOOKEEPER: os.path.join(DEFAULT_CONF_DIR, ZOOKEEPER + "-default.tsv") + ZOOKEEPER: os.path.join(DEFAULT_CONF_DIR, ZOOKEEPER + "-default.tsv"), + SYCOMMON: os.path.join(DEFAULT_CONF_DIR, SYCOMMON + "-default.tsv") } @@ -96,7 +102,12 @@ ], ALLUXIO: [ os.path.join(CTEST_ALLUXIO_DIR, "core/alluxio-ctest.properties") - ] + ], + SYCOMMON: [ + # /home/kejiawu2/project/openctest/core/app/ctest-shenyu/shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt + # /home/kejiawu2/project/openctest/core/app/ctest-shenyu/shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt + os.path.join(CTEST_SYCOMMON_DIR, "shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt") + ], } diff --git a/core/default_configs/hbase-server-default.tsv b/core/default_configs/hbase-server-default.tsv index 57263ff3..5188b73b 100644 --- a/core/default_configs/hbase-server-default.tsv +++ b/core/default_configs/hbase-server-default.tsv @@ -1,4 +1,4 @@ -hbase.rootdir ${hbase.tmp.dir}/hbase The directory shared by region servers and into which HBase persists. The URL should be 'fully-qualified' to include the filesystem scheme. For example, to specify the HDFS directory '/hbase' where the HDFS instance's namenode is running at namenode.example.org on port 9000, set this value to: hdfs://namenode.example.org:9000/hbase. By default, we write to whatever ${hbase.tmp.dir} is set too -- usually /tmp -- so change this configuration or else all data will be lost on machine restart. +hbase.rootdir ${hbase.tmp.dir}/hbase The directory shared by region servers and into which HBase persists. The URL should be 'fully-qualified' to include the filesystem scheme. For example, to specify the HDFS directory '/hbase' where the HDFS instance's namenode is running at namenode.example.org on port 9000, set this value to: hdfs://namenode.example.org:9000/hbase. By default, we write to whatever ${hbase.tmp.dir} is set too -- usually /tmp -- so change this configuration or else all data will be lost on machine restart. zookeeper.recovery.retry.maxsleeptime 60000 Max sleep time before retry zookeeper operations in milliseconds, a max time is needed here so that sleep time won't grow unboundedly hbase.master.port 16000 The port the HBase Master should bind to. hbase.master.info.bindAddress 0.0.0.0 The bind address for the HBase Master web UI @@ -74,7 +74,7 @@ hbase.status.multicast.address.port 16100 Multicast port to use for the status p hbase.dynamic.jars.dir ${hbase.rootdir}/lib The directory from which the custom filter JARs can be loaded dynamically by the region server without the need to restart. However, an already loaded filter/co-processor class would not be un-loaded. See HBASE-1936 for more details. Does not apply to coprocessors. hbase.master.loadbalancer.class org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer Class used to execute the regions balancing when the period occurs. See the class comment for more on how it works http://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.html It replaces the DefaultLoadBalancer as the default (since renamed as the SimpleLoadBalancer). hbase.master.normalizer.class org.apache.hadoop.hbase.master.normalizer.SimpleRegionNormalizer Class used to execute the region normalization when the period occurs. See the class comment for more on how it works http://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.html -hbase.procedure.master.classes A comma-separated list of org.apache.hadoop.hbase.procedure.MasterProcedureManager procedure managers that are loaded by default on the active HMaster process. A procedure is identified by its signature and users can use the signature and an instant name to trigger an execution of a globally barriered procedure. After implementing your own MasterProcedureManager, just put it in HBase's classpath and add the fully qualified class name here. +hbase.procedure.master.classes A comma-separated list of org.apache.hadoop.hbase.procedure.MasterProcedureManager procedure managers that are loaded by default on the active HMaster process. A procedure is identified by its signature and users can use the signature and an instant name to trigger an execution of a globally barriered procedure. After implementing your own MasterProcedureManager, just put it in HBase's classpath and add the fully qualified class name here. hbase.regionserver.storefile.refresh.period 0 The period (in milliseconds) for refreshing the store files for the secondary regions. 0 means this feature is disabled. Secondary regions sees new files (from flushes and compactions) from primary once the secondary region refreshes the list of files in the region (there is no notification mechanism). But too frequent refreshes might cause extra Namenode pressure. If the files cannot be refreshed for longer than HFile TTL (hbase.master.hfilecleaner.ttl) the requests are rejected. Configuring HFile TTL to a larger value is also recommended with this setting. hbase.http.filter.initializers org.apache.hadoop.hbase.http.lib.StaticUserWebFilter A comma separated list of class names. Each class in the list must extend org.apache.hadoop.hbase.http.FilterInitializer. The corresponding Filter will be initialized. Then, the Filter will be applied to all user facing jsp and servlet web pages. The ordering of the list defines the ordering of the filters. The default StaticUserWebFilter add a user principal as defined by the hbase.http.staticuser.user property. hbase.http.max.threads 16 The maximum number of threads that the HTTP Server will create in its ThreadPool. diff --git a/core/default_configs/shenyu-common-default.tsv b/core/default_configs/shenyu-common-default.tsv new file mode 100644 index 00000000..52015031 --- /dev/null +++ b/core/default_configs/shenyu-common-default.tsv @@ -0,0 +1,38 @@ +Scheduler.enabled false . +Scheduler.type fixed . +ExtPlugin.enabled false . +ExtPlugin.threads 1 . +ExtPlugin.scheduleTime 300 . +ExtPlugin.scheduleDelay 30 . +MatchCache.enabled false . +MatchCache.maxFreeMemory 256 . +ExcludePath.enabled false . +FallbackPath.enabled false . +Health.enabled false . +FileConfig.enabled false . +FileConfig.maxSize 10 . +UpstreamCheck.SwitchConfig.local true . +UpstreamCheck.enabled false . +UpstreamCheck.timeout 3000 . +UpstreamCheck.healthyThreshold 1 . +UpstreamCheck.unhealthyThreshold 1 . +UpstreamCheck.interval 5000 . +UpstreamCheck.printEnabled false . +UpstreamCheck.printInterval 60000 . +CrossFilterConfig.enabled false . +CrossFilterConfig.allowedMethods * . +CrossFilterConfig.allowedAnyOrigin fales . +CrossFilterConfig.maxAge 18000 . +CrossFilterConfig.allowCredentials false . +CrossFilterConfig.AllowedOriginConfig.spacer . . +InstanceConfig.enabled false . +RibbonConfig.serverListRefreshInterval 10000 . +Local.enabled false . +WebsocketConfig.maxFramePayloadSize 10 . +SharedPool.enable false . +SharedPool.prefix shenyu-shared . +SharedPool.corePoolSize 200 . +SharedPool.maximumPoolSize Integer.MAX_VALUE . +SharedPool.keepAliveTime 60000L . +SharedPool.maxWorkQueueMemory MemoryLimitCalculator.defaultLimit() . +MetricsConfig.enabled false . \ No newline at end of file diff --git a/core/generate_ctest/ctest_mapping/ctests-shenyu-common.json b/core/generate_ctest/ctest_mapping/ctests-shenyu-common.json new file mode 100644 index 00000000..82f37005 --- /dev/null +++ b/core/generate_ctest/ctest_mapping/ctests-shenyu-common.json @@ -0,0 +1 @@ +{"ExtPlugin.scheduleTime": ["org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin"], "FileConfig.maxSize": ["org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig"]} \ No newline at end of file diff --git a/core/generate_ctest/inject.py b/core/generate_ctest/inject.py index 75f5b443..53aa0790 100644 --- a/core/generate_ctest/inject.py +++ b/core/generate_ctest/inject.py @@ -14,7 +14,7 @@ def inject_config(param_value_pairs): for p, v in param_value_pairs.items(): print(">>>>[ctest_core] injecting {} with value {}".format(p, v)) - if project in [ZOOKEEPER, ALLUXIO]: + if project in [ZOOKEEPER, ALLUXIO, SYCOMMON]: for inject_path in INJECTION_PATH[project]: print(">>>>[ctest_core] injecting into file: {}".format(inject_path)) file = open(inject_path, "w") @@ -41,7 +41,7 @@ def inject_config(param_value_pairs): def clean_conf_file(project): print(">>>> cleaning injected configuration from file") - if project in [ZOOKEEPER, ALLUXIO]: + if project in [ZOOKEEPER, ALLUXIO, SYCOMMON]: for inject_path in INJECTION_PATH[project]: file = open(inject_path, "w") file.write("\n") diff --git a/core/generate_ctest/main.py b/core/generate_ctest/main.py index a53169d6..fc91d2df 100644 --- a/core/generate_ctest/main.py +++ b/core/generate_ctest/main.py @@ -33,7 +33,7 @@ def test_value_pair(test_input): mt_file = open(os.path.join(GENCTEST_TR_DIR, project, MT_FILE.format(id=param)), "w") associated_tests = mapping[param] if param in mapping else [] - if len(mapping[param]) != 0: + if param in mapping.keys() and len(mapping[param]) != 0: for value in values: tr = run_test_seperate(param, value, associated_tests) diff --git a/core/generate_ctest/program_input.py b/core/generate_ctest/program_input.py index 9147868a..5dca36c1 100644 --- a/core/generate_ctest/program_input.py +++ b/core/generate_ctest/program_input.py @@ -4,11 +4,11 @@ # run mode "run_mode": "generate_ctest", # string # name of the project, i.e. hadoop-common, hadoop-hdfs, see constant.py - "project": "hadoop-common", # string + "project": "shenyu-common", # string # path to param -> tests json mapping - "mapping_path": "../../data/ctest_mapping/opensource-hadoop-common.json", # string + "mapping_path": "../../data/ctest_mapping/opensource-shenyu-common.json", # string # good values of params tests will be run against - "param_value_tsv": "sample-hadoop-common.tsv", # string + "param_value_tsv": "sample-shenyu-common.tsv", # string # display the terminal output live, without saving any results "display_mode": False, # bool # whether to use mvn test or mvn surefire:test diff --git a/core/generate_ctest/sample-hadoop-common.tsv b/core/generate_ctest/sample-hadoop-common.tsv deleted file mode 100644 index 8a3b3bcd..00000000 --- a/core/generate_ctest/sample-hadoop-common.tsv +++ /dev/null @@ -1,2 +0,0 @@ -ftp.bytes-per-checksum 10 100 -hadoop.http.authentication.type simple kerberos \ No newline at end of file diff --git a/core/generate_ctest/sample-shenyu-common.tsv b/core/generate_ctest/sample-shenyu-common.tsv new file mode 100644 index 00000000..f5ab22ce --- /dev/null +++ b/core/generate_ctest/sample-shenyu-common.tsv @@ -0,0 +1,38 @@ +Scheduler.enabled true SKIP +Scheduler.type SKIP SKIP +ExtPlugin.enabled true SKIP +ExtPlugin.threads 0 2 +ExtPlugin.scheduleTime 150 600 +ExtPlugin.scheduleDelay 15 60 +MatchCache.enabled true SKIP +MatchCache.maxFreeMemory 128 512 +ExcludePath.enabled true SKIP +FallbackPath.enabled true SKIP +Health.enabled true SKIP +FileConfig.enabled true SKIP +FileConfig.maxSize 1 20 +UpstreamCheck.SwitchConfig.local false SKIP +UpstreamCheck.enabled true SKIP +UpstreamCheck.timeout 1500 6000 +UpstreamCheck.healthyThreshold 0 2 +UpstreamCheck.unhealthyThreshold 0 2 +UpstreamCheck.interval 2500 10000 +UpstreamCheck.printEnabled true SKIP +UpstreamCheck.printInterval 30000 120000 +CrossFilterConfig.enabled true SKIP +CrossFilterConfig.allowedMethods SKIP SKIP +CrossFilterConfig.allowedAnyOrigin SKIP SKIP +CrossFilterConfig.maxAge 9000 36000 +CrossFilterConfig.allowCredentials true SKIP +CrossFilterConfig.AllowedOriginConfig.spacer SKIP SKIP +InstanceConfig.enabled true SKIP +RibbonConfig.serverListRefreshInterval 5000 20000 +Local.enabled true SKIP +WebsocketConfig.maxFramePayloadSize 1 20 +SharedPool.enable true SKIP +SharedPool.prefix SKIP SKIP +SharedPool.corePoolSize 100 400 +SharedPool.maximumPoolSize SKIP SKIP +SharedPool.keepAliveTime SKIP SKIP +SharedPool.maxWorkQueueMemory SKIP SKIP +MetricsConfig.enabled true SKIP diff --git a/core/generate_value/value_generation.py b/core/generate_value/value_generation.py index 82a5bde8..10c94bce 100644 --- a/core/generate_value/value_generation.py +++ b/core/generate_value/value_generation.py @@ -21,10 +21,14 @@ def read_tsv(module): tsv_file = open("../default_configs/" + module + "-default.tsv") read_tsv = csv.reader(tsv_file, delimiter="\t") for row in read_tsv: + print(row) params.append(Param(row[0], row[1], row[2])) if module == "zookeeper-server": assert len(params) == 32 return 32 + elif module == "shenyu-common": + assert len(params) == 38 + return 38 else: assert len(params) == 90 return 90 @@ -105,6 +109,8 @@ def print_params(module): f = open(module + output, "w") if module == "zookeeper-server": assert len(params) == 32 + elif module == "shenyu-common": + assert len(params) == 38 else: assert len(params) >= 90 for param in params: @@ -117,7 +123,7 @@ def print_params(module): print(param.dvalue) print(param.description) print("----------------------") - f.write("SKIP\tSKIP\n") + f.write("SKIP SKIP\n") unhandled.append(param) else: pcnt += 1 @@ -125,7 +131,7 @@ def print_params(module): tmp_cnt += len(param.gvalues) assert len(param.gvalues) <= 2 if len(param.gvalues) == 1: - f.write(str(param.gvalues[0]) + "\tSKIP\n") + f.write(str(param.gvalues[0]) + " SKIP\n") elif len(param.gvalues) == 2: f.write(str(param.gvalues[0]) + "\t" + str(param.gvalues[1]) + "\n") else: diff --git a/core/identify_param/add_project.sh b/core/identify_param/add_project.sh index 954dbab8..cf6b640c 100755 --- a/core/identify_param/add_project.sh +++ b/core/identify_param/add_project.sh @@ -47,6 +47,16 @@ function setup_alluxio() { mvn clean install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dfindbugs.skip -Dmaven.javadoc.skip=true } +function setup_shenyu_common() { + # /home/kejiawu2/project/openctest/core/identify_param/app/ctest-shenyu/shenyu/shenyu-common/ + [ ! -d "app/ctest-shenyu" ] && git clone https://github.com/KobeNorris/shenyu.git app/ctest-shenyu + cd app/ctest-shenyu + git fetch && git checkout ctest-logging + home_dir=$PWD + cd $home_dir/shenyu-common/ + mvn package -DskipTests +} + function usage() { echo "Usage: add_project.sh
" exit 1 @@ -63,7 +73,8 @@ function main() { hbase) setup_hbase ;; zookeeper) setup_zookeeper ;; alluxio) setup_alluxio ;; - *) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper and alluxio." ;; + shenyu-common) setup_shenyu_common ;; + *) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper, alluxio and shenyu-common." ;; esac fi } diff --git a/core/identify_param/constant.py b/core/identify_param/constant.py index a0b2d067..3b4b83f4 100644 --- a/core/identify_param/constant.py +++ b/core/identify_param/constant.py @@ -7,12 +7,14 @@ CTEST_HBASE_DIR = os.path.join(APP_DIR, "ctest-hbase") CTEST_ZOOKEEPER_DIR = os.path.join(APP_DIR, "ctest-zookeeper") CTEST_ALLUXIO_DIR = os.path.join(APP_DIR, "ctest-alluxio") +CTEST_SHENYU_DIR = os.path.join(APP_DIR, "ctest-shenyu") MODULE_PATH = { "hadoop-common": CTEST_HADOOP_DIR, "hadoop-hdfs": CTEST_HADOOP_DIR, "hbase-server": CTEST_HBASE_DIR, - "alluxio-core": CTEST_ALLUXIO_DIR + "alluxio-core": CTEST_ALLUXIO_DIR, + "shenyu-common": CTEST_SHENYU_DIR } SRC_SUBDIR = { @@ -20,7 +22,8 @@ "hadoop-hdfs": "hadoop-hdfs-project/hadoop-hdfs", "hbase-server": "hbase-server", "zookeeper-server": "zookeeper-server", - "alluxio-core": "core" + "alluxio-core": "core", + "shenyu-common": "shenyu-common" } MVN_TEST_PATH = { @@ -29,6 +32,7 @@ "hbase-server": os.path.join(CTEST_HBASE_DIR, SRC_SUBDIR["hbase-server"]), "zookeeper-server": os.path.join(CTEST_ZOOKEEPER_DIR, SRC_SUBDIR["zookeeper-server"]), "alluxio-core": os.path.join(CTEST_ALLUXIO_DIR, SRC_SUBDIR["alluxio-core"]), + "shenyu-common": os.path.join(CTEST_SHENYU_DIR, SRC_SUBDIR["shenyu-common"]) } LOCAL_CONF_PATH = { @@ -36,7 +40,8 @@ "hadoop-hdfs": "results/hadoop-hdfs/conf_params.txt", "hbase-server": "results/hbase-server/conf_params.txt", "zookeeper-server": "results/zookeeper-server/conf_params.txt", - "alluxio-core": "results/alluxio-core/conf_params.txt" + "alluxio-core": "results/alluxio-core/conf_params.txt", + "shenyu-common": "results/shenyu-common/conf_params.txt" } SUREFIRE_SUBDIR = "target/surefire-reports/*" @@ -63,6 +68,9 @@ os.path.join(CTEST_ALLUXIO_DIR, "core/server/proxy", SUREFIRE_SUBDIR), os.path.join(CTEST_ALLUXIO_DIR, "core/server/worker", SUREFIRE_SUBDIR), os.path.join(CTEST_ALLUXIO_DIR, "core/server/master", SUREFIRE_SUBDIR) + ], + "shenyu-common": [ + os.path.join(CTEST_SHENYU_DIR, "shenyu-common", SUREFIRE_SUBDIR) ] } @@ -83,5 +91,8 @@ ], "alluxio-core": [ os.path.join("surefire-reports/alluxio-core", LOCAL_SUREFIRE_SUFFIX) + ], + "shenyu-common": [ + os.path.join("surefire-reports/shenyu-common", LOCAL_SUREFIRE_SUFFIX) ] } diff --git a/core/identify_param/identify_param.sh b/core/identify_param/identify_param.sh index 76963419..097c7ed7 100755 --- a/core/identify_param/identify_param.sh +++ b/core/identify_param/identify_param.sh @@ -12,9 +12,9 @@ function main() { usage else case $project in - hadoop-common | hadoop-hdfs | hbase-server | zookeeper-server | alluxio-core) python3 runner.py $project; python3 collector.py $project ;; + hadoop-common | hadoop-hdfs | hbase-server | zookeeper-server | alluxio-core | shenyu-common) python3 runner.py $project; python3 collector.py $project ;; -h | --help) usage ;; - *) echo "Unexpected project: $project - only support hadoop-common, hadoop-hdfs, hbase-server, zookeeper-server and alluxio-core." ;; + *) echo "Unexpected project: $project - only support hadoop-common, hadoop-hdfs, hbase-server, zookeeper-server, alluxio-core and shenyu-common." ;; esac fi } diff --git a/core/identify_param/results/shenyu-common/conf_params.txt b/core/identify_param/results/shenyu-common/conf_params.txt new file mode 100644 index 00000000..b64ed533 --- /dev/null +++ b/core/identify_param/results/shenyu-common/conf_params.txt @@ -0,0 +1,76 @@ +switchConfig +file +exclude +health +fallback +extPlugin +matchCache +scheduler +upstreamCheck +cross +instance +ribbon +local +websocket +sharedPool +metrics +Scheduler.enabled +Scheduler.type +Scheduler.threads +ExtPlugin.path +ExtPlugin.enabled +ExtPlugin.threads +ExtPlugin.scheduleTime +ExtPlugin.scheduleDelay +MatchCache.enabled +MatchCache.maxFreeMemory +ExcludePath.enabled +ExcludePath.paths +FallbackPath.enabled +FallbackPath.paths +Health.enabled +Health.paths +FileConfig.enabled +FileConfig.maxSize +SwitchConfig.local +UpstreamCheck.enabled +UpstreamCheck.timeout +UpstreamCheck.healthyThreshold +UpstreamCheck.unhealthyThreshold +UpstreamCheck.interval +UpstreamCheck.printEnabled +UpstreamCheck.printInterval +CrossFilterConfig.enabled +CrossFilterConfig.allowedHeaders +CrossFilterConfig.allowedMethods +CrossFilterConfig.allowedOrigin +CrossFilterConfig.allowedAnyOrigin +CrossFilterConfig.allowedExpose +CrossFilterConfig.maxAge +CrossFilterConfig.allowCredentials +CrossFilterConfig.AllowedOriginConfig.spacer +CrossFilterConfig.AllowedOriginConfig.domain +CrossFilterConfig.AllowedOriginConfig.prefixes +CrossFilterConfig.AllowedOriginConfig.origins +CrossFilterConfig.AllowedOriginConfig.originRegex +InstanceConfig.enabled +InstanceConfig.registerType +InstanceConfig.serverLists +InstanceConfig.props +RibbonConfig.serverListRefreshInterval +Local.enabled +Local.sha512Key +WebsocketConfig.maxFramePayloadSize +SharedPool.enable +SharedPool.prefix +SharedPool.corePoolSize +SharedPool.maximumPoolSize +SharedPool.keepAliveTime +SharedPool.maxWorkQueueMemory +SharedPool.maxFreeMemory +MetricsConfig.enabled +MetricsConfig.name +MetricsConfig.host +MetricsConfig.port +MetricsConfig.jmxConfig +MetricsConfig.props diff --git a/core/identify_param/results/shenyu-common/test_method_list.json b/core/identify_param/results/shenyu-common/test_method_list.json new file mode 100644 index 00000000..b6840a75 --- /dev/null +++ b/core/identify_param/results/shenyu-common/test_method_list.json @@ -0,0 +1 @@ +[ "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testLocal", "org.apache.shenyu.common.config.ShenyuConfigTest#testLocal", "org.apache.shenyu.common.config.ShenyuConfigTest#testLocal", "org.apache.shenyu.common.config.ShenyuConfigTest#testLocal", "org.apache.shenyu.common.config.ShenyuConfigTest#testLocal", "org.apache.shenyu.common.config.ShenyuConfigTest#testFallbackPath", "org.apache.shenyu.common.config.ShenyuConfigTest#testFallbackPath", "org.apache.shenyu.common.config.ShenyuConfigTest#testFallbackPath", "org.apache.shenyu.common.config.ShenyuConfigTest#testFallbackPath", "org.apache.shenyu.common.config.ShenyuConfigTest#testFallbackPath", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testWebsocketConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testWebsocketConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testWebsocketConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler", "org.apache.shenyu.common.config.ShenyuConfigTest#testExcludePath", "org.apache.shenyu.common.config.ShenyuConfigTest#testExcludePath", "org.apache.shenyu.common.config.ShenyuConfigTest#testExcludePath", "org.apache.shenyu.common.config.ShenyuConfigTest#testExcludePath", "org.apache.shenyu.common.config.ShenyuConfigTest#testExcludePath", "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testUpstreamCheck", "org.apache.shenyu.common.config.ShenyuConfigTest#testRibbonConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testRibbonConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testRibbonConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testRibbonConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testRibbonConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", "org.apache.shenyu.common.config.ShenyuConfigTest#testSwitchConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testSwitchConfig", "org.apache.shenyu.common.config.ShenyuConfigTest#testSwitchConfig" ] \ No newline at end of file diff --git a/core/identify_param/runner.py b/core/identify_param/runner.py index 2ce7fd99..719b0bf9 100644 --- a/core/identify_param/runner.py +++ b/core/identify_param/runner.py @@ -110,13 +110,13 @@ def parse(self, lines, method): line = line[line.find("[CTEST][SET-PARAM]"):] assert line.startswith("[CTEST][SET-PARAM] "), "wrong line: " + line assert line.split(" ")[0] == "[CTEST][SET-PARAM]" - assert line.count(" ") == 2, "more than one whitespace in " + line + # assert line.count(" ") == 2, "more than one whitespace in " + line param_name = line.split(" ")[1] if param_name in self.params: - if self.aggressive or self.setInTest(line.split(" ")[2]): - is_setter = True - self.setter_record.write(method + " " + param_name + "\n") - self.setter_record.flush() + # if self.aggressive or self.setInTest(line.split(" ")[2]): + is_setter = True + self.setter_record.write(method + " " + param_name + "\n") + self.setter_record.flush() if is_getter or is_setter: if is_getter: diff --git a/core/patch/shenyu/interception.patch b/core/patch/shenyu/interception.patch new file mode 100644 index 00000000..1ab5511b --- /dev/null +++ b/core/patch/shenyu/interception.patch @@ -0,0 +1,574 @@ +From e6bfac959c62e98a5ce462e358f4776f534ae5d9 Mon Sep 17 00:00:00 2001 +From: KobeNorris +Date: Mon, 5 Dec 2022 15:55:13 -0600 +Subject: [PATCH 1/2] feat: Update Pom file + +--- + shenyu-common/pom.xml | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/shenyu-common/pom.xml b/shenyu-common/pom.xml +index 203b9f661..b9cc958f8 100644 +--- a/shenyu-common/pom.xml ++++ b/shenyu-common/pom.xml +@@ -64,4 +64,18 @@ + commons-collections4 + + ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-surefire-plugin ++ 3.0.0-M4 ++ ++ plain ++ true ++ ++ ++ ++ + +-- +2.25.1 + + +From b967139aaf149cecaf12f6c8863c5a42a4db27c6 Mon Sep 17 00:00:00 2001 +From: KobeNorris +Date: Mon, 5 Dec 2022 15:57:50 -0600 +Subject: [PATCH 2/2] feat: Create Interception approach + +--- + .../shenyu/common/config/CTestInjector.java | 489 ++++++++++++++++++ + .../common/config/InjectionValuePair.txt | 1 + + .../shenyu/common/config/ShenyuConfig.java | 9 + + 3 files changed, 499 insertions(+) + create mode 100644 shenyu-common/src/main/java/org/apache/shenyu/common/config/CTestInjector.java + create mode 100644 shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt + +diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/config/CTestInjector.java b/shenyu-common/src/main/java/org/apache/shenyu/common/config/CTestInjector.java +new file mode 100644 +index 000000000..0ae8dd61a +--- /dev/null ++++ b/shenyu-common/src/main/java/org/apache/shenyu/common/config/CTestInjector.java +@@ -0,0 +1,489 @@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++package org.apache.shenyu.common.config; ++ ++import org.slf4j.Logger; ++import org.slf4j.LoggerFactory; ++ ++import java.io.File; ++ ++import java.util.ArrayList; ++import java.util.HashSet; ++import java.util.Properties; ++import java.util.Scanner; ++ ++/** ++ * The CTest config parameter value injection class. ++ */ ++public class CTestInjector { ++ ++ private static final Logger LOG = LoggerFactory.getLogger(CTestInjector.class); ++ ++ private static int pathIdx; ++ ++ private static String[] paramPath; ++ ++ private static String paramValue; ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateCParams(final ShenyuConfig shenyuConfig) { ++ try { ++ File fileObject = new File("./src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt"); ++ Scanner fileReader = new Scanner(fileObject); ++ String line; ++ while (fileReader.hasNextLine()) { ++ line = fileReader.nextLine(); ++ paramPath = line.split("="); ++ if (paramPath.length < 2) { ++ paramValue = "null"; ++ } else { ++ paramValue = paramPath[1]; ++ } ++ paramPath = paramPath[0].split("\\."); ++ pathIdx = 0; ++ updateShenyuConfig(shenyuConfig); ++ } ++ fileReader.close(); ++ } catch (Exception e) { ++ LOG.warn("FileNotFoundException Message: " + e.toString()); ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateShenyuConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "FileConfig": ++ updateFileConfig(shenyuConfig); ++ break; ++ case "ExcludePath": ++ updateExcludePathConfig(shenyuConfig); ++ break; ++ case "Health": ++ updateHealthConfig(shenyuConfig); ++ break; ++ case "FallbackPath": ++ updateFallbackPathConfig(shenyuConfig); ++ break; ++ case "ExtPlugin": ++ updateExtPluginConfig(shenyuConfig); ++ break; ++ case "MatchCache": ++ updateMatchCacheConfig(shenyuConfig); ++ break; ++ case "Scheduler": ++ updateSchedulerConfig(shenyuConfig); ++ break; ++ case "UpstreamCheck": ++ updateUpstreamCheckConfig(shenyuConfig); ++ break; ++ case "CrossFilterConfig": ++ updateCrossFilterConfig(shenyuConfig); ++ break; ++ case "InstanceConfig": ++ updateInstanceConfig(shenyuConfig); ++ break; ++ case "RibbonConfig": ++ updateRibbonConfig(shenyuConfig); ++ break; ++ case "Local": ++ updateLocal(shenyuConfig); ++ break; ++ case "WebsocketConfig": ++ updateWebsocketConfig(shenyuConfig); ++ break; ++ case "SharedPool": ++ updateSharedPoolConfig(shenyuConfig); ++ break; ++ case "MetricsConfig": ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateFileConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getFile().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "maxSize": ++ shenyuConfig.getFile().setMaxSize("null".equals(paramValue) ? 0 : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateExcludePathConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getExclude().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "paths": ++ shenyuConfig.getExclude().setPaths("null".equals(paramValue) ? null : new ArrayList<>()); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateHealthConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getHealth().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "paths": ++ shenyuConfig.getHealth().setPaths("null".equals(paramValue) ? null : new ArrayList<>()); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateFallbackPathConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getFallback().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "paths": ++ shenyuConfig.getFallback().setPaths("null".equals(paramValue) ? null : new ArrayList<>()); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateMatchCacheConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getMatchCache().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "maxFreeMemory": ++ shenyuConfig.getMatchCache().setMaxFreeMemory("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateUpstreamCheckConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "SwitchConfig": ++ updateSwitchConfig(shenyuConfig); ++ break; ++ case "enabled": ++ shenyuConfig.getUpstreamCheck().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "timeout": ++ shenyuConfig.getUpstreamCheck().setTimeout("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "healthyThreshold": ++ shenyuConfig.getUpstreamCheck().setHealthyThreshold("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "unhealthyThreshold": ++ shenyuConfig.getUpstreamCheck().setUnhealthyThreshold("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "interval": ++ shenyuConfig.getUpstreamCheck().setInterval("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "printEnabled": ++ shenyuConfig.getUpstreamCheck().setPrintEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "printInterval": ++ shenyuConfig.getUpstreamCheck().setPrintInterval("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateCrossFilterConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getCross().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "allowedHeaders": ++ shenyuConfig.getCross().setAllowedHeaders("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "allowedAnyOrigin": ++ shenyuConfig.getCross().setAllowedAnyOrigin("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "maxAge": ++ shenyuConfig.getCross().setMaxAge("null".equals(paramValue) ? "0" : paramValue); ++ break; ++ case "allowCredentials": ++ shenyuConfig.getCross().setAllowCredentials("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "allowedOrigin": ++ updateAllowedOriginConfig(shenyuConfig); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateAllowedOriginConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "spacer": ++ shenyuConfig.getCross().getAllowedOrigin().setSpacer("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "domain": ++ shenyuConfig.getCross().getAllowedOrigin().setDomain("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "prefixes": ++ shenyuConfig.getCross().getAllowedOrigin().setPrefixes("null".equals(paramValue) ? null : new HashSet<>()); ++ break; ++ case "origins": ++ shenyuConfig.getCross().getAllowedOrigin().setOrigins("null".equals(paramValue) ? null : new HashSet<>()); ++ break; ++ case "originRegex": ++ shenyuConfig.getCross().getAllowedOrigin().setOriginRegex("null".equals(paramValue) ? "" : paramValue); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateInstanceConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getInstance().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "registerType": ++ shenyuConfig.getInstance().setRegisterType("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "serverLists": ++ shenyuConfig.getInstance().setServerLists("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "props": ++ shenyuConfig.getInstance().setProps("null".equals(paramValue) ? null : new Properties()); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateRibbonConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "serverListRefreshInterval": ++ shenyuConfig.getRibbon().setServerListRefreshInterval("null".equals(paramValue) ? 0 : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateLocal(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getLocal().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "sha512Key": ++ shenyuConfig.getLocal().setSha512Key("null".equals(paramValue) ? "" : paramValue); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateWebsocketConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "maxFramePayloadSize": ++ shenyuConfig.getWebsocket().setMaxFramePayloadSize("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateSharedPoolConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enable": ++ shenyuConfig.getSharedPool().setEnable("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "prefix": ++ shenyuConfig.getSharedPool().setPrefix("null".equals(paramValue) ? null : paramValue); ++ break; ++ case "corePoolSize": ++ shenyuConfig.getSharedPool().setCorePoolSize("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "maximumPoolSize": ++ shenyuConfig.getSharedPool().setMaximumPoolSize("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "keepAliveTime": ++ shenyuConfig.getSharedPool().setKeepAliveTime("null".equals(paramValue) ? null : Long.valueOf(paramValue)); ++ break; ++ case "maxWorkQueueMemory": ++ shenyuConfig.getSharedPool().setMaxWorkQueueMemory("null".equals(paramValue) ? null : 3000L); ++ break; ++ case "maxFreeMemory": ++ shenyuConfig.getSharedPool().setMaxFreeMemory("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateMetricsConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getMetrics().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "name": ++ shenyuConfig.getMetrics().setName("null".equals(paramValue) ? null : paramValue); ++ break; ++ case "host": ++ shenyuConfig.getMetrics().setHost("null".equals(paramValue) ? null : paramValue); ++ break; ++ case "port": ++ shenyuConfig.getMetrics().setPort("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "jmxConfig": ++ shenyuConfig.getMetrics().setJmxConfig("null".equals(paramValue) ? null : paramValue); ++ break; ++ case "props": ++ shenyuConfig.getMetrics().setProps("null".equals(paramValue) ? null : new Properties()); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateExtPluginConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "path": ++ shenyuConfig.getExtPlugin().setPath("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "enabled": ++ shenyuConfig.getExtPlugin().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "threads": ++ shenyuConfig.getExtPlugin().setThreads("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "scheduleTime": ++ shenyuConfig.getExtPlugin().setScheduleTime("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ case "scheduleDelay": ++ shenyuConfig.getExtPlugin().setScheduleDelay("null".equals(paramValue) ? null : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateSchedulerConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "enabled": ++ shenyuConfig.getScheduler().setEnabled("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ case "type": ++ shenyuConfig.getScheduler().setType("null".equals(paramValue) ? "" : paramValue); ++ break; ++ case "threads": ++ shenyuConfig.getScheduler().setThreads("null".equals(paramValue) ? 16 : Integer.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++ ++ /** ++ * Function for updating the config parameters for ShenyuConfig. ++ * ++ * @param shenyuConfig The obejct waiting for update ++ */ ++ public static void updateSwitchConfig(final ShenyuConfig shenyuConfig) { ++ switch (paramPath[pathIdx++]) { ++ case "local": ++ shenyuConfig.getSwitchConfig().setLocal("null".equals(paramValue) ? false : Boolean.valueOf(paramValue)); ++ break; ++ default: ++ } ++ } ++} +diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt b/shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt +new file mode 100644 +index 000000000..8b1378917 +--- /dev/null ++++ b/shenyu-common/src/main/java/org/apache/shenyu/common/config/InjectionValuePair.txt +@@ -0,0 +1 @@ ++ +diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java b/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java +index e1c18a3b0..3cbc87df8 100644 +--- a/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java ++++ b/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java +@@ -65,6 +65,15 @@ public class ShenyuConfig { + + private MetricsConfig metrics = new MetricsConfig(); + ++ /** ++ * Gets ShenyuConfig. ++ * ++ * @return the ShenyuConfig ++ */ ++ public ShenyuConfig() { ++ CTestInjector.updateCParams(this); ++ } ++ + /** + * Gets health. + * +-- +2.25.1 + diff --git a/core/patch/shenyu/logging.patch b/core/patch/shenyu/logging.patch new file mode 100644 index 00000000..e7374d41 --- /dev/null +++ b/core/patch/shenyu/logging.patch @@ -0,0 +1,1321 @@ +From 77f94b95442f6270df0de4610c36b5d8dd1f3a21 Mon Sep 17 00:00:00 2001 +From: KobeNorris +Date: Mon, 5 Dec 2022 15:45:58 -0600 +Subject: [PATCH 1/2] feat: Update Pom files + +--- + shenyu-common/pom.xml | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/shenyu-common/pom.xml b/shenyu-common/pom.xml +index 203b9f661..b9cc958f8 100644 +--- a/shenyu-common/pom.xml ++++ b/shenyu-common/pom.xml +@@ -64,4 +64,18 @@ + commons-collections4 + + ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-surefire-plugin ++ 3.0.0-M4 ++ ++ plain ++ true ++ ++ ++ ++ + +-- +2.25.1 + + +From 0a3d11b804233a2c75d40ee7acf3715a48ea8571 Mon Sep 17 00:00:00 2001 +From: KobeNorris +Date: Mon, 5 Dec 2022 15:51:27 -0600 +Subject: [PATCH 2/2] feat: Instrumentalize ShenyuConfig.java + +--- + .../shenyu/common/config/ShenyuConfig.java | 174 +++++++++++++++++- + 1 file changed, 172 insertions(+), 2 deletions(-) + +diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java b/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java +index e1c18a3b0..ac9f1960d 100644 +--- a/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java ++++ b/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java +@@ -19,6 +19,8 @@ package org.apache.shenyu.common.config; + + import org.apache.shenyu.common.concurrent.MemoryLimitCalculator; + import org.springframework.util.StringUtils; ++import org.slf4j.Logger; ++import org.slf4j.LoggerFactory; + + import java.util.ArrayList; + import java.util.HashSet; +@@ -33,6 +35,8 @@ import java.util.stream.Stream; + */ + public class ShenyuConfig { + ++ private static final Logger LOG = LoggerFactory.getLogger(ShenyuConfig.class); ++ + private SwitchConfig switchConfig = new SwitchConfig(); + + private FileConfig file = new FileConfig(); +@@ -65,12 +69,27 @@ public class ShenyuConfig { + + private MetricsConfig metrics = new MetricsConfig(); + ++ /** ++ * Gets stack trace. ++ * ++ * @return the stack trace information ++ */ ++ private static String getStackTrace() { ++ // String stacktrace = " "; ++ // for (StackTraceElement element : Thread.currentThread().getStackTrace()) { ++ // stacktrace = stacktrace.concat(element.getClassName() + '#' + element.getMethodName() + ' '); ++ // } ++ // return stacktrace; ++ return ""; ++ } ++ + /** + * Gets health. + * + * @return the health + */ + public Health getHealth() { ++ LOG.warn("[CTEST][GET-PARAM] health" + getStackTrace()); + return health; + } + +@@ -80,6 +99,7 @@ public class ShenyuConfig { + * @param health the health + */ + public void setHealth(final Health health) { ++ LOG.warn("[CTEST][SET-PARAM] health" + getStackTrace()); + this.health = health; + } + +@@ -89,6 +109,7 @@ public class ShenyuConfig { + * @return the metrics + */ + public MetricsConfig getMetrics() { ++ LOG.warn("[CTEST][GET-PARAM] metrics" + getStackTrace()); + return metrics; + } + +@@ -98,6 +119,7 @@ public class ShenyuConfig { + * @param metrics the metrics + */ + public void setMetrics(final MetricsConfig metrics) { ++ LOG.warn("[CTEST][SET-PARAM] metrics" + getStackTrace()); + this.metrics = metrics; + } + +@@ -107,6 +129,7 @@ public class ShenyuConfig { + * @return the shared thread pool config + */ + public SharedPool getSharedPool() { ++ LOG.warn("[CTEST][GET-PARAM] sharedPool" + getStackTrace()); + return sharedPool; + } + +@@ -116,6 +139,7 @@ public class ShenyuConfig { + * @param sharedPool the shared thread pool config + */ + public void setSharedPool(final SharedPool sharedPool) { ++ LOG.warn("[CTEST][SET-PARAM] sharedPool" + getStackTrace()); + this.sharedPool = sharedPool; + } + +@@ -125,6 +149,7 @@ public class ShenyuConfig { + * @return the local config + */ + public Local getLocal() { ++ LOG.warn("[CTEST][GET-PARAM] local" + getStackTrace()); + return local; + } + +@@ -134,6 +159,7 @@ public class ShenyuConfig { + * @param local the local config + */ + public void setLocal(final Local local) { ++ LOG.warn("[CTEST][SET-PARAM] local" + getStackTrace()); + this.local = local; + } + +@@ -143,6 +169,7 @@ public class ShenyuConfig { + * @return the ribbon + */ + public RibbonConfig getRibbon() { ++ LOG.warn("[CTEST][GET-PARAM] ribbon" + getStackTrace()); + return ribbon; + } + +@@ -152,6 +179,7 @@ public class ShenyuConfig { + * @param ribbon the ribbon + */ + public void setRibbon(final RibbonConfig ribbon) { ++ LOG.warn("[CTEST][SET-PARAM] ribbon" + getStackTrace()); + this.ribbon = ribbon; + } + +@@ -161,6 +189,7 @@ public class ShenyuConfig { + * @return the instance + */ + public InstanceConfig getInstance() { ++ LOG.warn("[CTEST][GET-PARAM] instance" + getStackTrace()); + return instance; + } + +@@ -170,6 +199,7 @@ public class ShenyuConfig { + * @param instance the instance + */ + public void setInstance(final InstanceConfig instance) { ++ LOG.warn("[CTEST][SET-PARAM] instance" + getStackTrace()); + this.instance = instance; + } + +@@ -179,6 +209,7 @@ public class ShenyuConfig { + * @return the switch config + */ + public SwitchConfig getSwitchConfig() { ++ LOG.warn("[CTEST][GET-PARAM] switchConfig" + getStackTrace()); + return switchConfig; + } + +@@ -188,6 +219,7 @@ public class ShenyuConfig { + * @param switchConfig the switch config + */ + public void setSwitchConfig(final SwitchConfig switchConfig) { ++ LOG.warn("[CTEST][SET-PARAM] switchConfig" + getStackTrace()); + this.switchConfig = switchConfig; + } + +@@ -197,6 +229,7 @@ public class ShenyuConfig { + * @return the scheduler + */ + public Scheduler getScheduler() { ++ LOG.warn("[CTEST][GET-PARAM] scheduler" + getStackTrace()); + return scheduler; + } + +@@ -206,6 +239,7 @@ public class ShenyuConfig { + * @param scheduler the scheduler + */ + public void setScheduler(final Scheduler scheduler) { ++ LOG.warn("[CTEST][SET-PARAM] scheduler" + getStackTrace()); + this.scheduler = scheduler; + } + +@@ -215,6 +249,7 @@ public class ShenyuConfig { + * @return the ext plugin + */ + public ExtPlugin getExtPlugin() { ++ LOG.warn("[CTEST][GET-PARAM] extPlugin" + getStackTrace()); + return extPlugin; + } + +@@ -224,6 +259,7 @@ public class ShenyuConfig { + * @param extPlugin the ext plugin + */ + public void setExtPlugin(final ExtPlugin extPlugin) { ++ LOG.warn("[CTEST][SET-PARAM] extPlugin" + getStackTrace()); + this.extPlugin = extPlugin; + } + +@@ -233,6 +269,7 @@ public class ShenyuConfig { + * @return the match cache + */ + public MatchCache getMatchCache() { ++ LOG.warn("[CTEST][GET-PARAM] matchCache" + getStackTrace()); + return matchCache; + } + +@@ -242,6 +279,7 @@ public class ShenyuConfig { + * @param matchCache the match cache + */ + public void setMatchCache(final MatchCache matchCache) { ++ LOG.warn("[CTEST][SET-PARAM] matchCache" + getStackTrace()); + this.matchCache = matchCache; + } + +@@ -251,6 +289,7 @@ public class ShenyuConfig { + * @return the file + */ + public FileConfig getFile() { ++ LOG.warn("[CTEST][GET-PARAM] file" + getStackTrace()); + return file; + } + +@@ -260,6 +299,7 @@ public class ShenyuConfig { + * @param file the file + */ + public void setFile(final FileConfig file) { ++ LOG.warn("[CTEST][SET-PARAM] file" + getStackTrace()); + this.file = file; + } + +@@ -269,6 +309,7 @@ public class ShenyuConfig { + * @return the exclude + */ + public ExcludePath getExclude() { ++ LOG.warn("[CTEST][GET-PARAM] exclude" + getStackTrace()); + return exclude; + } + +@@ -278,6 +319,7 @@ public class ShenyuConfig { + * @param exclude the exclude + */ + public void setExclude(final ExcludePath exclude) { ++ LOG.warn("[CTEST][SET-PARAM] exclude" + getStackTrace()); + this.exclude = exclude; + } + +@@ -287,6 +329,7 @@ public class ShenyuConfig { + * @return the fallback + */ + public FallbackPath getFallback() { ++ LOG.warn("[CTEST][GET-PARAM] fallback" + getStackTrace()); + return fallback; + } + +@@ -296,6 +339,7 @@ public class ShenyuConfig { + * @param fallback the fallback + */ + public void setFallback(final FallbackPath fallback) { ++ LOG.warn("[CTEST][SET-PARAM] fallback" + getStackTrace()); + this.fallback = fallback; + } + +@@ -305,6 +349,7 @@ public class ShenyuConfig { + * @return the upstream check + */ + public UpstreamCheck getUpstreamCheck() { ++ LOG.warn("[CTEST][GET-PARAM] upstreamcheck" + getStackTrace()); + return upstreamCheck; + } + +@@ -314,6 +359,7 @@ public class ShenyuConfig { + * @param upstreamCheck the upstream check + */ + public void setUpstreamCheck(final UpstreamCheck upstreamCheck) { ++ LOG.warn("[CTEST][SET-PARAM] upstreamCheck" + getStackTrace()); + this.upstreamCheck = upstreamCheck; + } + +@@ -323,6 +369,7 @@ public class ShenyuConfig { + * @return the cross + */ + public CrossFilterConfig getCross() { ++ LOG.warn("[CTEST][GET-PARAM] cross" + getStackTrace()); + return cross; + } + +@@ -332,6 +379,7 @@ public class ShenyuConfig { + * @return the websocket config + */ + public WebsocketConfig getWebsocket() { ++ LOG.warn("[CTEST][GET-PARAM] websocket" + getStackTrace()); + return websocket; + } + +@@ -341,6 +389,7 @@ public class ShenyuConfig { + * @param websocket the websocket config + */ + public void setWebsocket(final WebsocketConfig websocket) { ++ LOG.warn("[CTEST][SET-PARAM] websocket" + getStackTrace()); + this.websocket = websocket; + } + +@@ -350,6 +399,7 @@ public class ShenyuConfig { + * @param cross the cross + */ + public void setCross(final CrossFilterConfig cross) { ++ LOG.warn("[CTEST][SET-PARAM] cross" + getStackTrace()); + this.cross = cross; + } + +@@ -370,6 +420,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] Scheduler.enabled" + getStackTrace()); + return enabled; + } + +@@ -379,6 +430,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] Scheduler.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -388,6 +440,7 @@ public class ShenyuConfig { + * @return the type + */ + public String getType() { ++ LOG.warn("[CTEST][GET-PARAM] Scheduler.type" + getStackTrace()); + return type; + } + +@@ -397,6 +450,7 @@ public class ShenyuConfig { + * @param type the type + */ + public void setType(final String type) { ++ LOG.warn("[CTEST][SET-PARAM] Scheduler.type" + getStackTrace()); + this.type = type; + } + +@@ -406,6 +460,7 @@ public class ShenyuConfig { + * @return the threads + */ + public Integer getThreads() { ++ LOG.warn("[CTEST][GET-PARAM] Scheduler.threads" + getStackTrace()); + return threads; + } + +@@ -415,6 +470,7 @@ public class ShenyuConfig { + * @param threads the threads + */ + public void setThreads(final Integer threads) { ++ LOG.warn("[CTEST][SET-PARAM] Scheduler.threads" + getStackTrace()); + this.threads = threads; + } + +@@ -441,6 +497,7 @@ public class ShenyuConfig { + * @return the path + */ + public String getPath() { ++ LOG.warn("[CTEST][GET-PARAM] ExtPlugin.path" + getStackTrace()); + return path; + } + +@@ -450,6 +507,7 @@ public class ShenyuConfig { + * @param path the path + */ + public void setPath(final String path) { ++ LOG.warn("[CTEST][SET-PARAM] ExtPlugin.path" + getStackTrace()); + this.path = path; + } + +@@ -459,6 +517,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] ExtPlugin.enabled" + getStackTrace()); + return enabled; + } + +@@ -468,6 +527,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] ExtPlugin.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -477,6 +537,7 @@ public class ShenyuConfig { + * @return the threads + */ + public Integer getThreads() { ++ LOG.warn("[CTEST][GET-PARAM] ExtPlugin.threads" + getStackTrace()); + return threads; + } + +@@ -486,6 +547,7 @@ public class ShenyuConfig { + * @param threads the threads + */ + public void setThreads(final Integer threads) { ++ LOG.warn("[CTEST][SET-PARAM] ExtPlugin.threads" + getStackTrace()); + this.threads = threads; + } + +@@ -495,6 +557,7 @@ public class ShenyuConfig { + * @return the schedule time + */ + public Integer getScheduleTime() { ++ LOG.warn("[CTEST][GET-PARAM] ExtPlugin.scheduleTime" + getStackTrace()); + return scheduleTime; + } + +@@ -504,6 +567,7 @@ public class ShenyuConfig { + * @param scheduleTime the schedule time + */ + public void setScheduleTime(final Integer scheduleTime) { ++ LOG.warn("[CTEST][SET-PARAM] ExtPlugin.scheduleTime" + getStackTrace()); + this.scheduleTime = scheduleTime; + } + +@@ -513,6 +577,7 @@ public class ShenyuConfig { + * @return the schedule delay + */ + public Integer getScheduleDelay() { ++ LOG.warn("[CTEST][GET-PARAM] ExtPlugin.scheduleDelay" + getStackTrace()); + return scheduleDelay; + } + +@@ -522,6 +587,7 @@ public class ShenyuConfig { + * @param scheduleDelay the schedule delay + */ + public void setScheduleDelay(final Integer scheduleDelay) { ++ LOG.warn("[CTEST][SET-PARAM] ExtPlugin.scheduleDelay" + getStackTrace()); + this.scheduleDelay = scheduleDelay; + } + } +@@ -544,6 +610,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] MatchCache.enabled" + getStackTrace()); + return enabled; + } + +@@ -553,6 +620,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] MatchCache.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -562,6 +630,7 @@ public class ShenyuConfig { + * @return the maxFreeMemory + */ + public Integer getMaxFreeMemory() { ++ LOG.warn("[CTEST][GET-PARAM] MatchCache.maxFreeMemory" + getStackTrace()); + return maxFreeMemory; + } + +@@ -571,6 +640,7 @@ public class ShenyuConfig { + * @param maxFreeMemory the maxFreeMemory + */ + public void setMaxFreeMemory(final Integer maxFreeMemory) { ++ LOG.warn("[CTEST][SET-PARAM] MatchCache.maxFreeMemory" + getStackTrace()); + this.maxFreeMemory = maxFreeMemory; + } + } +@@ -590,6 +660,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] ExcludePath.enabled" + getStackTrace()); + return enabled; + } + +@@ -599,6 +670,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] ExcludePath.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -608,6 +680,7 @@ public class ShenyuConfig { + * @param paths the paths + */ + public void setPaths(final List paths) { ++ LOG.warn("[CTEST][SET-PARAM] ExcludePath.paths" + getStackTrace()); + this.paths = paths; + } + +@@ -617,6 +690,7 @@ public class ShenyuConfig { + * @return paths paths + */ + public List getPaths() { ++ LOG.warn("[CTEST][GET-PARAM] ExcludePath.paths" + getStackTrace()); + return paths; + } + } +@@ -636,6 +710,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] FallbackPath.enabled" + getStackTrace()); + return enabled; + } + +@@ -645,6 +720,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] FallbackPath.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -654,6 +730,7 @@ public class ShenyuConfig { + * @param paths the paths + */ + public void setPaths(final List paths) { ++ LOG.warn("[CTEST][SET-PARAM] FallbackPath.paths" + getStackTrace()); + this.paths = paths; + } + +@@ -663,6 +740,7 @@ public class ShenyuConfig { + * @return paths paths + */ + public List getPaths() { ++ LOG.warn("[CTEST][GET-PARAM] FallbackPath.paths" + getStackTrace()); + return paths; + } + } +@@ -682,6 +760,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] Health.enabled" + getStackTrace()); + return enabled; + } + +@@ -691,6 +770,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] Health.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -700,6 +780,7 @@ public class ShenyuConfig { + * @param paths the paths + */ + public void setPaths(final List paths) { ++ LOG.warn("[CTEST][SET-PARAM] Health.paths" + getStackTrace()); + this.paths = paths; + } + +@@ -709,6 +790,7 @@ public class ShenyuConfig { + * @return paths paths + */ + public List getPaths() { ++ LOG.warn("[CTEST][GET-PARAM] Health.paths" + getStackTrace()); + return paths; + } + } +@@ -728,6 +810,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] FileConfig.enabled" + getStackTrace()); + return enabled; + } + +@@ -737,6 +820,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] FileConfig.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -746,6 +830,7 @@ public class ShenyuConfig { + * @return the file max size + */ + public Integer getMaxSize() { ++ LOG.warn("[CTEST][GET-PARAM] FileConfig.maxSize" + getStackTrace()); + return maxSize; + } + +@@ -755,6 +840,7 @@ public class ShenyuConfig { + * @param maxSize the file max size + */ + public void setMaxSize(final Integer maxSize) { ++ LOG.warn("[CTEST][SET-PARAM] FileConfig.maxsize" + getStackTrace()); + this.maxSize = maxSize; + } + } +@@ -772,6 +858,7 @@ public class ShenyuConfig { + * @return the local + */ + public boolean getLocal() { ++ LOG.warn("[CTEST][GET-PARAM] SwitchConfig.local" + getStackTrace()); + return local; + } + +@@ -781,6 +868,7 @@ public class ShenyuConfig { + * @param local the local + */ + public void setLocal(final boolean local) { ++ LOG.warn("[CTEST][SET-PARAM] SwitchConfig.local" + getStackTrace()); + this.local = local; + } + +@@ -811,6 +899,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.enabled" + getStackTrace()); + return enabled; + } + +@@ -820,6 +909,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -829,6 +919,7 @@ public class ShenyuConfig { + * @return the timeout + */ + public Integer getTimeout() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.timeout" + getStackTrace()); + return timeout; + } + +@@ -838,6 +929,7 @@ public class ShenyuConfig { + * @param timeout the timeout + */ + public void setTimeout(final Integer timeout) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.timeout" + getStackTrace()); + this.timeout = timeout; + } + +@@ -847,6 +939,7 @@ public class ShenyuConfig { + * @return the healthy threshold + */ + public Integer getHealthyThreshold() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.healthyThreshold" + getStackTrace()); + return healthyThreshold; + } + +@@ -856,6 +949,7 @@ public class ShenyuConfig { + * @param healthyThreshold the healthy threshold + */ + public void setHealthyThreshold(final Integer healthyThreshold) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.healthyThreshold" + getStackTrace()); + this.healthyThreshold = healthyThreshold; + } + +@@ -865,6 +959,7 @@ public class ShenyuConfig { + * @return the unhealthy threshold + */ + public Integer getUnhealthyThreshold() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.unhealthyThreshold" + getStackTrace()); + return unhealthyThreshold; + } + +@@ -874,6 +969,7 @@ public class ShenyuConfig { + * @param unhealthyThreshold the unhealthy threshold + */ + public void setUnhealthyThreshold(final Integer unhealthyThreshold) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.unhealthyThreshold" + getStackTrace()); + this.unhealthyThreshold = unhealthyThreshold; + } + +@@ -883,6 +979,7 @@ public class ShenyuConfig { + * @return the interval + */ + public Integer getInterval() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.interval" + getStackTrace()); + return interval; + } + +@@ -892,6 +989,7 @@ public class ShenyuConfig { + * @param interval the interval + */ + public void setInterval(final Integer interval) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.interval" + getStackTrace()); + this.interval = interval; + } + +@@ -901,6 +999,7 @@ public class ShenyuConfig { + * @return the print enabled + */ + public boolean getPrintEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.printEnabled" + getStackTrace()); + return printEnabled; + } + +@@ -910,6 +1009,7 @@ public class ShenyuConfig { + * @param printEnabled the print enabled + */ + public void setPrintEnabled(final boolean printEnabled) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.printEnabled" + getStackTrace()); + this.printEnabled = printEnabled; + } + +@@ -919,6 +1019,7 @@ public class ShenyuConfig { + * @return the print interval + */ + public Integer getPrintInterval() { ++ LOG.warn("[CTEST][GET-PARAM] UpstreamCheck.printInterval" + getStackTrace()); + return printInterval; + } + +@@ -928,6 +1029,7 @@ public class ShenyuConfig { + * @param printInterval the print interval + */ + public void setPrintInterval(final Integer printInterval) { ++ LOG.warn("[CTEST][SET-PARAM] UpstreamCheck.printInterval" + getStackTrace()); + this.printInterval = printInterval; + } + } +@@ -958,12 +1060,12 @@ public class ShenyuConfig { + private boolean enabled; + + /** +- * Comma-separated of “header”. ++ * Comma-separated of ��header��. + */ + private String allowedHeaders = ""; + + /** +- * Comma-separated of “method”. ++ * Comma-separated of ��method��. + */ + private String allowedMethods = "*"; + +@@ -997,6 +1099,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.enabled" + getStackTrace()); + return enabled; + } + +@@ -1006,6 +1109,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -1015,6 +1119,7 @@ public class ShenyuConfig { + * @return the value of allowedHeaders + */ + public String getAllowedHeaders() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.allowedHeaders" + getStackTrace()); + return allowedHeaders = wrapperHeaders(allowedHeaders); + } + +@@ -1024,6 +1129,7 @@ public class ShenyuConfig { + * @param allowedHeaders allowedHeaders + */ + public void setAllowedHeaders(final String allowedHeaders) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowedHeaders" + getStackTrace()); + this.allowedHeaders = wrapperHeaders(allowedHeaders); + } + +@@ -1033,6 +1139,7 @@ public class ShenyuConfig { + * @return the value of allowedMethods + */ + public String getAllowedMethods() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.allowedMethods" + getStackTrace()); + return allowedMethods; + } + +@@ -1042,6 +1149,7 @@ public class ShenyuConfig { + * @param allowedMethods allowedMethods + */ + public void setAllowedMethods(final String allowedMethods) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowedMethods" + getStackTrace()); + this.allowedMethods = allowedMethods; + } + +@@ -1051,6 +1159,7 @@ public class ShenyuConfig { + * @return the value of allowedOrigin + */ + public AllowedOriginConfig getAllowedOrigin() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.allowedOrigin" + getStackTrace()); + return allowedOrigin; + } + +@@ -1060,6 +1169,7 @@ public class ShenyuConfig { + * @param allowedOrigin allowedOrigin + */ + public void setAllowedOrigin(final AllowedOriginConfig allowedOrigin) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowedOrigin" + getStackTrace()); + this.allowedOrigin = allowedOrigin; + } + +@@ -1069,6 +1179,7 @@ public class ShenyuConfig { + * @return the value of allowedAnyOrigin + */ + public boolean isAllowedAnyOrigin() { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowedAnyOrigin" + getStackTrace()); + return allowedAnyOrigin; + } + +@@ -1078,6 +1189,7 @@ public class ShenyuConfig { + * @param allowedAnyOrigin allowedExpose + */ + public void setAllowedAnyOrigin(final boolean allowedAnyOrigin) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowedAnyOrigin" + getStackTrace()); + this.allowedAnyOrigin = allowedAnyOrigin; + } + +@@ -1087,6 +1199,7 @@ public class ShenyuConfig { + * @return the value of allowedExpose + */ + public String getAllowedExpose() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.allowedExpose" + getStackTrace()); + return allowedExpose; + } + +@@ -1096,6 +1209,7 @@ public class ShenyuConfig { + * @param allowedExpose allowedExpose + */ + public void setAllowedExpose(final String allowedExpose) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowedExpose" + getStackTrace()); + this.allowedExpose = allowedExpose; + } + +@@ -1105,6 +1219,7 @@ public class ShenyuConfig { + * @return the value of maxAge + */ + public String getMaxAge() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.maxAge" + getStackTrace()); + return maxAge; + } + +@@ -1114,6 +1229,7 @@ public class ShenyuConfig { + * @param maxAge maxAge + */ + public void setMaxAge(final String maxAge) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.maxAge" + getStackTrace()); + this.maxAge = maxAge; + } + +@@ -1123,6 +1239,7 @@ public class ShenyuConfig { + * @return the value of allowCredentials + */ + public boolean isAllowCredentials() { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowCredentials" + getStackTrace()); + return allowCredentials; + } + +@@ -1132,6 +1249,7 @@ public class ShenyuConfig { + * @param allowCredentials allowCredentials + */ + public void setAllowCredentials(final boolean allowCredentials) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.allowCredentials" + getStackTrace()); + this.allowCredentials = allowCredentials; + } + +@@ -1156,6 +1274,7 @@ public class ShenyuConfig { + * @return the value of spacer + */ + public String getSpacer() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.AllowedOriginConfig.spacer" + getStackTrace()); + return spacer; + } + +@@ -1165,6 +1284,7 @@ public class ShenyuConfig { + * @param spacer spacer + */ + public void setSpacer(final String spacer) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.AllowedOriginConfig.spacer" + getStackTrace()); + this.spacer = spacer; + } + +@@ -1174,6 +1294,7 @@ public class ShenyuConfig { + * @return the value of domain + */ + public String getDomain() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.AllowedOriginConfig.domain" + getStackTrace()); + return domain; + } + +@@ -1183,6 +1304,7 @@ public class ShenyuConfig { + * @param domain domain + */ + public void setDomain(final String domain) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.AllowedOriginConfig.domain" + getStackTrace()); + this.domain = domain; + } + +@@ -1192,6 +1314,7 @@ public class ShenyuConfig { + * @return the value of prefixes + */ + public Set getPrefixes() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.AllowedOriginConfig.prefixes" + getStackTrace()); + return prefixes; + } + +@@ -1201,6 +1324,7 @@ public class ShenyuConfig { + * @param prefixes prefixes + */ + public void setPrefixes(final Set prefixes) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.AllowedOriginConfig.prefixes" + getStackTrace()); + this.prefixes = prefixes; + } + +@@ -1210,6 +1334,7 @@ public class ShenyuConfig { + * @return the value of prefixes + */ + public Set getOrigins() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.AllowedOriginConfig.origins" + getStackTrace()); + return origins; + } + +@@ -1219,6 +1344,7 @@ public class ShenyuConfig { + * @param origins origins + */ + public void setOrigins(final Set origins) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.AllowedOriginConfig.origins" + getStackTrace()); + this.origins = origins; + } + +@@ -1228,6 +1354,7 @@ public class ShenyuConfig { + * @return the value of originRegex + */ + public String getOriginRegex() { ++ LOG.warn("[CTEST][GET-PARAM] CrossFilterConfig.AllowedOriginConfig.originRegex" + getStackTrace()); + return originRegex; + } + +@@ -1237,6 +1364,7 @@ public class ShenyuConfig { + * @param originRegex originRegex + */ + public void setOriginRegex(final String originRegex) { ++ LOG.warn("[CTEST][SET-PARAM] CrossFilterConfig.AllowedOriginConfig.originRegex" + getStackTrace()); + this.originRegex = originRegex; + } + } +@@ -1281,6 +1409,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] InstanceConfig.enabled" + getStackTrace()); + return enabled; + } + +@@ -1290,6 +1419,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] InstanceConfig.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -1299,6 +1429,7 @@ public class ShenyuConfig { + * @return String register type + */ + public String getRegisterType() { ++ LOG.warn("[CTEST][GET-PARAM] InstanceConfig.registerType" + getStackTrace()); + return registerType; + } + +@@ -1308,6 +1439,7 @@ public class ShenyuConfig { + * @param registerType registerType + */ + public void setRegisterType(final String registerType) { ++ LOG.warn("[CTEST][SET-PARAM] InstanceConfig.registerType" + getStackTrace()); + this.registerType = registerType; + } + +@@ -1317,6 +1449,7 @@ public class ShenyuConfig { + * @return String server lists + */ + public String getServerLists() { ++ LOG.warn("[CTEST][GET-PARAM] InstanceConfig.serverLists" + getStackTrace()); + return serverLists; + } + +@@ -1326,6 +1459,7 @@ public class ShenyuConfig { + * @param serverLists serverLists + */ + public void setServerLists(final String serverLists) { ++ LOG.warn("[CTEST][SET-PARAM] InstanceConfig.serverLists" + getStackTrace()); + this.serverLists = serverLists; + } + +@@ -1335,6 +1469,7 @@ public class ShenyuConfig { + * @return String props + */ + public Properties getProps() { ++ LOG.warn("[CTEST][GET-PARAM] InstanceConfig.props" + getStackTrace()); + return props; + } + +@@ -1344,6 +1479,7 @@ public class ShenyuConfig { + * @param props props + */ + public void setProps(final Properties props) { ++ LOG.warn("[CTEST][SET-PARAM] InstanceConfig.props" + getStackTrace()); + this.props = props; + } + } +@@ -1379,6 +1515,7 @@ public class ShenyuConfig { + * @return the serverListRefreshInterval + */ + public Integer getServerListRefreshInterval() { ++ LOG.warn("[CTEST][GET-PARAM] RibbonConfig.serverListRefreshInterval" + getStackTrace()); + return serverListRefreshInterval; + } + +@@ -1388,6 +1525,7 @@ public class ShenyuConfig { + * @param serverListRefreshInterval serverListRefreshInterval + */ + public void setServerListRefreshInterval(final Integer serverListRefreshInterval) { ++ LOG.warn("[CTEST][SET-PARAM] RibbonConfig.serverListRefreshInterval" + getStackTrace()); + this.serverListRefreshInterval = serverListRefreshInterval; + } + } +@@ -1422,6 +1560,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] Local.enabled" + getStackTrace()); + return enabled; + } + +@@ -1431,6 +1570,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] Local.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -1440,6 +1580,7 @@ public class ShenyuConfig { + * @return the key + */ + public String getSha512Key() { ++ LOG.warn("[CTEST][GET-PARAM] Local.sha512Key" + getStackTrace()); + return sha512Key; + } + +@@ -1449,6 +1590,7 @@ public class ShenyuConfig { + * @param sha512Key sha512Key + */ + public void setSha512Key(final String sha512Key) { ++ LOG.warn("[CTEST][SET-PARAM] Local.sha512Key" + getStackTrace()); + this.sha512Key = sha512Key; + } + } +@@ -1469,6 +1611,7 @@ public class ShenyuConfig { + * @return the max frame payload szie + */ + public Integer getMaxFramePayloadSize() { ++ LOG.warn("[CTEST][GET-PARAM] WebsocketConfig.maxFramePayloadSize" + getStackTrace()); + return maxFramePayloadSize; + } + +@@ -1478,6 +1621,7 @@ public class ShenyuConfig { + * @param maxFramePayloadSize the max frame paylod size + */ + public void setMaxFramePayloadSize(final Integer maxFramePayloadSize) { ++ LOG.warn("[CTEST][SET-PARAM] WebsocketConfig.maxFramePayloadSize" + getStackTrace()); + this.maxFramePayloadSize = maxFramePayloadSize; + } + } +@@ -1540,6 +1684,7 @@ public class ShenyuConfig { + * @return whether to enable + */ + public Boolean getEnable() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.enable" + getStackTrace()); + return enable; + } + +@@ -1549,6 +1694,7 @@ public class ShenyuConfig { + * @param enable the enable + */ + public void setEnable(final Boolean enable) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.enable" + getStackTrace()); + this.enable = enable; + } + +@@ -1558,6 +1704,7 @@ public class ShenyuConfig { + * @return the shared thread pool name prefix + */ + public String getPrefix() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.prefix" + getStackTrace()); + return prefix; + } + +@@ -1567,6 +1714,7 @@ public class ShenyuConfig { + * @param prefix the prefix + */ + public void setPrefix(final String prefix) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.prefix" + getStackTrace()); + this.prefix = prefix; + } + +@@ -1576,6 +1724,7 @@ public class ShenyuConfig { + * @return the shared thread pool core size + */ + public Integer getCorePoolSize() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.corePoolSize" + getStackTrace()); + return corePoolSize; + } + +@@ -1585,6 +1734,7 @@ public class ShenyuConfig { + * @param corePoolSize the core pool size + */ + public void setCorePoolSize(final Integer corePoolSize) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.corePoolSize" + getStackTrace()); + this.corePoolSize = corePoolSize; + } + +@@ -1594,6 +1744,7 @@ public class ShenyuConfig { + * @return the shared thread pool name prefix + */ + public Integer getMaximumPoolSize() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.maximumPoolSize" + getStackTrace()); + return maximumPoolSize; + } + +@@ -1603,6 +1754,7 @@ public class ShenyuConfig { + * @param maximumPoolSize the max pool size + */ + public void setMaximumPoolSize(final Integer maximumPoolSize) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.maximumPoolSize" + getStackTrace()); + this.maximumPoolSize = maximumPoolSize; + } + +@@ -1612,6 +1764,7 @@ public class ShenyuConfig { + * @return the shared thread pool keep alive time + */ + public Long getKeepAliveTime() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.keepAliveTime" + getStackTrace()); + return keepAliveTime; + } + +@@ -1621,6 +1774,7 @@ public class ShenyuConfig { + * @param keepAliveTime the keep alive time + */ + public void setKeepAliveTime(final Long keepAliveTime) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.keepAliveTime" + getStackTrace()); + this.keepAliveTime = keepAliveTime; + } + +@@ -1630,6 +1784,7 @@ public class ShenyuConfig { + * @return the shared thread pool max work queue memory + */ + public Long getMaxWorkQueueMemory() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.maxWorkQueueMemory" + getStackTrace()); + return maxWorkQueueMemory; + } + +@@ -1639,6 +1794,7 @@ public class ShenyuConfig { + * @param maxWorkQueueMemory the max work queue memory + */ + public void setMaxWorkQueueMemory(final Long maxWorkQueueMemory) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.maxWorkQueueMemory" + getStackTrace()); + this.maxWorkQueueMemory = maxWorkQueueMemory; + } + +@@ -1648,6 +1804,7 @@ public class ShenyuConfig { + * @return the shared thread pool max work queue free memory + */ + public Integer getMaxFreeMemory() { ++ LOG.warn("[CTEST][GET-PARAM] SharedPool.maxFreeMemory" + getStackTrace()); + return maxFreeMemory; + } + +@@ -1657,6 +1814,7 @@ public class ShenyuConfig { + * @param maxFreeMemory the max work queue free memory + */ + public void setMaxFreeMemory(final Integer maxFreeMemory) { ++ LOG.warn("[CTEST][SET-PARAM] SharedPool.maxFreeMemory" + getStackTrace()); + this.maxFreeMemory = maxFreeMemory; + } + } +@@ -1690,6 +1848,7 @@ public class ShenyuConfig { + * @return the enabled + */ + public boolean getEnabled() { ++ LOG.warn("[CTEST][GET-PARAM] MetricsConfig.enabled" + getStackTrace()); + return enabled; + } + +@@ -1699,6 +1858,7 @@ public class ShenyuConfig { + * @param enabled the enabled + */ + public void setEnabled(final boolean enabled) { ++ LOG.warn("[CTEST][SET-PARAM] MetricsConfig.enabled" + getStackTrace()); + this.enabled = enabled; + } + +@@ -1708,6 +1868,7 @@ public class ShenyuConfig { + * @return the metrics name + */ + public String getName() { ++ LOG.warn("[CTEST][GET-PARAM] MetricsConfig.name" + getStackTrace()); + return name; + } + +@@ -1717,6 +1878,7 @@ public class ShenyuConfig { + * @param name the metrics name + */ + public void setName(final String name) { ++ LOG.warn("[CTEST][SET-PARAM] MetricsConfig.name" + getStackTrace()); + this.name = name; + } + +@@ -1726,6 +1888,7 @@ public class ShenyuConfig { + * @return the host + */ + public String getHost() { ++ LOG.warn("[CTEST][GET-PARAM] MetricsConfig.host" + getStackTrace()); + return host; + } + +@@ -1735,6 +1898,7 @@ public class ShenyuConfig { + * @param host the host + */ + public void setHost(final String host) { ++ LOG.warn("[CTEST][SET-PARAM] MetricsConfig.host" + getStackTrace()); + this.host = host; + } + +@@ -1744,6 +1908,7 @@ public class ShenyuConfig { + * @return the port + */ + public Integer getPort() { ++ LOG.warn("[CTEST][GET-PARAM] MetricsConfig.port" + getStackTrace()); + return port; + } + +@@ -1753,6 +1918,7 @@ public class ShenyuConfig { + * @param port the port + */ + public void setPort(final Integer port) { ++ LOG.warn("[CTEST][SET-PARAM] MetricsConfig.port" + getStackTrace()); + this.port = port; + } + +@@ -1762,6 +1928,7 @@ public class ShenyuConfig { + * @return the jmx config + */ + public String getJmxConfig() { ++ LOG.warn("[CTEST][GET-PARAM] MetricsConfig.jmxConfig" + getStackTrace()); + return jmxConfig; + } + +@@ -1771,6 +1938,7 @@ public class ShenyuConfig { + * @param jmxConfig the jmx config + */ + public void setJmxConfig(final String jmxConfig) { ++ LOG.warn("[CTEST][SET-PARAM] MetricsConfig.jmxConfig" + getStackTrace()); + this.jmxConfig = jmxConfig; + } + +@@ -1780,6 +1948,7 @@ public class ShenyuConfig { + * @return the props + */ + public Properties getProps() { ++ LOG.warn("[CTEST][GET-PARAM] MetricsConfig.props" + getStackTrace()); + return props; + } + +@@ -1789,6 +1958,7 @@ public class ShenyuConfig { + * @param props the props + */ + public void setProps(final Properties props) { ++ LOG.warn("[CTEST][SET-PARAM] MetricsConfig.props" + getStackTrace()); + this.props = props; + } + } +-- +2.25.1 + diff --git a/core/run_ctest/inject.py b/core/run_ctest/inject.py index 75f5b443..53aa0790 100644 --- a/core/run_ctest/inject.py +++ b/core/run_ctest/inject.py @@ -14,7 +14,7 @@ def inject_config(param_value_pairs): for p, v in param_value_pairs.items(): print(">>>>[ctest_core] injecting {} with value {}".format(p, v)) - if project in [ZOOKEEPER, ALLUXIO]: + if project in [ZOOKEEPER, ALLUXIO, SYCOMMON]: for inject_path in INJECTION_PATH[project]: print(">>>>[ctest_core] injecting into file: {}".format(inject_path)) file = open(inject_path, "w") @@ -41,7 +41,7 @@ def inject_config(param_value_pairs): def clean_conf_file(project): print(">>>> cleaning injected configuration from file") - if project in [ZOOKEEPER, ALLUXIO]: + if project in [ZOOKEEPER, ALLUXIO, SYCOMMON]: for inject_path in INJECTION_PATH[project]: file = open(inject_path, "w") file.write("\n") diff --git a/core/run_ctest/parse_input.py b/core/run_ctest/parse_input.py index 5b4bedbf..0a07f5f5 100644 --- a/core/run_ctest/parse_input.py +++ b/core/run_ctest/parse_input.py @@ -41,6 +41,8 @@ def parse_conf_file(path): """parse config file""" if project in [HCOMMON, HDFS, HBASE]: return parse_conf_file_xml(path) + elif project in [SYCOMMON]: + return load_default_conf(path) else: # parsing for alluxio and zookeeper conf file format if "no default configuration file" in path: @@ -94,6 +96,7 @@ def extract_conf_diff(path): """get the config diff""" default_conf_map = load_default_conf(DEFAULT_CONF_FILE[project]) new_conf_map = parse_conf_file(path) + print(new_conf_map) print(">>>>[ctest_core] default conf file: {}".format(DEFAULT_CONF_FILE[project])) print(">>>>[ctest_core] new input conf file: {} (param, value) pairs".format(len(new_conf_map.keys()))) conf_diff = {} diff --git a/core/run_ctest/program_input.py b/core/run_ctest/program_input.py index 2b971f1c..169f9657 100644 --- a/core/run_ctest/program_input.py +++ b/core/run_ctest/program_input.py @@ -3,12 +3,12 @@ p_input = { # run mode "run_mode": "run_ctest", # string - # name of the project, i.e. hadoop-common, hadoop-hdfs - "project": "hadoop-common", # string + # name of the project, i.e. hadoop-common, hadoop-hdfs, see constant.py + "project": "shenyu-common", # string # path to param -> tests json mapping - "mapping_path": "../../data/ctest_mapping/opensource-hadoop-common.json", # string + "mapping_path": "../../data/ctest_mapping/opensource-shenyu-common.json", # string # input directory hosting configuration files to be test, target-project-format specific - "conf_file_dir": "sample-hadoop-common", # string + "conf_file_dir": "sample-shenyu-common", # string # display the terminal output live, without saving any results "display_mode": False, # bool # whether to use mvn test or mvn surefire:test diff --git a/core/run_ctest/sample-shenyu-common/sample-shenyu-common.tsv b/core/run_ctest/sample-shenyu-common/sample-shenyu-common.tsv new file mode 100644 index 00000000..f5d06839 --- /dev/null +++ b/core/run_ctest/sample-shenyu-common/sample-shenyu-common.tsv @@ -0,0 +1 @@ +ExtPlugin.scheduletime null . \ No newline at end of file diff --git a/data/ctest_mapping/opensource-shenyu-common.json b/data/ctest_mapping/opensource-shenyu-common.json new file mode 100644 index 00000000..c7b8abe0 --- /dev/null +++ b/data/ctest_mapping/opensource-shenyu-common.json @@ -0,0 +1,63 @@ +{ + "metrics": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testMetricsConfig" + ], + "instance": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testInstanceConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig" + ], + "local": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testLocal", + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testRibbonConfig" + ], + "fallback": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testFallbackPath", + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig" + ], + "extPlugin": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin" + ], + "ExtPlugin.scheduleTime": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testExtPlugin" + ], + "cross": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig" + ], + "switchConfig": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testSwitchConfig" + ], + "exclude": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testExcludePath", + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig" + ], + "file": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig" + ], + "ribbon": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig" + ], + "scheduler": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testScheduler" + ], + "sharedPool": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testSharedPool", + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig" + ], + "websocket": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testShenyuConfig", + "org.apache.shenyu.common.config.ShenyuConfigTest#testWebsocketConfig" + ], + "CrossFilterConfig.allowedOrigin": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testCrossFilterConfig" + ], + "FileConfig.maxSize": [ + "org.apache.shenyu.common.config.ShenyuConfigTest#testFileConfig" + ] +} \ No newline at end of file