Commit 3fe2f2e2 by Li Yongyu

Merge branch 'master' of

git@gitlab.eoffcn.com:ys65701/nwn_Api_auto_test.git

Conflicts:
	nwn_Api_auto_test/src/DefectTest.xml
parents d070efd9 c2745fc8
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/lib/commons-codec-1.9.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-logging-1.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/fluent-hc-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-cache-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-win-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpcore-4.4.4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpmime-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jna-4.1.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jna-platform-4.1.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json_simple-1.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/testng-6.9.12.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bcprov-ext-jdk15on-154.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bcprov-jdk15on-154.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-io-2.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-lang3-3.4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/dbunit-2.5.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/fluent-hc-4.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/groovy-2.4.7.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/gson-2.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-all-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jackson-annotations-2.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jackson-core-2.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jackson-databind-2.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/javax.servlet-5.1.12.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json-path-3.0.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json-schema-validator-3.0.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/mysql-connector-java-5.1.30-bin.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-beans-4.3.2.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-core-4.3.2.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-security-core-4.1.3.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-security-oauth2-2.0.11.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-web-4.2.6.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jcommander-1.30.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jxl.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/groovy-json-2.4.6.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/groovy-xml-2.4.6.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-core-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-library-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/rest-assured-3.0.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/tagsoup-1.2.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/com.google.guava_1.6.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/saxon-8.7.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="commons-codec-1.9.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-codec-1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-logging-1.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="fluent-hc-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/fluent-hc-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-cache-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-cache-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-win-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-win-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpcore-4.4.4.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpcore-4.4.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpmime-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpmime-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jna-4.1.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jna-4.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jna-platform-4.1.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jna-platform-4.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json_simple-1.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json_simple-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="testng-6.9.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/testng-6.9.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="bcprov-ext-jdk15on-154.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/bcprov-ext-jdk15on-154.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="bcprov-jdk15on-154.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/bcprov-jdk15on-154.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-io-2.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-io-2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-lang3-3.4.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-lang3-3.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="dbunit-2.5.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/dbunit-2.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="fluent-hc-4.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/fluent-hc-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="groovy-2.4.7.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/groovy-2.4.7.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="gson-2.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/gson-2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-all-1.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/hamcrest-all-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jackson-annotations-2.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jackson-annotations-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jackson-core-2.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jackson-core-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jackson-databind-2.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jackson-databind-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="javax.servlet-5.1.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/javax.servlet-5.1.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json-path-3.0.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json-path-3.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json-schema-validator-3.0.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json-schema-validator-3.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="mysql-connector-java-5.1.30-bin.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/mysql-connector-java-5.1.30-bin.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-beans-4.3.2.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-beans-4.3.2.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-core-4.3.2.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-core-4.3.2.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-security-core-4.1.3.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-security-core-4.1.3.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-security-oauth2-2.0.11.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-security-oauth2-2.0.11.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-web-4.2.6.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-web-4.2.6.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library">
<library name="jcommander-1.30.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jcommander-1.30.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jxl.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jxl.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="groovy-json-2.4.6.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/groovy-json-2.4.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="groovy-xml-2.4.6.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/groovy-xml-2.4.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-core-1.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-library-1.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/hamcrest-library-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="rest-assured-3.0.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/rest-assured-3.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="tagsoup-1.2.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/tagsoup-1.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="com.google.guava_1.6.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/com.google.guava_1.6.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="saxon-8.7.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/saxon-8.7.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/lib/commons-codec-1.9.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-logging-1.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/fluent-hc-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-cache-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-win-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpcore-4.4.4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpmime-4.5.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jna-4.1.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jna-platform-4.1.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json_simple-1.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/testng-6.9.12.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bcprov-ext-jdk15on-154.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bcprov-jdk15on-154.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-io-2.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-lang3-3.4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/dbunit-2.5.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/fluent-hc-4.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/groovy-2.4.7.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/gson-2.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-all-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jackson-annotations-2.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jackson-core-2.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jackson-databind-2.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/javax.servlet-5.1.12.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json-path-3.0.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json-schema-validator-3.0.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/mysql-connector-java-5.1.30-bin.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-beans-4.3.2.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-core-4.3.2.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-security-core-4.1.3.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-security-oauth2-2.0.11.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/spring-web-4.2.6.RELEASE.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jcommander-1.30.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jxl.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/groovy-json-2.4.6.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/groovy-xml-2.4.6.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-core-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-library-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/rest-assured-3.0.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/tagsoup-1.2.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/com.google.guava_1.6.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/saxon-8.7.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="commons-codec-1.9.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-codec-1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-logging-1.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="fluent-hc-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/fluent-hc-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-cache-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-cache-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-win-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-win-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpcore-4.4.4.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpcore-4.4.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpmime-4.5.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpmime-4.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jna-4.1.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jna-4.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jna-platform-4.1.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jna-platform-4.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json_simple-1.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json_simple-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="testng-6.9.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/testng-6.9.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="bcprov-ext-jdk15on-154.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/bcprov-ext-jdk15on-154.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="bcprov-jdk15on-154.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/bcprov-jdk15on-154.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-io-2.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-io-2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-lang3-3.4.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-lang3-3.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="dbunit-2.5.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/dbunit-2.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="fluent-hc-4.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/fluent-hc-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="groovy-2.4.7.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/groovy-2.4.7.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="gson-2.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/gson-2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-all-1.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/hamcrest-all-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jackson-annotations-2.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jackson-annotations-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jackson-core-2.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jackson-core-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jackson-databind-2.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jackson-databind-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="javax.servlet-5.1.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/javax.servlet-5.1.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json-path-3.0.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json-path-3.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json-schema-validator-3.0.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json-schema-validator-3.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="mysql-connector-java-5.1.30-bin.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/mysql-connector-java-5.1.30-bin.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-beans-4.3.2.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-beans-4.3.2.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-core-4.3.2.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-core-4.3.2.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-security-core-4.1.3.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-security-core-4.1.3.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-security-oauth2-2.0.11.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-security-oauth2-2.0.11.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="spring-web-4.2.6.RELEASE.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/spring-web-4.2.6.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library">
<library name="jcommander-1.30.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jcommander-1.30.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jxl.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jxl.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="groovy-json-2.4.6.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/groovy-json-2.4.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="groovy-xml-2.4.6.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/groovy-xml-2.4.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-core-1.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-library-1.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/hamcrest-library-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="rest-assured-3.0.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/rest-assured-3.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="tagsoup-1.2.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/tagsoup-1.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="com.google.guava_1.6.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/com.google.guava_1.6.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="saxon-8.7.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/saxon-8.7.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<classes>
<class name="com.puhui.test.RenMai_APITest">
<methods>
<include name="f" invocation-numbers="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 "/>
<include name="f" invocation-numbers="0 1 2 3 4 5 6 "/>
</methods>
</class>
</classes>
......
package com.offcn.TestUnti;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.Map;
public class HttpRequest {
/**
* 向指定URL发送GET方法的请求
*
* @param url
* 发送请求的URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
*/
public static void main(String[] args) {
String s=HttpRequest.sendGet("http://beta.alitest.eoffcn.com/template/addStuden/sign/5d114486999208096dace001ae4bc45a",
"user_info=[{\"package_id\":391634,\"username\":\"aaa\",\"phone\":15656333337,\"sso_id\":1}]&timestamp=1548828632&appid=jiaowu");
try {
String s1=new String(s.getBytes(),"utf-8");
System.out.println(s1);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
public static String sendGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
// String urlNameString = url ;
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NSwicGhvbmUiOiIxODUxMTg1MjA0OSIsImlhdCI6MTQ4NzEzMjU0OX0.2aZ8FcfE52CYpXc4VUYjdfzzLzXwVOE-J8CnMlhUPic");
connection.setRequestProperty("Content-Type", "application/json");
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.out.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
// o.write(line+"\r\n");
result += line;
result += "\r\n";
}
// o.close();
} catch (Exception e) {
System.out.println("发送GET请求出现异常!" + e);
e.printStackTrace();
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url
* 发送请求的 URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
String result = "";
try {
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("Authorization", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NSwicGhvbmUiOiIxODUxMTg1MjA0OSIsImlhdCI6MTQ4NzEzMjU0OX0.2aZ8FcfE52CYpXc4VUYjdfzzLzXwVOE-J8CnMlhUPic");
conn.setRequestProperty("Content-Type", "application/json");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
result += "\r\n";
}
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!"+e);
e.printStackTrace();
}
//使用finally块来关闭输出流、输入流
finally{
try{
if(out!=null){
out.close();
}
if(in!=null){
in.close();
}
}
catch(IOException ex){
ex.printStackTrace();
}
}
return result;
}
}
\ No newline at end of file
package com.offcn.TestUnti;
import java.io.*;
import java.net.URL;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
public class InstallCert {
public static void main(String[] args) throws Exception {
String host;
int port;
char[] passphrase;
if ((args.length == 1) || (args.length == 2)) {
String[] c = args[0].split(":");
host = c[0];
port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
String p = (args.length == 1) ? "changeit" : args[1];
passphrase = p.toCharArray();
} else {
System.out.println("Usage: java InstallCert <host>[:port] [passphrase]");
return;
}
File file = new File("jssecacerts");
if (file.isFile() == false) {
char SEP = File.separatorChar;
File dir = new File(System.getProperty("java.home") + SEP
+ "lib" + SEP + "security");
file = new File(dir, "jssecacerts");
if (file.isFile() == false) {
file = new File(dir, "cacerts");
}
}
System.out.println("Loading KeyStore " + file + "...");
InputStream in = new FileInputStream(file);
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(in, passphrase);
in.close();
SSLContext context = SSLContext.getInstance("TLS");
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ks);
X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
context.init(null, new TrustManager[] {tm}, null);
SSLSocketFactory factory = context.getSocketFactory();
System.out.println("Opening connection to " + host + ":" + port + "...");
SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
socket.setSoTimeout(10000);
try {
System.out.println("Starting SSL handshake...");
socket.startHandshake();
socket.close();
System.out.println();
System.out.println("No errors, certificate is already trusted");
} catch (SSLException e) {
System.out.println();
e.printStackTrace(System.out);
}
X509Certificate[] chain = tm.chain;
if (chain == null) {
System.out.println("Could not obtain server certificate chain");
return;
}
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
System.out.println();
System.out.println("Server sent " + chain.length + " certificate(s):");
System.out.println();
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
MessageDigest md5 = MessageDigest.getInstance("MD5");
for (int i = 0; i < chain.length; i++) {
X509Certificate cert = chain[i];
System.out.println
(" " + (i + 1) + " Subject " + cert.getSubjectDN());
System.out.println(" Issuer " + cert.getIssuerDN());
sha1.update(cert.getEncoded());
System.out.println(" sha1 " + toHexString(sha1.digest()));
md5.update(cert.getEncoded());
System.out.println(" md5 " + toHexString(md5.digest()));
System.out.println();
}
System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
String line = reader.readLine().trim();
int k;
try {
k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
} catch (NumberFormatException e) {
System.out.println("KeyStore not changed");
return;
}
X509Certificate cert = chain[k];
String alias = host + "-" + (k + 1);
ks.setCertificateEntry(alias, cert);
OutputStream out = new FileOutputStream("jssecacerts");
ks.store(out, passphrase);
out.close();
System.out.println();
System.out.println(cert);
System.out.println();
System.out.println
("Added certificate to keystore 'jssecacerts' using alias '"
+ alias + "'");
}
private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
private static String toHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 3);
for (int b : bytes) {
b &= 0xff;
sb.append(HEXDIGITS[b >> 4]);
sb.append(HEXDIGITS[b & 15]);
sb.append(' ');
}
return sb.toString();
}
private static class SavingTrustManager implements X509TrustManager {
private final X509TrustManager tm;
private X509Certificate[] chain;
SavingTrustManager(X509TrustManager tm) {
this.tm = tm;
}
public X509Certificate[] getAcceptedIssuers() {
throw new UnsupportedOperationException();
}
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
throw new UnsupportedOperationException();
}
public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
this.chain = chain;
tm.checkServerTrusted(chain, authType);
}
}
}
package com.offcn.TestUnti;
import java.io.*;
import java.net.URL;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
public class InstallCert {
public static void main(String[] args) throws Exception {
String host;
int port;
char[] passphrase;
if ((args.length == 1) || (args.length == 2)) {
String[] c = args[0].split(":");
host = c[0];
port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
String p = (args.length == 1) ? "changeit" : args[1];
passphrase = p.toCharArray();
} else {
System.out.println("Usage: java InstallCert <host>[:port] [passphrase]");
return;
}
File file = new File("jssecacerts");
if (file.isFile() == false) {
char SEP = File.separatorChar;
File dir = new File(System.getProperty("java.home") + SEP
+ "lib" + SEP + "security");
file = new File(dir, "jssecacerts");
if (file.isFile() == false) {
file = new File(dir, "cacerts");
}
}
System.out.println("Loading KeyStore " + file + "...");
InputStream in = new FileInputStream(file);
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(in, passphrase);
in.close();
SSLContext context = SSLContext.getInstance("TLS");
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ks);
X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
context.init(null, new TrustManager[] {tm}, null);
SSLSocketFactory factory = context.getSocketFactory();
System.out.println("Opening connection to " + host + ":" + port + "...");
SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
socket.setSoTimeout(10000);
try {
System.out.println("Starting SSL handshake...");
socket.startHandshake();
socket.close();
System.out.println();
System.out.println("No errors, certificate is already trusted");
} catch (SSLException e) {
System.out.println();
e.printStackTrace(System.out);
}
X509Certificate[] chain = tm.chain;
if (chain == null) {
System.out.println("Could not obtain server certificate chain");
return;
}
BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in));
System.out.println();
System.out.println("Server sent " + chain.length + " certificate(s):");
System.out.println();
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
MessageDigest md5 = MessageDigest.getInstance("MD5");
for (int i = 0; i < chain.length; i++) {
X509Certificate cert = chain[i];
System.out.println
(" " + (i + 1) + " Subject " + cert.getSubjectDN());
System.out.println(" Issuer " + cert.getIssuerDN());
sha1.update(cert.getEncoded());
System.out.println(" sha1 " + toHexString(sha1.digest()));
md5.update(cert.getEncoded());
System.out.println(" md5 " + toHexString(md5.digest()));
System.out.println();
}
System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
String line = reader.readLine().trim();
int k;
try {
k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
} catch (NumberFormatException e) {
System.out.println("KeyStore not changed");
return;
}
X509Certificate cert = chain[k];
String alias = host + "-" + (k + 1);
ks.setCertificateEntry(alias, cert);
OutputStream out = new FileOutputStream("jssecacerts");
ks.store(out, passphrase);
out.close();
System.out.println();
System.out.println(cert);
System.out.println();
System.out.println
("Added certificate to keystore 'jssecacerts' using alias '"
+ alias + "'");
}
private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
private static String toHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 3);
for (int b : bytes) {
b &= 0xff;
sb.append(HEXDIGITS[b >> 4]);
sb.append(HEXDIGITS[b & 15]);
sb.append(' ');
}
return sb.toString();
}
private static class SavingTrustManager implements X509TrustManager {
private final X509TrustManager tm;
private X509Certificate[] chain;
SavingTrustManager(X509TrustManager tm) {
this.tm = tm;
}
public X509Certificate[] getAcceptedIssuers() {
throw new UnsupportedOperationException();
}
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
throw new UnsupportedOperationException();
}
public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
this.chain = chain;
tm.checkServerTrusted(chain, authType);
}
}
}
package com.offcn.TestUnti;
import io.restassured.RestAssured;
import io.restassured.config.RestAssuredConfig;
import io.restassured.config.SSLConfig;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static io.restassured.http.ContentType.JSON;
/**
* Created by puhui on 16/9/14.
*/
public class MockServerTestUtil {
static RestAssured ra;
public static RestAssured getLocalRAEnv(){
if (ra == null){
ra = new RestAssured();
ra.config = RestAssuredConfig.newConfig().sslConfig(SSLConfig.sslConfig().allowAllHostnames());
ra.baseURI = "http://127.0.0.1";
ra.port = 30800;
}
return ra;
}
public static void sendSingleMessageResponse(String mobile, String messageContent){
Response re = getLocalRAEnv().given().
param("token", "faketoken").
param("senderId", 1).
param("senderName", "iqianjin").
param("mobile", mobile).
param("messageContent", messageContent).
param("bsCode", "sbcode").
when().get("/api/v1/message/getSend").thenReturn();
re.getBody().print();
re.then().statusCode( 200 );
}
//batchNo批次号非必要参数,
// messageContent messageContents 单条内容和多条容不能共存,优先单一内容发送,多条内容发送是与发送号码一一对应的。
public static JsonPath sendmutiMessageResponse(List<String> mobiles, List<String> messageContents){
Map<String, Object> jsonAsMap = new HashMap();
jsonAsMap.put("senderName","testmuti");
jsonAsMap.put("messageContents",messageContents);
jsonAsMap.put("mobiles",mobiles);
jsonAsMap.put("bscode","fakebscode");
Response re = getLocalRAEnv().given().contentType(JSON).body(jsonAsMap).
when(). post("/api/v1/message/send").thenReturn();
re.getBody().print();
re.then().statusCode( 200 );
return re.getBody().jsonPath();
}
public static JsonPath getSingleMessageResponse(String mobile){
Response re = getLocalRAEnv().given().
param("mobile", mobile).
when(). get("/api/v1/message/query").thenReturn();
re.getBody().print();
re.then().statusCode( 200 );
return re.getBody().jsonPath();
}
}
package com.offcn.TestUnti;
import io.restassured.RestAssured;
import io.restassured.config.RestAssuredConfig;
import io.restassured.config.SSLConfig;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static io.restassured.http.ContentType.JSON;
/**
* Created by puhui on 16/9/14.
*/
public class MockServerTestUtil {
static RestAssured ra;
public static RestAssured getLocalRAEnv(){
if (ra == null){
ra = new RestAssured();
ra.config = RestAssuredConfig.newConfig().sslConfig(SSLConfig.sslConfig().allowAllHostnames());
ra.baseURI = "http://127.0.0.1";
ra.port = 30800;
}
return ra;
}
public static void sendSingleMessageResponse(String mobile, String messageContent){
Response re = getLocalRAEnv().given().
param("token", "faketoken").
param("senderId", 1).
param("senderName", "iqianjin").
param("mobile", mobile).
param("messageContent", messageContent).
param("bsCode", "sbcode").
when().get("/api/v1/message/getSend").thenReturn();
re.getBody().print();
re.then().statusCode( 200 );
}
//batchNo批次号非必要参数,
// messageContent messageContents 单条内容和多条容不能共存,优先单一内容发送,多条内容发送是与发送号码一一对应的。
public static JsonPath sendmutiMessageResponse(List<String> mobiles, List<String> messageContents){
Map<String, Object> jsonAsMap = new HashMap();
jsonAsMap.put("senderName","testmuti");
jsonAsMap.put("messageContents",messageContents);
jsonAsMap.put("mobiles",mobiles);
jsonAsMap.put("bscode","fakebscode");
Response re = getLocalRAEnv().given().contentType(JSON).body(jsonAsMap).
when(). post("/api/v1/message/send").thenReturn();
re.getBody().print();
re.then().statusCode( 200 );
return re.getBody().jsonPath();
}
public static JsonPath getSingleMessageResponse(String mobile){
Response re = getLocalRAEnv().given().
param("mobile", mobile).
when(). get("/api/v1/message/query").thenReturn();
re.getBody().print();
re.then().statusCode( 200 );
return re.getBody().jsonPath();
}
}
package com.offcn.TestUnti;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.DefaultAccessTokenRequest;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import com.offcn.process.BasicsGM;
import com.offcn.system.system;
import com.offcn.test.APITest_tk;
import java.util.Arrays;
public class OAuthTokenUnti {
public APITest_tk RAPI;
// private static OAuth2AccessToken token;
public static OAuth2AccessToken token;
public static void main(String[] args) {
String strToken=OAuthTokenUnti.getOathToken("gmysx").getValue();
System.out.println("strToken="+strToken);
}
public static OAuth2AccessToken getOathToken(String system){
if(token == null){
OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(getResource(system),new DefaultOAuth2ClientContext(new DefaultAccessTokenRequest()));
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
restTemplate.setMessageConverters(Arrays.<HttpMessageConverter<?>> asList(converter));
token = restTemplate.getAccessToken();
}
return token;
}
private static ClientCredentialsResourceDetails getResource(String system){
ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails();
system tem=(system)(BasicsGM.map.get(system));
resource.setAccessTokenUri(tem.getAccess_token_uri());
resource.setClientId(tem.getClient_id());
resource.setClientSecret(tem.getClient_secret());
resource.setGrantType(tem.getGrant_type());
return resource;
}
}
package com.offcn.TestUnti;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.DefaultAccessTokenRequest;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import com.offcn.process.BasicsGM;
import com.offcn.system.system;
import com.offcn.test.APITest_tk;
import java.util.Arrays;
public class OAuthTokenUnti {
public APITest_tk RAPI;
// private static OAuth2AccessToken token;
public static OAuth2AccessToken token;
public static void main(String[] args) {
String strToken=OAuthTokenUnti.getOathToken("gmysx").getValue();
System.out.println("strToken="+strToken);
}
public static OAuth2AccessToken getOathToken(String system){
if(token == null){
OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(getResource(system),new DefaultOAuth2ClientContext(new DefaultAccessTokenRequest()));
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
restTemplate.setMessageConverters(Arrays.<HttpMessageConverter<?>> asList(converter));
token = restTemplate.getAccessToken();
}
return token;
}
private static ClientCredentialsResourceDetails getResource(String system){
ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails();
system tem=(system)(BasicsGM.map.get(system));
resource.setAccessTokenUri(tem.getAccess_token_uri());
resource.setClientId(tem.getClient_id());
resource.setClientSecret(tem.getClient_secret());
resource.setGrantType(tem.getGrant_type());
return resource;
}
}
......@@ -665,8 +665,7 @@ public class RequestDataUtils {
}
}
return re;
}
}
@SuppressWarnings("static-access")
public static Response Get_one_cookie_pre(HashMap<String, Object> data,
......@@ -837,4 +836,5 @@ public class RequestDataUtils {
}
return re;
}
}
......@@ -33,7 +33,7 @@ public class nwngetsign {
str = str + "bf2h3%^j?ljkj3706kji88697"; //教务的加密,规则固定需要加
System.out.println("str===" + str);
NWN.suprise_str = str;
//String str1 = "appid=tiku&avatar=http://thirdqq.qlogo.cn/qqapp/1106773681/5B50BBF83A00DC46B16B708F720A5D46/100&device_id=861837034477409&login_type=qq&nickname=hobo&open_id=1&platform=Android&version=1"+"&123456";
String res = new LMFMD5().MD5(str);
System.out.println("res===" +res);
......
......@@ -4,6 +4,7 @@ package com.offcn.api.nwn.service;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import java.io.UnsupportedEncodingException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
......@@ -15,16 +16,17 @@ import java.util.Random;
import org.json.simple.JSONArray;
import com.offcn.TestUnti.HttpRequest;
import com.offcn.TestUnti.Log;
import com.offcn.TestUnti.MapUtil;
import com.offcn.TestUnti.RequestDataUtils;
import com.offcn.TestUnti.StringUtils;
import com.offcn.api.nwn.md5.nwngetsign;
import com.offcn.interfaces.API;
import com.offcn.process.NWN;
import com.offcn.process.TK;
import com.offcn.TestUnti.ListUtil;
import net.sf.json.JSONObject;
......@@ -40,6 +42,7 @@ public class addStuden extends NWN implements API {
public String template_id_1;//母板ID
public String response;//返回结果
// public String phone;//层级包id
@Override
public void initialize(HashMap<String, Object> data) {
......@@ -76,20 +79,30 @@ public class addStuden extends NWN implements API {
// Map<String,String> m=new HashMap<String,String>();
// m.put("user_info", parameter);
//Response re = RequestDataUtils.Post_cooike_form_data(data, Url,"PHPSESSID",PHPSESSID,m);
Response re = RequestDataUtils.Get_one_cookie_pre(data, Url, "PHPSESSID",PHPSESSID);
//Response re = RequestDataUtils.Get_one_cookie(data, serviceURL, cookie1Name, cookie1value) //只能无参
// Response re = RequestDataUtils.Get_token(data, Url, "");
return re;
// Response re = RequestDataUtils.Get_one_cookie_pre(data, Url, "PHPSESSID",PHPSESSID);
//response=HttpRequest.sendGet("http://beta.alitest.eoffcn.com/template/addStuden/sign/5d114486999208096dace001ae4bc45a",
// "user_info=[{\"package_id\":391634,\"username\":\"aaa\",\"phone\":15656333337,\"sso_id\":1}]&timestamp=1548828632&appid=jiaowu");
System.out.println("parameter====" + parameter);
System.out.println("url===" + Url);
response=HttpRequest.sendGet("http://beta.alitest.eoffcn.com"+Url,parameter);
try {
String s1=new String(response.getBytes(),"utf-8");
System.out.println(s1);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
@Override
public String handleOutput(Response re, HashMap<String, Object> data) {
JsonPath jp = re.body().jsonPath();
JsonPath jp = new JsonPath(response);
System.out.println( "jp===="+ jp);
boolean result = true;
String failReason = "";
String json = re.asString();
String json = response;
System.out.println("response=========="+StringUtils.decodeUnicode(json));
if ((data.get("statusCode") != null)
......
......@@ -47,6 +47,7 @@ public class NWN extends BasicsGM{
public static List<String> user_id_List = new ArrayList<String>();//user_id
public static String template_id = "";
public static String timestamp;//时间戳
public static String suprise_str;//特殊字符
// public static String phone_code = "";//手机号验证码
//
//
......
......@@ -99,13 +99,18 @@ public class APITest_nwn extends NWN{
if(data.get("Description").toString().contains("流程")){
result = obj.handleOutput(re, data);
}
}else{
result = obj.handleOutput(re, data);
}
codeORerrcode=getCode(re);
msgORerrmsy=getMsg(re);
// else{
// result = obj.handleOutput(re, data);
// }
// codeORerrcode=getCode(re);
// msgORerrmsy=getMsg(re);
}
}
result = obj.handleOutput(re, data);
codeORerrcode=getCode(re);
msgORerrmsy=getMsg(re);
Log.logInfo("返回结果="+StringUtils.decodeUnicode(body));
System.out.println();
......
package com.offcn.test;
import io.restassured.response.Response;
import java.sql.SQLException;
import java.util.HashMap;
import net.sf.json.JSONObject;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import com.offcn.TestData.offcn_api_testData;
import com.offcn.TestUnti.Log;
import com.offcn.TestUnti.Mail;
import com.offcn.TestUnti.MapUtil;
import com.offcn.TestUnti.OAuthTokenUnti;
import com.offcn.TestUnti.ReadProperties;
import com.offcn.TestUnti.Reflect_api;
import com.offcn.TestUnti.SheetUtils;
import com.offcn.TestUnti.StringUtils;
import com.offcn.TestUnti.XMLread;
import com.offcn.interfaces.API;
import com.offcn.listener.ProcessTestng;
import com.offcn.listener.ResultTestng;
import com.offcn.process.BasicsGM;
import com.offcn.process.TK;
import com.offcn.process.XYZB;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@Listeners({ ProcessTestng.class ,ResultTestng.class })
public class APITest_tk extends TK{
@Test(dataProvider = "renmai", dataProviderClass = offcn_api_testData.class)
public void f(HashMap<String, Object> data) {
Log.logInfo(data.get("TCNO").toString() + " Step " + data.get("Description").toString() + " is running......");
API obj = new Reflect_api().Reflections(data);
BasicsGM.map=new XMLread().getSystem();
obj.initialize(data);
data = obj.handleInput(data);
String parameter = MapUtil.getValue("parameter", data);
Long startTime=System.currentTimeMillis();
Response re = obj.SendRequest(data, data.get("serviceUrl").toString(), data.get("Request").toString());
Long endTime=System.currentTimeMillis();
String time=(endTime-startTime)+"毫秒";
String body=re.asString();
String codeORerrcode="";
String msgORerrmsy="";
String result = "";
if(body.contains("<title>")){
int Alength="<title>".length();
int start=body.indexOf("<title>");
int end=body.indexOf("</title>")+1;
body="页面标题:"+body.substring(start+Alength, end-1);
result=body;
if(data.get("Description").toString().contains("流程")){
result = obj.handleOutput(re, data);
}
}else{
result = obj.handleOutput(re, data);
}
codeORerrcode=getCode(re);
msgORerrmsy=getMsg(re);
Log.logInfo("返回结果="+StringUtils.decodeUnicode(body));
System.out.println();
//数据回写
// HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
// SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
// sheet.writeExcel(
// data.get("NO").toString(),
// data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
// data.get("Description").toString(),
// parameter,
// JSONObject.fromObject(ExpectResult).toString(),
// StringUtils.decodeUnicode(re.asString()),
// codeORerrcode,
// msgORerrmsy,
// result,
// time
// );
if(result.indexOf("Fail")!=-1){
String Expect1=data.get("code")==null?"":data.get("code").toString();
String Expect2=data.get("msg")==null?"":data.get("msg").toString();
String Expect3=data.get("custom")==null?"":data.get("custom").toString();
if(body.contains("HTML")){
body="异常页面信息";
}
Assert.assertEquals(StringUtils.decodeUnicode(body),Expect1+","+Expect2+","+Expect3);
}else{
Assert.assertTrue(true);
}
}
@AfterClass
public void afterClass() {
//测试结束删除测试所用的数据
if (!isClearMysql) {
cleanUser_FromDB();//清除注册user_id,
cleanexam_FromDB();//清除用户地区操作表t_exam_area
try {
if(stmt!=null){
stmt.close();
}
if (conn != null){
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Log.logInfo("========测试结束========");
}
}
package com.offcn.test;
import io.restassured.response.Response;
import java.sql.SQLException;
import java.util.HashMap;
import net.sf.json.JSONObject;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import com.offcn.TestData.offcn_api_testData;
import com.offcn.TestUnti.Log;
import com.offcn.TestUnti.Mail;
import com.offcn.TestUnti.MapUtil;
import com.offcn.TestUnti.OAuthTokenUnti;
import com.offcn.TestUnti.ReadProperties;
import com.offcn.TestUnti.Reflect_api;
import com.offcn.TestUnti.SheetUtils;
import com.offcn.TestUnti.StringUtils;
import com.offcn.TestUnti.XMLread;
import com.offcn.interfaces.API;
import com.offcn.listener.ProcessTestng;
import com.offcn.listener.ResultTestng;
import com.offcn.process.BasicsGM;
import com.offcn.process.TK;
import com.offcn.process.XYZB;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@Listeners({ ProcessTestng.class ,ResultTestng.class })
public class APITest_tk extends TK{
@Test(dataProvider = "renmai", dataProviderClass = offcn_api_testData.class)
public void f(HashMap<String, Object> data) {
Log.logInfo(data.get("TCNO").toString() + " Step " + data.get("Description").toString() + " is running......");
API obj = new Reflect_api().Reflections(data);
BasicsGM.map=new XMLread().getSystem();
obj.initialize(data);
data = obj.handleInput(data);
String parameter = MapUtil.getValue("parameter", data);
Long startTime=System.currentTimeMillis();
Response re = obj.SendRequest(data, data.get("serviceUrl").toString(), data.get("Request").toString());
Long endTime=System.currentTimeMillis();
String time=(endTime-startTime)+"毫秒";
String body=re.asString();
String codeORerrcode="";
String msgORerrmsy="";
String result = "";
if(body.contains("<title>")){
int Alength="<title>".length();
int start=body.indexOf("<title>");
int end=body.indexOf("</title>")+1;
body="页面标题:"+body.substring(start+Alength, end-1);
result=body;
if(data.get("Description").toString().contains("流程")){
result = obj.handleOutput(re, data);
}
}else{
result = obj.handleOutput(re, data);
}
codeORerrcode=getCode(re);
msgORerrmsy=getMsg(re);
Log.logInfo("返回结果="+StringUtils.decodeUnicode(body));
System.out.println();
//数据回写
// HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
// SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
// sheet.writeExcel(
// data.get("NO").toString(),
// data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
// data.get("Description").toString(),
// parameter,
// JSONObject.fromObject(ExpectResult).toString(),
// StringUtils.decodeUnicode(re.asString()),
// codeORerrcode,
// msgORerrmsy,
// result,
// time
// );
if(result.indexOf("Fail")!=-1){
String Expect1=data.get("code")==null?"":data.get("code").toString();
String Expect2=data.get("msg")==null?"":data.get("msg").toString();
String Expect3=data.get("custom")==null?"":data.get("custom").toString();
if(body.contains("HTML")){
body="异常页面信息";
}
Assert.assertEquals(StringUtils.decodeUnicode(body),Expect1+","+Expect2+","+Expect3);
}else{
Assert.assertTrue(true);
}
}
@AfterClass
public void afterClass() {
//测试结束删除测试所用的数据
if (!isClearMysql) {
cleanUser_FromDB();//清除注册user_id,
cleanexam_FromDB();//清除用户地区操作表t_exam_area
try {
if(stmt!=null){
stmt.close();
}
if (conn != null){
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Log.logInfo("========测试结束========");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<customers>
<customer active="false">
<xml_name>王炎炎</xml_name>
<xml_idNo>130426199201270329</xml_idNo>
<xml_bankNo>6227000210250635768</xml_bankNo>
<xml_phone>18230065651</xml_phone>
</customer>
<customer active="true">
<xml_name>王炎炎</xml_name>
<xml_idNo>130426199201270329</xml_idNo>
<xml_bankNo>6227000210250635768</xml_bankNo>
<xml_phone>18230065651</xml_phone>
</customer>
<?xml version="1.0" encoding="UTF-8"?>
<customers>
<customer active="false">
<xml_name>王炎炎</xml_name>
<xml_idNo>130426199201270329</xml_idNo>
<xml_bankNo>6227000210250635768</xml_bankNo>
<xml_phone>18230065651</xml_phone>
</customer>
<customer active="true">
<xml_name>王炎炎</xml_name>
<xml_idNo>130426199201270329</xml_idNo>
<xml_bankNo>6227000210250635768</xml_bankNo>
<xml_phone>18230065651</xml_phone>
</customer>
</customers>
\ No newline at end of file
//package test;
//
//
//
//import com.puhui.bestbuy.common.domain.wx.Token;
//import com.puhui.bestbuy.common.domain.wx.WeixinOauth2Token;
//import com.puhui.bestbuy.common.domain.wx.WeixinUserInfo;
//import com.puhui.bestbuy.common.domain.wx.WeixinUserList;
//import net.sf.json.JSONArray;
//import net.sf.json.JSONException;
//import net.sf.json.JSONObject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.security.MessageDigest;
//import java.security.NoSuchAlgorithmException;
//import java.util.Arrays;
//import java.util.List;
//
//
///**
// * @ClassName: UserUtil.java
// * @Title: 权限控制工具类
// * @Description: 权限控制工具类
// */
//public class UserUtil {
//
// private static final String errcode = "errcode";
//
// private static final String errmsg = "errmsg";
//
// private static Logger log = LoggerFactory.getLogger(UserUtil.class);
//
// public static Token getToken(String appid, String appsecret) {
// Token token = null;
// String requestUrl = WeixinParameter.token_url.replace("APPID", appid)
// .replace("APPSECRET", appsecret);
// // 发起GET请求获取凭证
// JSONObject jsonObject = CommonUtil
// .httpsRequest(requestUrl, "GET", null);
//
// if (null != jsonObject) {
// try {
// token = new Token();
// token.setAccessToken(jsonObject.getString("access_token"));
// token.setExpiresIn(jsonObject.getInt("expires_in"));
// log.info("[UserUtil][getToken]获取token成功{}", jsonObject.getString("access_token"));
// } catch (JSONException e) {
// token = null;
// // 获取token失败
// log.error("[UserUtil][getToken]获取token失败 errcode:{} errmsg:{}",
// jsonObject.getInt(errcode),
// jsonObject.getString(errmsg));
// log.error("获取token失败", e);
// }
// }
// return token;
// }
//
// /**
// * 获取用户信息
// *
// * @param accessToken 接口访问凭证
// * @param openId 用户标识
// * @return WeixinUserInfo
// */
// public static WeixinUserInfo getUserInfo(String accessToken, String openId) {
// WeixinUserInfo weixinUserInfo = new WeixinUserInfo();
// // 拼接请求地址
// String requestUrl = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID";
// requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace(
// "OPENID", openId);
// // 获取用户信息
// JSONObject jsonObject = CommonUtil.httpsRequest(requestUrl, "GET", null);
//
// if (null != jsonObject) {
// log.info("[UserUtil][getUserInfo][jsonObject]="
// + jsonObject.toString());
// // 用户的标识
// weixinUserInfo.setOpenId(openId);
// // 关注状态(1是关注,0是未关注),未关注时获取不到其余信息
// weixinUserInfo.setSubscribe(jsonObject.getInt("subscribe"));
// if (jsonObject.getInt("subscribe") == 1) {
// // 用户关注时间
// weixinUserInfo.setSubscribeTime(jsonObject
// .getString("subscribe_time"));
// // 昵称
// weixinUserInfo.setNickname(jsonObject.getString("nickname"));
// // 用户的性别(1是男性,2是女性,0是未知)
// weixinUserInfo.setSex(jsonObject.getInt("sex"));
// // 用户所在国家
// weixinUserInfo.setCountry(jsonObject.getString("country"));
// // 用户所在省份
// weixinUserInfo.setProvince(jsonObject.getString("province"));
// // 用户所在城市
// weixinUserInfo.setCity(jsonObject.getString("city"));
// // 用户的语言,简体中文为zh_CN
// weixinUserInfo.setLanguage(jsonObject.getString("language"));
// // 用户头像
// weixinUserInfo.setHeadImgUrl(jsonObject.getString("headimgurl"));
// }
// }
// return weixinUserInfo;
// }
//
// /**
// * 校验签名
// *
// * @param token 绑定TOKEN
// * @param signature 微信加密签名
// * @param timestamp 时间戳
// * @param nonce 随机数
// * @return
// */
// public static boolean checkSignature(String token, String signature,
// String timestamp, String nonce) {
//
// // 对token、timestamp和nonce按字典排序
// String[] paramArr = new String[]{token, timestamp, nonce};
// Arrays.sort(paramArr);
//
// // 将排序后的结果拼接成一个字符串
// String content = paramArr[0].concat(paramArr[1]).concat(paramArr[2]);
//
// String ciphertext = null;
// try {
// MessageDigest md = MessageDigest.getInstance("SHA-1");
// // 对接后的字符串进行sha1加密
// byte[] digest = md.digest(content.getBytes());
// ciphertext = CommonUtil.byteToStr(digest);
// } catch (NoSuchAlgorithmException e) {
// log.error("验签失败", e);
// }
//
// // 将sha1加密后的字符串与signature进行对比
// log.info("ciphertext:" + ciphertext);
// return ciphertext != null ? ciphertext.equalsIgnoreCase(signature)
// : false;
// }
//
// /**
// * 获取网页授权凭证
// *
// * @param appId 公众账号的唯一标识
// * @param appSecret 公众账号的密钥
// * @param code
// * @return WeixinAouth2Token
// */
// public static WeixinOauth2Token getOauth2AccessToken(String appId,
// String appSecret, String code) {
// WeixinOauth2Token wat = null;
// // 拼接请求地址
// String requestUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
// requestUrl = requestUrl.replace("APPID", appId);
// requestUrl = requestUrl.replace("SECRET", appSecret);
// requestUrl = requestUrl.replace("CODE", code);
// // 获取网页授权凭证
// JSONObject jsonObject = CommonUtil
// .httpsRequest(requestUrl, "GET", null);
// if (null != jsonObject) {
// try {
// wat = new WeixinOauth2Token();
// wat.setAccessToken(jsonObject.getString("access_token"));
// wat.setExpiresIn(jsonObject.getInt("expires_in"));
// wat.setRefreshToken(jsonObject.getString("refresh_token"));
// wat.setOpenId(jsonObject.getString("openid"));
// wat.setScope(jsonObject.getString("scope"));
// } catch (Exception e) {
// wat = null;
// int errorCode = jsonObject.getInt(errcode);
// String errorMsg = jsonObject.getString(errmsg);
// log.error(
// "[UserUtil][getOauth2AccessToken]获取网页授权凭证失败 errcode:{} errmsg:{}",
// errorCode, errorMsg);
// log.error("获取网页授权凭证失败", e);
// }
// }
// return wat;
// }
//
// /**
// * 获取关注者列表
// *
// * @param accessToken 调用接口凭证
// * @param nextOpenId 第一个拉取的openId,不填默认从头开始拉取
// * @return WeixinUserList
// */
// @SuppressWarnings({"unchecked", "deprecation"})
// public static WeixinUserList getUserList(String accessToken,
// String nextOpenId) {
// WeixinUserList weixinUserList = new WeixinUserList();
//
// if (null == nextOpenId)
// nextOpenId = "";
//
// // 拼接请求地址
// String requestUrl = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID";
// requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace(
// "NEXT_OPENID", nextOpenId);
// // 获取关注者列表
// JSONObject jsonObject = CommonUtil
// .httpsRequest(requestUrl, "GET", null);
// // 如果请求成功
// if (null != jsonObject) {
// weixinUserList.setTotal(jsonObject.getInt("total"));
// weixinUserList.setCount(jsonObject.getInt("count"));
// weixinUserList.setNextOpenId(jsonObject
// .getString("next_openid"));
// JSONObject dataObject = (JSONObject) jsonObject.get("data");
// weixinUserList.setOpenIdList(JSONArray.toList(
// dataObject.getJSONArray("openid"), List.class));
//
// }
// return weixinUserList;
// }
//
//}
//package test;
//
//
//
//import com.puhui.bestbuy.common.domain.wx.Token;
//import com.puhui.bestbuy.common.domain.wx.WeixinOauth2Token;
//import com.puhui.bestbuy.common.domain.wx.WeixinUserInfo;
//import com.puhui.bestbuy.common.domain.wx.WeixinUserList;
//import net.sf.json.JSONArray;
//import net.sf.json.JSONException;
//import net.sf.json.JSONObject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.security.MessageDigest;
//import java.security.NoSuchAlgorithmException;
//import java.util.Arrays;
//import java.util.List;
//
//
///**
// * @ClassName: UserUtil.java
// * @Title: 权限控制工具类
// * @Description: 权限控制工具类
// */
//public class UserUtil {
//
// private static final String errcode = "errcode";
//
// private static final String errmsg = "errmsg";
//
// private static Logger log = LoggerFactory.getLogger(UserUtil.class);
//
// public static Token getToken(String appid, String appsecret) {
// Token token = null;
// String requestUrl = WeixinParameter.token_url.replace("APPID", appid)
// .replace("APPSECRET", appsecret);
// // 发起GET请求获取凭证
// JSONObject jsonObject = CommonUtil
// .httpsRequest(requestUrl, "GET", null);
//
// if (null != jsonObject) {
// try {
// token = new Token();
// token.setAccessToken(jsonObject.getString("access_token"));
// token.setExpiresIn(jsonObject.getInt("expires_in"));
// log.info("[UserUtil][getToken]获取token成功{}", jsonObject.getString("access_token"));
// } catch (JSONException e) {
// token = null;
// // 获取token失败
// log.error("[UserUtil][getToken]获取token失败 errcode:{} errmsg:{}",
// jsonObject.getInt(errcode),
// jsonObject.getString(errmsg));
// log.error("获取token失败", e);
// }
// }
// return token;
// }
//
// /**
// * 获取用户信息
// *
// * @param accessToken 接口访问凭证
// * @param openId 用户标识
// * @return WeixinUserInfo
// */
// public static WeixinUserInfo getUserInfo(String accessToken, String openId) {
// WeixinUserInfo weixinUserInfo = new WeixinUserInfo();
// // 拼接请求地址
// String requestUrl = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID";
// requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace(
// "OPENID", openId);
// // 获取用户信息
// JSONObject jsonObject = CommonUtil.httpsRequest(requestUrl, "GET", null);
//
// if (null != jsonObject) {
// log.info("[UserUtil][getUserInfo][jsonObject]="
// + jsonObject.toString());
// // 用户的标识
// weixinUserInfo.setOpenId(openId);
// // 关注状态(1是关注,0是未关注),未关注时获取不到其余信息
// weixinUserInfo.setSubscribe(jsonObject.getInt("subscribe"));
// if (jsonObject.getInt("subscribe") == 1) {
// // 用户关注时间
// weixinUserInfo.setSubscribeTime(jsonObject
// .getString("subscribe_time"));
// // 昵称
// weixinUserInfo.setNickname(jsonObject.getString("nickname"));
// // 用户的性别(1是男性,2是女性,0是未知)
// weixinUserInfo.setSex(jsonObject.getInt("sex"));
// // 用户所在国家
// weixinUserInfo.setCountry(jsonObject.getString("country"));
// // 用户所在省份
// weixinUserInfo.setProvince(jsonObject.getString("province"));
// // 用户所在城市
// weixinUserInfo.setCity(jsonObject.getString("city"));
// // 用户的语言,简体中文为zh_CN
// weixinUserInfo.setLanguage(jsonObject.getString("language"));
// // 用户头像
// weixinUserInfo.setHeadImgUrl(jsonObject.getString("headimgurl"));
// }
// }
// return weixinUserInfo;
// }
//
// /**
// * 校验签名
// *
// * @param token 绑定TOKEN
// * @param signature 微信加密签名
// * @param timestamp 时间戳
// * @param nonce 随机数
// * @return
// */
// public static boolean checkSignature(String token, String signature,
// String timestamp, String nonce) {
//
// // 对token、timestamp和nonce按字典排序
// String[] paramArr = new String[]{token, timestamp, nonce};
// Arrays.sort(paramArr);
//
// // 将排序后的结果拼接成一个字符串
// String content = paramArr[0].concat(paramArr[1]).concat(paramArr[2]);
//
// String ciphertext = null;
// try {
// MessageDigest md = MessageDigest.getInstance("SHA-1");
// // 对接后的字符串进行sha1加密
// byte[] digest = md.digest(content.getBytes());
// ciphertext = CommonUtil.byteToStr(digest);
// } catch (NoSuchAlgorithmException e) {
// log.error("验签失败", e);
// }
//
// // 将sha1加密后的字符串与signature进行对比
// log.info("ciphertext:" + ciphertext);
// return ciphertext != null ? ciphertext.equalsIgnoreCase(signature)
// : false;
// }
//
// /**
// * 获取网页授权凭证
// *
// * @param appId 公众账号的唯一标识
// * @param appSecret 公众账号的密钥
// * @param code
// * @return WeixinAouth2Token
// */
// public static WeixinOauth2Token getOauth2AccessToken(String appId,
// String appSecret, String code) {
// WeixinOauth2Token wat = null;
// // 拼接请求地址
// String requestUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
// requestUrl = requestUrl.replace("APPID", appId);
// requestUrl = requestUrl.replace("SECRET", appSecret);
// requestUrl = requestUrl.replace("CODE", code);
// // 获取网页授权凭证
// JSONObject jsonObject = CommonUtil
// .httpsRequest(requestUrl, "GET", null);
// if (null != jsonObject) {
// try {
// wat = new WeixinOauth2Token();
// wat.setAccessToken(jsonObject.getString("access_token"));
// wat.setExpiresIn(jsonObject.getInt("expires_in"));
// wat.setRefreshToken(jsonObject.getString("refresh_token"));
// wat.setOpenId(jsonObject.getString("openid"));
// wat.setScope(jsonObject.getString("scope"));
// } catch (Exception e) {
// wat = null;
// int errorCode = jsonObject.getInt(errcode);
// String errorMsg = jsonObject.getString(errmsg);
// log.error(
// "[UserUtil][getOauth2AccessToken]获取网页授权凭证失败 errcode:{} errmsg:{}",
// errorCode, errorMsg);
// log.error("获取网页授权凭证失败", e);
// }
// }
// return wat;
// }
//
// /**
// * 获取关注者列表
// *
// * @param accessToken 调用接口凭证
// * @param nextOpenId 第一个拉取的openId,不填默认从头开始拉取
// * @return WeixinUserList
// */
// @SuppressWarnings({"unchecked", "deprecation"})
// public static WeixinUserList getUserList(String accessToken,
// String nextOpenId) {
// WeixinUserList weixinUserList = new WeixinUserList();
//
// if (null == nextOpenId)
// nextOpenId = "";
//
// // 拼接请求地址
// String requestUrl = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID";
// requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace(
// "NEXT_OPENID", nextOpenId);
// // 获取关注者列表
// JSONObject jsonObject = CommonUtil
// .httpsRequest(requestUrl, "GET", null);
// // 如果请求成功
// if (null != jsonObject) {
// weixinUserList.setTotal(jsonObject.getInt("total"));
// weixinUserList.setCount(jsonObject.getInt("count"));
// weixinUserList.setNextOpenId(jsonObject
// .getString("next_openid"));
// JSONObject dataObject = (JSONObject) jsonObject.get("data");
// weixinUserList.setOpenIdList(JSONArray.toList(
// dataObject.getJSONArray("openid"), List.class));
//
// }
// return weixinUserList;
// }
//
//}
<?xml version="1.0" encoding="UTF-8"?>
<package_name name="com.puhui.api.zy">
<class_name name="support"></class_name>
<father_class_name name="ZY"></father_class_name>
<implements_name name="获取所支持银行列表"></implements_name>
<!-- 参数:name是参数名,标签内容是备注-->
<parameters>
<!--
<parameter name="openId">openId</parameter>
<parameter name="openId111">openId111</parameter>
<parameter name="productName">商品名称</parameter>
<parameter name="busiId">商户Id(更美)</parameter>
<parameter name="busiName">商户名称 </parameter>
<parameter name="productPrice">商户价格</parameter>
<parameter name="sqlRs">查询结果</parameter>
-->
</parameters>
<initialize_Disable>false</initialize_Disable>
<initializes>
<initialize name="insert">"insert into huimai.bestbuy_sub_busi (busi_id,sub_busi_name,busi_id_third,create_time) "+ "values('999','" + thirdBusi.get("busiName") + "','" + thirdBusi.get("busiId") + "', NOW())"</initialize>
<initialize name="delelt"></initialize>
<initialize name="update"></initialize>
<initialize name="select" value="sqlRs">"selecrt * from word"</initialize>
</initializes>
<handleInput_Disable>false</handleInput_Disable>
<handleInput_replaces>
<handleInput_replace name="openId" type="code" >data_ext.get("openId").toString()</handleInput_replace>
<handleInput_replace name="busiId" type="code" >thirdBusi.get("busiId")</handleInput_replace>
<handleInput_replace name="busiName" type="code" >thirdBusi.get("busiName")</handleInput_replace>
</handleInput_replaces>
<handleInputs_Verifications>
<handleInputs_Verification name="productName"></handleInputs_Verification>
<handleInputs_Verification name="productPrice"></handleInputs_Verification>
</handleInputs_Verifications>
<SendRequest_Disable>true</SendRequest_Disable>
<SendRequest name="Get"></SendRequest>
<handleOutput_Disable>false</handleOutput_Disable>
<handleOutput_saves>
<handleOutput_save name="productId">
<handleOutput>prod_ids.add(productId);</handleOutput>
<handleOutput>data_ext.put("productId", productId);</handleOutput>
</handleOutput_save>
</handleOutput_saves>
<handleOutput_Table name="huimai.bestbuy_goods">"id=" + productId</handleOutput_Table>
</package_name>
<?xml version="1.0" encoding="UTF-8"?>
<package_name name="com.puhui.api.zy">
<class_name name="support"></class_name>
<father_class_name name="ZY"></father_class_name>
<implements_name name="获取所支持银行列表"></implements_name>
<!-- 参数:name是参数名,标签内容是备注-->
<parameters>
<!--
<parameter name="openId">openId</parameter>
<parameter name="openId111">openId111</parameter>
<parameter name="productName">商品名称</parameter>
<parameter name="busiId">商户Id(更美)</parameter>
<parameter name="busiName">商户名称 </parameter>
<parameter name="productPrice">商户价格</parameter>
<parameter name="sqlRs">查询结果</parameter>
-->
</parameters>
<initialize_Disable>false</initialize_Disable>
<initializes>
<initialize name="insert">"insert into huimai.bestbuy_sub_busi (busi_id,sub_busi_name,busi_id_third,create_time) "+ "values('999','" + thirdBusi.get("busiName") + "','" + thirdBusi.get("busiId") + "', NOW())"</initialize>
<initialize name="delelt"></initialize>
<initialize name="update"></initialize>
<initialize name="select" value="sqlRs">"selecrt * from word"</initialize>
</initializes>
<handleInput_Disable>false</handleInput_Disable>
<handleInput_replaces>
<handleInput_replace name="openId" type="code" >data_ext.get("openId").toString()</handleInput_replace>
<handleInput_replace name="busiId" type="code" >thirdBusi.get("busiId")</handleInput_replace>
<handleInput_replace name="busiName" type="code" >thirdBusi.get("busiName")</handleInput_replace>
</handleInput_replaces>
<handleInputs_Verifications>
<handleInputs_Verification name="productName"></handleInputs_Verification>
<handleInputs_Verification name="productPrice"></handleInputs_Verification>
</handleInputs_Verifications>
<SendRequest_Disable>true</SendRequest_Disable>
<SendRequest name="Get"></SendRequest>
<handleOutput_Disable>false</handleOutput_Disable>
<handleOutput_saves>
<handleOutput_save name="productId">
<handleOutput>prod_ids.add(productId);</handleOutput>
<handleOutput>data_ext.put("productId", productId);</handleOutput>
</handleOutput_save>
</handleOutput_saves>
<handleOutput_Table name="huimai.bestbuy_goods">"id=" + productId</handleOutput_Table>
</package_name>
<?xml version="1.0" encoding="UTF-8"?>
<package_name name="com.puhui.api.rgxs">
<class_name name="commitOrderApprove"></class_name>
<father_class_name name="GM"></father_class_name>
<implements_name name="订单模式,人工信审-结论"></implements_name>
<!-- 参数:name是参数名,标签内容是备注-->
<parameters>
<parameter name="Description">用例名称</parameter>
<parameter name="auditRecordId">人工信审工单处理记录表ID</parameter>
<parameter name="audit_result">人工信审结论</parameter>
<parameter name="engine_result">决策引擎结论</parameter>
</parameters>
<initialize_Disable>false</initialize_Disable>
<initializes>
<initialize name="insert">"insert into huimai.bestbuy_sub_busi (busi_id,sub_busi_name,busi_id_third,create_time) "+ "values('999','" + thirdBusi.get("busiName") + "','" + thirdBusi.get("busiId") + "', NOW())"</initialize>
<initialize name="delelt"></initialize>
<initialize name="update"></initialize>
<initialize name="select" value="sqlRs">"selecrt * from word"</initialize>
</initializes>
<handleInput_Disable>true</handleInput_Disable>
<handleInput_replaces>
<handleInput_replace name="auditRecordId" type="code" >thirdBusi.get("busiId")</handleInput_replace>
</handleInput_replaces>
<handleInputs_Verifications>
<handleInputs_Verification name="audit_result"></handleInputs_Verification>
<handleInputs_Verification name="engine_result"></handleInputs_Verification>
</handleInputs_Verifications>
<SendRequest_Disable>true</SendRequest_Disable>
<SendRequest name="Post"></SendRequest>
<handleOutput_Disable>true</handleOutput_Disable>
<handleOutput_saves>
<handleOutput_save name="productId">
<handleOutput>prod_ids.add(productId);</handleOutput>
<handleOutput>data_ext.put("productId", productId);</handleOutput>
</handleOutput_save>
</handleOutput_saves>
<handleOutput_Table name="huimai.bestbuy_goods">"id=" + productId</handleOutput_Table>
</package_name>
<?xml version="1.0" encoding="UTF-8"?>
<package_name name="com.puhui.api.rgxs">
<class_name name="commitOrderApprove"></class_name>
<father_class_name name="GM"></father_class_name>
<implements_name name="订单模式,人工信审-结论"></implements_name>
<!-- 参数:name是参数名,标签内容是备注-->
<parameters>
<parameter name="Description">用例名称</parameter>
<parameter name="auditRecordId">人工信审工单处理记录表ID</parameter>
<parameter name="audit_result">人工信审结论</parameter>
<parameter name="engine_result">决策引擎结论</parameter>
</parameters>
<initialize_Disable>false</initialize_Disable>
<initializes>
<initialize name="insert">"insert into huimai.bestbuy_sub_busi (busi_id,sub_busi_name,busi_id_third,create_time) "+ "values('999','" + thirdBusi.get("busiName") + "','" + thirdBusi.get("busiId") + "', NOW())"</initialize>
<initialize name="delelt"></initialize>
<initialize name="update"></initialize>
<initialize name="select" value="sqlRs">"selecrt * from word"</initialize>
</initializes>
<handleInput_Disable>true</handleInput_Disable>
<handleInput_replaces>
<handleInput_replace name="auditRecordId" type="code" >thirdBusi.get("busiId")</handleInput_replace>
</handleInput_replaces>
<handleInputs_Verifications>
<handleInputs_Verification name="audit_result"></handleInputs_Verification>
<handleInputs_Verification name="engine_result"></handleInputs_Verification>
</handleInputs_Verifications>
<SendRequest_Disable>true</SendRequest_Disable>
<SendRequest name="Post"></SendRequest>
<handleOutput_Disable>true</handleOutput_Disable>
<handleOutput_saves>
<handleOutput_save name="productId">
<handleOutput>prod_ids.add(productId);</handleOutput>
<handleOutput>data_ext.put("productId", productId);</handleOutput>
</handleOutput_save>
</handleOutput_saves>
<handleOutput_Table name="huimai.bestbuy_goods">"id=" + productId</handleOutput_Table>
</package_name>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment