From 82be07d4846f29650bfdb2d946aa5f313991eb0a Mon Sep 17 00:00:00 2001 From: coderfengyun Date: Fri, 21 Mar 2014 16:11:45 +0800 Subject: [PATCH] add type info to Annotation @Parameter add type info to Annotation @Parameter --- .../forGoodRecord.xml | 2076 +++++++++++++++++ .../testJD.xml | 66 + .../org/bench4q/agent/plugin/Parameter.java | 4 + .../agent/plugin/basic/CommandLinePlugin.java | 4 +- .../plugin/basic/ConstantTimerPlugin.java | 4 +- .../bench4q/agent/plugin/basic/LogPlugin.java | 4 +- .../agent/plugin/basic/http/HttpPlugin.java | 45 +- .../org/bench4q/agent/scenario/util/Type.java | 3 + .../agent/scenario/util/types/CheckBox.java | 5 + .../agent/scenario/util/types/NField.java | 5 + .../agent/scenario/util/types/Radio.java | 5 + 11 files changed, 2198 insertions(+), 23 deletions(-) create mode 100644 Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/forGoodRecord.xml create mode 100644 Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/testJD.xml create mode 100644 Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/CheckBox.java create mode 100644 Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/NField.java create mode 100644 Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/Radio.java diff --git a/Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/forGoodRecord.xml b/Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/forGoodRecord.xml new file mode 100644 index 00000000..aeb6083b --- /dev/null +++ b/Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/forGoodRecord.xml @@ -0,0 +1,2076 @@ + + + + + + + + + 0 + Get + + + url + http://133.133.12.2:8080/bench4q-web/homepage.jsp + + + + queryParams + + + + headers + header=Accept|value= + text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|; + + + + USERBEHAVIOR + http + + + -1 + 0 + -1 + + + + + 0 + Sleep + + + time + 15 + + + TIMERBEHAVIOR + timer + + + -1 + 1 + -1 + + + + + 1 + Get + + + url + http://133.133.12.2:8080/bench4q-web/index.jsp + + + queryParams + + + + headers + header=Accept|value= + text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|; + + + + USERBEHAVIOR + http + + + 4 + 2 + -1 + + + + + 0 + Sleep + + + time + 133 + + + TIMERBEHAVIOR + timer + + + -1 + 3 + -1 + + + + + 2 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/bootstrap-cerulean.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + 3 + Get + + + url + http://133.133.12.2:8080/bench4q-web/script/login.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + 4 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/jquery-1.7.2.min.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + 5 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/jquery.i18n.properties-1.0.9.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + 6 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/charisma-app.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 4 + 2 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 5 + -1 + + + + + 0 + Sleep + + + time + 72 + + + TIMERBEHAVIOR + timer + + + -1 + 6 + -1 + + + + + 0 + Sleep + + + time + 24 + + + TIMERBEHAVIOR + timer + + + -1 + 7 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 8 + -1 + + + + + 0 + Sleep + + + time + 211 + + + TIMERBEHAVIOR + timer + + + -1 + 9 + -1 + + + + + 7 + Get + + + url + http://fonts.googleapis.com/css + + + queryParams + family=Karla|Ubuntu + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 10 + -1 + + + + + 0 + Sleep + + + time + 3 + + + TIMERBEHAVIOR + timer + + + -1 + 11 + -1 + + + + + 8 + Get + + + url + http://fonts.googleapis.com/css + + + queryParams + family=Shojumaru + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 12 + -1 + + + + + 0 + Sleep + + + time + 82 + + + TIMERBEHAVIOR + timer + + + -1 + 13 + -1 + + + + + 9 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/glyphicons-halflings.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 14 + -1 + + + + + 0 + Sleep + + + time + 2 + + + TIMERBEHAVIOR + timer + + + -1 + 15 + -1 + + + + + 10 + Get + + + url + http://133.133.12.2:8080/bench4q-web/i18n/i18n.properties + + + + queryParams + _=1389777175541 + + + headers + header=Content-Type|value=text/plain;charset=UTF-8|;header=Accept|value= + text/plain, */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 16 + -1 + + + + + 0 + Sleep + + + time + 10 + + + TIMERBEHAVIOR + timer + + + -1 + 17 + -1 + + + + + 11 + Get + + + url + http://133.133.12.2:8080/bench4q-web/i18n/i18n_zh.properties + + + + queryParams + _=1389777175572 + + + headers + header=Content-Type|value=text/plain;charset=UTF-8|;header=Accept|value= + text/plain, */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 18 + -1 + + + + + 0 + Sleep + + + time + 8 + + + TIMERBEHAVIOR + timer + + + -1 + 19 + -1 + + + + + 12 + Get + + + url + http://133.133.12.2:8080/bench4q-web/i18n/i18n_zh-CN.properties + + + + queryParams + _=1389777175587 + + + headers + header=Content-Type|value=text/plain;charset=UTF-8|;header=Accept|value= + text/plain, */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 20 + -1 + + + + + 0 + Sleep + + + time + 52 + + + TIMERBEHAVIOR + timer + + + -1 + 21 + -1 + + + + + 13 + Get + + + url + http://themes.googleusercontent.com/static/fonts/karla/v3/azR40LUJrT4HaWK28zHmVA.woff + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 22 + -1 + + + + + 0 + Sleep + + + time + 16442 + + + TIMERBEHAVIOR + timer + + + -1 + 23 + -1 + + + + + 14 + Get + + + url + http://themes.googleusercontent.com/static/fonts/ubuntu/v5/_xyN3apAT_yRRDeqB3sPRg.woff + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 24 + -1 + + + + + + + + + 0 + Sleep + + + time + 9 + + + TIMERBEHAVIOR + timer + + + 3 + 25 + -1 + + + + + 15 + Get + + + url + http://133.133.12.2:8080/bench4q-web/homepage.jsp + + + + queryParams + + + + headers + header=Accept|value= + text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 26 + -1 + + + + + 0 + Sleep + + + time + 25 + + + TIMERBEHAVIOR + timer + + + -1 + 27 + -1 + + + + + 16 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/bootstrap-responsive.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 17 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/noty_theme_default.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 18 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/jquery-1.8.2.min.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 19 + Get + + + url + http://133.133.12.2:8080/bench4q-web/bench4q-css/bench4q.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 20 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/jquery-ui-1.8.21.custom.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 21 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/opa-icons.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 22 + Get + + + url + http://133.133.12.2:8080/bench4q-web/css/colorbox.css + + + + queryParams + + + + headers + header=Accept|value= + text/css,*/*;q=0.1|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 23 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/jquery.cookie.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 24 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/jquery.dataTables.min.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 25 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/theme.js + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 26 + Get + + + url + http://133.133.12.2:8080/bench4q-web/script/base.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 27 + Get + + + url + http://133.133.12.2:8080/bench4q-web/script/bench4q.table.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 28 + Get + + + url + http://133.133.12.2:8080/bench4q-web/script/loadTestPlans.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 29 + Get + + + url + http://133.133.12.2:8080/bench4q-web/script/scriptTable.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 30 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/jquery-ui-1.8.21.custom.min.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 31 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/bench4q.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 32 + Get + + + url + http://133.133.12.2:8080/bench4q-web/js/bootstrap-dropdown.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + 36 + Get + + + url + http://133.133.12.2:8080/bench4q-web/script/home.js + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 28 + 0 + + + + + 0 + Sleep + + + time + 10 + + + TIMERBEHAVIOR + timer + + + -1 + 29 + -1 + + + + + 0 + Sleep + + + time + 25 + + + TIMERBEHAVIOR + timer + + + -1 + 30 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 31 + -1 + + + + + 0 + Sleep + + + time + 4 + + + TIMERBEHAVIOR + timer + + + -1 + 32 + -1 + + + + + 0 + Sleep + + + time + 4 + + + TIMERBEHAVIOR + timer + + + -1 + 33 + -1 + + + + + 0 + Sleep + + + time + 0 + + + TIMERBEHAVIOR + timer + + + -1 + 34 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 35 + -1 + + + + + 0 + Sleep + + + time + 6 + + + TIMERBEHAVIOR + timer + + + -1 + 36 + -1 + + + + + 0 + Sleep + + + time + 27 + + + TIMERBEHAVIOR + timer + + + -1 + 37 + -1 + + + + + 0 + Sleep + + + time + 9 + + + TIMERBEHAVIOR + timer + + + -1 + 38 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 39 + -1 + + + + + 0 + Sleep + + + time + 0 + + + TIMERBEHAVIOR + timer + + + -1 + 40 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 41 + -1 + + + + + 0 + Sleep + + + time + 36 + + + TIMERBEHAVIOR + timer + + + -1 + 42 + -1 + + + + + 0 + Sleep + + + time + 5 + + + TIMERBEHAVIOR + timer + + + -1 + 43 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 44 + -1 + + + + + 0 + Sleep + + + time + 75 + + + TIMERBEHAVIOR + timer + + + -1 + 45 + -1 + + + + + 33 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/opa-icons-blue32.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 46 + -1 + + + + + 0 + Sleep + + + time + 30 + + + TIMERBEHAVIOR + timer + + + -1 + 47 + -1 + + + + + 34 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/opa-icons-color32.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 48 + -1 + + + + + 0 + Sleep + + + time + 27 + + + TIMERBEHAVIOR + timer + + + -1 + 49 + -1 + + + + + 35 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/opa-icons-red32.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 50 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 51 + -1 + + + + + 0 + Sleep + + + time + 24 + + + TIMERBEHAVIOR + timer + + + -1 + 52 + -1 + + + + + 37 + Get + + + url + http://themes.googleusercontent.com/static/fonts/shojumaru/v2/pYVcIM206l3F7GUKEvtB3T8E0i7KZn-EPnyo3HZu7kw.woff + + + + queryParams + + + + headers + header=Accept|value= + */*|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/index.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 53 + -1 + + + + + 0 + Sleep + + + time + 145 + + + TIMERBEHAVIOR + timer + + + -1 + 54 + -1 + + + + + 38 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/opa-icons-green32.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 55 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 56 + -1 + + + + + 39 + Get + + + url + http://133.133.12.2:8080/bench4q-web/i18n/i18n.properties + + + + queryParams + _=1389777196041 + + + headers + header=Content-Type|value=text/plain;charset=UTF-8|;header=Accept|value= + text/plain, */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 57 + -1 + + + + + 0 + Sleep + + + time + 8 + + + TIMERBEHAVIOR + timer + + + -1 + 58 + -1 + + + + + 40 + Get + + + url + http://133.133.12.2:8080/bench4q-web/i18n/i18n_zh.properties + + + + queryParams + _=1389777196134 + + + headers + header=Content-Type|value=text/plain;charset=UTF-8|;header=Accept|value= + text/plain, */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 59 + -1 + + + + + 0 + Sleep + + + time + 7 + + + TIMERBEHAVIOR + timer + + + -1 + 60 + -1 + + + + + 41 + Get + + + url + http://133.133.12.2:8080/bench4q-web/i18n/i18n_zh-CN.properties + + + + queryParams + _=1389777196150 + + + headers + header=Content-Type|value=text/plain;charset=UTF-8|;header=Accept|value= + text/plain, */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 61 + -1 + + + + + 0 + Sleep + + + time + 163 + + + TIMERBEHAVIOR + timer + + + -1 + 62 + -1 + + + + + 42 + Post + + + url + http://133.133.12.2:8080/bench4q-web/loadTestPlans + + + + queryParams + + + + headers + header=Accept|value= application/json, text/javascript, + */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + bodyparameters + + + + USERBEHAVIOR + http + + + -1 + 63 + -1 + + + + + 0 + Sleep + + + time + 1 + + + TIMERBEHAVIOR + timer + + + -1 + 64 + -1 + + + + + 43 + Post + + + url + http://133.133.12.2:8080/bench4q-web/loadScript + + + queryParams + + + + headers + header=Accept|value= application/json, text/javascript, + */*; + q=0.01|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + bodyparameters + + + + USERBEHAVIOR + http + + + -1 + 65 + -1 + + + + + 0 + Sleep + + + time + 27 + + + TIMERBEHAVIOR + timer + + + -1 + 66 + -1 + + + + + 44 + Get + + + url + http://133.133.12.2:8080/bench4q-web/img/glyphicons-halflings-white.png + + + + queryParams + + + + headers + header=Accept|value= + image/webp,*/*;q=0.8|;header=Referer|value=http://133.133.12.2:8080/bench4q-web/homepage.jsp|; + + + + USERBEHAVIOR + http + + + -1 + 67 + -1 + + + + + 0 + + + http + Http + + + + timer + ConstantTimer + + + + \ No newline at end of file diff --git a/Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/testJD.xml b/Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/testJD.xml new file mode 100644 index 00000000..f8c2d673 --- /dev/null +++ b/Bench4Q-Agent/ScenarioParameters/8f29b33f-e3b9-4c90-9aa6-e126409ad382/testJD.xml @@ -0,0 +1,66 @@ + + + + + + + + + 0 + Get + + + url + + http://www.baidu.com + + + + parameters + + + + USERBEHAVIOR + http + + + 2 + 0 + -1 + + + + + 0 + Sleep + + + time + 230 + + + TIMERBEHAVIOR + timer + + + -1 + 1 + -1 + + + + + 0 + + + http + Http + + + + timer + ConstantTimer + + + + \ No newline at end of file diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/Parameter.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/Parameter.java index a9e0a171..caaa3769 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/Parameter.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/Parameter.java @@ -5,8 +5,12 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.bench4q.agent.scenario.util.Type.SupportTypes; + @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Parameter { String value(); + + SupportTypes type(); } diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/CommandLinePlugin.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/CommandLinePlugin.java index 97072a39..3c7e03e0 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/CommandLinePlugin.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/CommandLinePlugin.java @@ -7,6 +7,7 @@ import org.bench4q.agent.plugin.Behavior; import org.bench4q.agent.plugin.Parameter; import org.bench4q.agent.plugin.Plugin; import org.bench4q.agent.plugin.result.CommandLineReturn; +import org.bench4q.agent.scenario.util.Type.SupportTypes; @Plugin("CommandLine") public class CommandLinePlugin { @@ -34,7 +35,8 @@ public class CommandLinePlugin { } @Behavior("Command") - public CommandLineReturn command(@Parameter("command") String command) { + public CommandLineReturn command( + @Parameter(value = "command", type = SupportTypes.Field) String command) { try { final Process process = Runtime.getRuntime().exec(command); new Thread() { diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/ConstantTimerPlugin.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/ConstantTimerPlugin.java index 589d0b40..c81333bf 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/ConstantTimerPlugin.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/ConstantTimerPlugin.java @@ -5,6 +5,7 @@ import org.bench4q.agent.plugin.Behavior; import org.bench4q.agent.plugin.Parameter; import org.bench4q.agent.plugin.Plugin; import org.bench4q.agent.plugin.result.TimerReturn; +import org.bench4q.agent.scenario.util.Type.SupportTypes; @Plugin("ConstantTimer") public class ConstantTimerPlugin { @@ -15,7 +16,8 @@ public class ConstantTimerPlugin { } @Behavior("Sleep") - public TimerReturn sleep(@Parameter("time") int time) { + public TimerReturn sleep( + @Parameter(value = "time", type = SupportTypes.Field) int time) { try { Thread.sleep(time); return new TimerReturn(true); diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/LogPlugin.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/LogPlugin.java index 473ef163..03e46e31 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/LogPlugin.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/LogPlugin.java @@ -4,6 +4,7 @@ import org.bench4q.agent.plugin.Behavior; import org.bench4q.agent.plugin.Parameter; import org.bench4q.agent.plugin.Plugin; import org.bench4q.agent.plugin.result.LogReturn; +import org.bench4q.agent.scenario.util.Type.SupportTypes; @Plugin("Log") public class LogPlugin { @@ -12,7 +13,8 @@ public class LogPlugin { } @Behavior("Log") - public LogReturn log(@Parameter("message") String message) { + public LogReturn log( + @Parameter(value = "message", type = SupportTypes.Field) String message) { System.out.println(message); return new LogReturn(true); } diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java index dbdd5358..69358a0f 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/HttpPlugin.java @@ -34,6 +34,7 @@ import org.bench4q.agent.plugin.Parameter; import org.bench4q.agent.plugin.Plugin; import org.bench4q.agent.plugin.result.HttpReturn; import org.bench4q.agent.scenario.util.ParameterParser; +import org.bench4q.agent.scenario.util.Type.SupportTypes; import org.bench4q.agent.scenario.util.types.Table; @Plugin("Http") @@ -128,10 +129,11 @@ public class HttpPlugin { * @return */ @Behavior("Get") - public HttpReturn get(@Parameter("url") String url, - @Parameter("queryParams") String queryParams, - @Parameter("headers") String headers, - @Parameter("respVarsToSaveInSession") String respVarsToSaveInSession) { + public HttpReturn get( + @Parameter(value = "url", type = SupportTypes.Field) String url, + @Parameter(value = "queryParams", type = SupportTypes.NField) String queryParams, + @Parameter(value = "headers", type = SupportTypes.Table) String headers, + @Parameter(value = "respVarsToSaveInSession", type = SupportTypes.Table) String respVarsToSaveInSession) { GetMethod method = new GetMethod(completeUri(url)); if (isValid(queryParams)) { @@ -252,12 +254,13 @@ public class HttpPlugin { * @return */ @Behavior("Post") - public HttpReturn post(@Parameter("url") String url, - @Parameter("queryParams") String queryParams, - @Parameter("headers") String headers, - @Parameter("bodyContent") String bodyContent, - @Parameter("bodyparameters") String bodyParams, - @Parameter("respVarsToSaveInSession") String respVarToSaveInSession) { + public HttpReturn post( + @Parameter(value = "url", type = SupportTypes.Field) String url, + @Parameter(value = "queryParams", type = SupportTypes.NField) String queryParams, + @Parameter(value = "headers", type = SupportTypes.Table) String headers, + @Parameter(value = "bodyContent", type = SupportTypes.Field) String bodyContent, + @Parameter(value = "bodyparameters", type = SupportTypes.NField) String bodyParams, + @Parameter(value = "respVarsToSaveInSession", type = SupportTypes.Table) String respVarToSaveInSession) { PostMethod method = new PostMethod(completeUri(url)); setHeaders(method, headers); if (isValid(queryParams)) { @@ -297,12 +300,13 @@ public class HttpPlugin { } @Behavior("Put") - public HttpReturn put(@Parameter("url") String url, - @Parameter("queryParams") String queryParams, - @Parameter("headers") String headers, - @Parameter("bodyContent") String bodyContent, - @Parameter("bodyparameters") String bodyParams, - @Parameter("respVarsToSaveInSession") String respVarToSaveInSession) { + public HttpReturn put( + @Parameter(value = "url", type = SupportTypes.Field) String url, + @Parameter(value = "queryParams", type = SupportTypes.NField) String queryParams, + @Parameter(value = "headers", type = SupportTypes.Table) String headers, + @Parameter(value = "bodyContent", type = SupportTypes.Field) String bodyContent, + @Parameter(value = "bodyparameters", type = SupportTypes.NField) String bodyParams, + @Parameter(value = "respVarsToSaveInSession", type = SupportTypes.Table) String respVarToSaveInSession) { PutMethod method = new PutMethod(completeUri(url)); setHeaders(method, headers); if (isValid(queryParams)) { @@ -323,10 +327,11 @@ public class HttpPlugin { } @Behavior("Delete") - public HttpReturn delete(@Parameter("url") String url, - @Parameter("queryParams") String queryParams, - @Parameter("headers") String headers, - @Parameter("respVarsToSaveInSession") String respVarToSaveInSession) { + public HttpReturn delete( + @Parameter(value = "url", type = SupportTypes.Field) String url, + @Parameter(value = "queryParams", type = SupportTypes.NField) String queryParams, + @Parameter(value = "headers", type = SupportTypes.Table) String headers, + @Parameter(value = "respVarsToSaveInSession", type = SupportTypes.Table) String respVarToSaveInSession) { DeleteMethod method = new DeleteMethod(completeUri(url)); setHeaders(method, headers); if (isValid(queryParams)) { diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/Type.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/Type.java index 3f4b0f80..c7e52b13 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/Type.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/Type.java @@ -1,5 +1,8 @@ package org.bench4q.agent.scenario.util; public class Type { + public static enum SupportTypes { + Field, NField, Table, Radio, CheckBox + } } diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/CheckBox.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/CheckBox.java new file mode 100644 index 00000000..118bfa13 --- /dev/null +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/CheckBox.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.scenario.util.types; + +public class CheckBox { + +} diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/NField.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/NField.java new file mode 100644 index 00000000..ef9cbca4 --- /dev/null +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/NField.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.scenario.util.types; + +public class NField { + +} diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/Radio.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/Radio.java new file mode 100644 index 00000000..b82c9856 --- /dev/null +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/scenario/util/types/Radio.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.scenario.util.types; + +public class Radio { + +}