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