├── .idea ├── AutoTest.iml ├── compiler.xml ├── encodings.xml ├── inspectionProfiles │ └── Project_Default.xml ├── libraries │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ ├── Maven__com_alibaba_fastjson_1_2_51.xml │ ├── Maven__com_aventstack_extentreports_3_1_5.xml │ ├── Maven__com_aventstack_extentreports_4_0_0.xml │ ├── Maven__com_beust_jcommander_1_72.xml │ ├── Maven__com_fasterxml_classmate_1_4_0.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_5.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_9_6.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_9_7.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_6.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_7.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_6.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_7.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_6.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_7.xml │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_6.xml │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_7.xml │ ├── Maven__com_google_code_gson_gson_2_8_0.xml │ ├── Maven__com_google_code_gson_gson_2_8_5.xml │ ├── Maven__com_google_guava_guava_20_0.xml │ ├── Maven__com_google_protobuf_protobuf_java_3_6_1.xml │ ├── Maven__com_relevantcodes_extentreports_2_41_2.xml │ ├── Maven__com_vimalselvam_testng_extentsreport_1_3_1.xml │ ├── Maven__com_zaxxer_HikariCP_3_2_0.xml │ ├── Maven__commons_codec_commons_codec_1_10.xml │ ├── Maven__commons_codec_commons_codec_1_6.xml │ ├── Maven__commons_codec_commons_codec_1_9.xml │ ├── Maven__commons_logging_commons_logging_1_1_1.xml │ ├── Maven__commons_logging_commons_logging_1_2.xml │ ├── Maven__io_springfox_springfox_core_2_9_2.xml │ ├── Maven__io_springfox_springfox_schema_2_9_2.xml │ ├── Maven__io_springfox_springfox_spi_2_9_2.xml │ ├── Maven__io_springfox_springfox_spring_web_2_9_2.xml │ ├── Maven__io_springfox_springfox_swagger2_2_9_2.xml │ ├── Maven__io_springfox_springfox_swagger_common_2_9_2.xml │ ├── Maven__io_springfox_springfox_swagger_ui_2_9_2.xml │ ├── Maven__io_swagger_swagger_annotations_1_5_20.xml │ ├── Maven__io_swagger_swagger_models_1_5_20.xml │ ├── Maven__javax_annotation_javax_annotation_api_1_3_2.xml │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ ├── Maven__log4j_log4j_1_2_17.xml │ ├── Maven__mysql_mysql_connector_java_5_1_46.xml │ ├── Maven__mysql_mysql_connector_java_8_0_13.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_8_12.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_9_3.xml │ ├── Maven__org_apache_extras_beanshell_bsh_2_0b6.xml │ ├── Maven__org_apache_httpcomponents_httpclient_4_2_3.xml │ ├── Maven__org_apache_httpcomponents_httpclient_4_5_2.xml │ ├── Maven__org_apache_httpcomponents_httpclient_4_5_6.xml │ ├── Maven__org_apache_httpcomponents_httpcore_4_2_2.xml │ ├── Maven__org_apache_httpcomponents_httpcore_4_4_10.xml │ ├── Maven__org_apache_httpcomponents_httpcore_4_4_4.xml │ ├── Maven__org_apache_httpcomponents_httpmime_4_5_2.xml │ ├── Maven__org_apache_logging_log4j_log4j_api_2_10_0.xml │ ├── Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_10_0.xml │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_32.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_12.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_32.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_12.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_32.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_12.xml │ ├── Maven__org_apache_tomcat_tomcat_jdbc_8_5_16.xml │ ├── Maven__org_apache_tomcat_tomcat_juli_8_5_16.xml │ ├── Maven__org_freemarker_freemarker_2_3_23.xml │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_11_Final.xml │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_13_Final.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml │ ├── Maven__org_json_json_20180813.xml │ ├── Maven__org_jsoup_jsoup_1_8_3.xml │ ├── Maven__org_mapstruct_mapstruct_1_2_0_Final.xml │ ├── Maven__org_mongodb_bson_3_0_4.xml │ ├── Maven__org_mongodb_bson_3_3_0.xml │ ├── Maven__org_mongodb_mongodb_driver_3_0_4.xml │ ├── Maven__org_mongodb_mongodb_driver_core_3_0_4.xml │ ├── Maven__org_mybatis_mybatis_3_4_5.xml │ ├── Maven__org_mybatis_mybatis_3_4_6.xml │ ├── Maven__org_mybatis_mybatis_spring_1_3_1.xml │ ├── Maven__org_mybatis_mybatis_spring_1_3_2.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_1.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_2.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_1.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_2.xml │ ├── Maven__org_projectlombok_lombok_1_16_14.xml │ ├── Maven__org_projectlombok_lombok_1_18_4.xml │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_25.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_25.xml │ ├── Maven__org_springframework_boot_spring_boot_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_0_4_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_0_RELEASE.xml │ ├── Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml │ ├── Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml │ ├── Maven__org_springframework_spring_aop_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_aop_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_context_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_context_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_core_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_core_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_expression_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_expression_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_jcl_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_jcl_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_tx_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_tx_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_web_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_web_5_1_2_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_5_0_8_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_5_1_2_RELEASE.xml │ ├── Maven__org_testng_testng_6_14_3.xml │ ├── Maven__org_testng_testng_7_0_0_beta1.xml │ ├── Maven__org_xerial_sqlite_jdbc_3_8_11_1.xml │ ├── Maven__org_yaml_snakeyaml_1_19.xml │ └── Maven__org_yaml_snakeyaml_1_23.xml ├── misc.xml ├── modules.xml ├── uiDesigner.xml ├── vcs.xml └── workspace.xml ├── Chapter10 ├── Chapter10.iml ├── README.md ├── pom.xml ├── src │ └── main │ │ ├── java │ │ ├── Application.java │ │ ├── hello │ │ │ └── SampleController.java │ │ └── org │ │ │ └── alanhou │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── config │ │ │ └── SwaggerConfig.java │ │ │ └── server │ │ │ ├── MyGetMethod.java │ │ │ └── MyPostMethod.java │ │ └── resources │ │ └── application.properties └── target │ └── classes │ ├── Application.class │ ├── application.properties │ ├── hello │ └── SampleController.class │ └── org │ └── alanhou │ ├── bean │ └── User.class │ ├── config │ └── SwaggerConfig.class │ └── server │ ├── MyGetMethod.class │ └── MyPostMethod.class ├── Chapter11 ├── Chapter11.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── alanhou │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── Demo.java │ │ │ └── model │ │ │ └── User.java │ │ └── resources │ │ ├── application.yml │ │ ├── logback.xml │ │ ├── mapper │ │ └── mysql.xml │ │ └── mybatis-config.xml └── target │ └── classes │ ├── application.yml │ ├── logback.xml │ ├── mapper │ └── mysql.xml │ └── mybatis-config.xml ├── Chapter12 ├── Chapter12.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── alanhou │ │ │ ├── cases │ │ │ ├── AddUserTest.java │ │ │ ├── GetUserInfoListTest.java │ │ │ ├── GetUserInfoTest.java │ │ │ ├── LoginTest.java │ │ │ └── UpdateUserInfoTest.java │ │ │ ├── config │ │ │ ├── ExtentTestNGIReporterListener.java │ │ │ └── TestConfig.java │ │ │ ├── model │ │ │ ├── AddUserCase.java │ │ │ ├── GetUserInfoCase.java │ │ │ ├── GetUserListCase.java │ │ │ ├── InterfaceName.java │ │ │ ├── LoginCase.java │ │ │ ├── UpdateUserInfoCase.java │ │ │ └── User.java │ │ │ └── utils │ │ │ ├── ConfigFile.java │ │ │ └── DatabaseUtil.java │ │ └── resources │ │ ├── application.properties │ │ ├── databaseConfig.xml │ │ ├── mapper │ │ └── SQLMapper.xml │ │ └── testng.xml ├── target │ └── classes │ │ ├── application.properties │ │ ├── databaseConfig.xml │ │ ├── mapper │ │ └── SQLMapper.xml │ │ ├── org │ │ └── alanhou │ │ │ ├── cases │ │ │ ├── AddUserTest.class │ │ │ ├── GetUserInfoListTest.class │ │ │ ├── GetUserInfoTest.class │ │ │ ├── LoginTest.class │ │ │ └── UpdateUserInfoTest.class │ │ │ ├── config │ │ │ ├── ExtentTestNGIReporterListener$1.class │ │ │ ├── ExtentTestNGIReporterListener.class │ │ │ └── TestConfig.class │ │ │ ├── model │ │ │ ├── AddUserCase.class │ │ │ ├── GetUserInfoCase.class │ │ │ ├── GetUserListCase.class │ │ │ ├── InterfaceName.class │ │ │ ├── LoginCase.class │ │ │ ├── UpdateUserInfoCase.class │ │ │ └── User.class │ │ │ └── utils │ │ │ ├── ConfigFile.class │ │ │ └── DatabaseUtil.class │ │ └── testng.xml └── test-output │ └── index.html ├── Chapter13 ├── Chapter13.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── alanhou │ │ │ ├── Application.java │ │ │ ├── config │ │ │ └── SwaggerConfig.java │ │ │ ├── controller │ │ │ └── UserManager.java │ │ │ └── model │ │ │ └── User.java │ │ └── resources │ │ ├── application.yml │ │ ├── logback.xml │ │ ├── mapper │ │ └── mysql.xml │ │ └── mybatis-config.xml └── target │ └── classes │ ├── application.yml │ ├── logback.xml │ ├── mapper │ └── mysql.xml │ ├── mybatis-config.xml │ └── org │ └── alanhou │ ├── Application.class │ ├── config │ └── SwaggerConfig.class │ ├── controller │ └── UserManager.class │ └── model │ └── User.class ├── Chapter5 ├── Chapter5.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── alanhou │ │ │ └── testng │ │ │ ├── BasicAnnotation.java │ │ │ ├── DependencyTest.java │ │ │ ├── ExpectedException.java │ │ │ ├── IgnoreTest.java │ │ │ ├── TimeOutTest.java │ │ │ ├── groups │ │ │ ├── GroupsOnClass1.java │ │ │ ├── GroupsOnClass2.java │ │ │ ├── GroupsOnClass3.java │ │ │ └── GroupsOnMethod.java │ │ │ ├── multiThread │ │ │ ├── MultiThreadOnAnnotation.java │ │ │ └── MultiThreadOnXml.java │ │ │ ├── parameter │ │ │ ├── DataProviderTest.java │ │ │ └── ParameterTest.java │ │ │ └── suite │ │ │ ├── LoginTest.java │ │ │ ├── PayTest.java │ │ │ └── SuiteConfig.java │ │ └── resources │ │ ├── groupsOnClass.xml │ │ ├── multiThread.xml │ │ ├── parameter.xml │ │ └── suite.xml └── target │ └── classes │ └── org │ └── alanhou │ └── testng │ ├── BasicAnnotation.class │ ├── DependencyTest.class │ ├── ExpectedException.class │ ├── IgnoreTest.class │ ├── TimeOutTest.class │ ├── groups │ ├── GroupsOnClass1.class │ ├── GroupsOnClass2.class │ ├── GroupsOnClass3.class │ └── GroupsOnMethod.class │ ├── multiThread │ ├── MultiThreadOnAnnotation.class │ └── MultiThreadOnXml.class │ ├── parameter │ ├── DataProviderTest.class │ └── ParameterTest.class │ └── suite │ ├── LoginTest.class │ ├── PayTest.class │ └── SuiteConfig.class ├── Chapter6 ├── Chapter6.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── tester │ │ │ └── extend │ │ │ └── demo │ │ │ ├── ExtentTestNGIReporterListener.java │ │ │ ├── ExtentTestNGIReporterListenerOld.java │ │ │ └── TestMethodsDemo.java │ │ └── resources │ │ └── testng.xml ├── target │ └── classes │ │ ├── com │ │ └── tester │ │ │ └── extend │ │ │ └── demo │ │ │ ├── ExtentTestNGIReporterListener$1.class │ │ │ ├── ExtentTestNGIReporterListener.class │ │ │ ├── ExtentTestNGIReporterListenerOld$1.class │ │ │ ├── ExtentTestNGIReporterListenerOld.class │ │ │ └── TestMethodsDemo.class │ │ └── testng.xml └── test-output │ ├── emailable-report.html │ ├── index.html │ └── report.html ├── Chapter7 ├── README.md ├── moco-runner-0.12.0-standalone.jar ├── startup1.json ├── startupGet.json ├── startupPost.json ├── startupWithCookies.json ├── startupWithHeader.json └── startupWithRedirect.json ├── Chapter9 ├── Chapter9.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── alanhou │ │ │ └── httpclient │ │ │ ├── cookies │ │ │ ├── MyCookiesForPost.java │ │ │ └── MyCookiesFotGet.java │ │ │ └── demo │ │ │ └── MyHttpClient.java │ │ └── resources │ │ └── application.properties └── target │ └── classes │ ├── application.properties │ └── org │ └── alanhou │ └── httpclient │ ├── cookies │ ├── MyCookiesForPost.class │ └── MyCookiesFotGet.class │ └── demo │ └── MyHttpClient.class ├── README.md ├── logs ├── event.log ├── mylog.log ├── userManager.log ├── userManager.log.2018-11-11 └── userManager.log.2018-11-12 └── pom.xml /.idea/AutoTest.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_51.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aventstack_extentreports_3_1_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aventstack_extentreports_4_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_beust_jcommander_1_72.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_gson_gson_2_8_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_guava_guava_20_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_relevantcodes_extentreports_2_41_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_vimalselvam_testng_extentsreport_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_zaxxer_HikariCP_3_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_core_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_schema_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_spi_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_spring_web_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_swagger2_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_20.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_swagger_swagger_models_1_5_20.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__log4j_log4j_1_2_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_5_1_46.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_8_0_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_8_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_extras_beanshell_bsh_2_0b6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpmime_4_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_10_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_10_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_tomcat_jdbc_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_tomcat_juli_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_freemarker_freemarker_2_3_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_11_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_13_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_json_json_20180813.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jsoup_jsoup_1_8_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mongodb_bson_3_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mongodb_bson_3_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mongodb_mongodb_driver_3_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mongodb_mongodb_driver_core_3_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_3_4_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_3_4_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_spring_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_spring_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_projectlombok_lombok_1_16_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_projectlombok_lombok_1_18_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jcl_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jcl_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_5_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_testng_testng_6_14_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_testng_testng_7_0_0_beta1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xerial_sqlite_jdbc_3_8_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter10/README.md: -------------------------------------------------------------------------------- 1 | ## Swagger 访问地址 2 | 3 | http://localhost:8888/swagger-ui.html 4 | 5 | 测试可使用 Jmeter 进行配合,在 debug 时显示 Cookies 需编辑 jmeter.properties 6 | 7 | 修改如下内容 8 | 9 | CookieManager.save.cookies=true 10 | -------------------------------------------------------------------------------- /Chapter10/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alanhou.java 8 | Chapter10 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 2.1.0.RELEASE 15 | 16 | 17 | 18 | RELEASE 19 | 20 | 21 | 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-web 26 | 27 | 28 | io.springfox 29 | springfox-swagger2 30 | ${swagger.version} 31 | 32 | 33 | io.springfox 34 | springfox-swagger-ui 35 | ${swagger.version} 36 | 37 | 38 | org.projectlombok 39 | lombok 40 | 1.16.14 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Chapter10/src/main/java/Application.java: -------------------------------------------------------------------------------- 1 | import org.springframework.boot.SpringApplication; 2 | import org.springframework.boot.autoconfigure.SpringBootApplication; 3 | import org.springframework.context.annotation.ComponentScan; 4 | 5 | @SpringBootApplication 6 | @ComponentScan("org.alanhou") 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class,args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter10/src/main/java/hello/SampleController.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import org.springframework.boot.*; 4 | import org.springframework.boot.autoconfigure.*; 5 | import org.springframework.stereotype.*; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | @Controller 9 | @EnableAutoConfiguration 10 | public class SampleController { 11 | 12 | @RequestMapping("/") 13 | @ResponseBody 14 | String home(){ 15 | return "Hello World!"; 16 | } 17 | 18 | public static void main(String[] args) throws Exception{ 19 | SpringApplication.run(SampleController.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Chapter10/src/main/java/org/alanhou/bean/User.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.bean; 2 | 3 | import lombok.Data; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Data 8 | public class User { 9 | 10 | private String userName; 11 | private String password; 12 | private String name; 13 | private String age; 14 | private String sex; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Chapter10/src/main/java/org/alanhou/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | @Configuration 14 | @EnableSwagger2 15 | public class SwaggerConfig { 16 | 17 | @Bean 18 | public Docket api(){ 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .pathMapping("/") 22 | .select() 23 | .paths(PathSelectors.regex("/.*")) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo(){ 28 | return new ApiInfoBuilder().title("我的接口文档") 29 | .contact(new Contact("alan","","demo@domain.com")) 30 | .description("这是 SwaggerUI 生成的接口文档") 31 | .version("1.0.0.1") 32 | .build(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Chapter10/src/main/java/org/alanhou/server/MyPostMethod.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.server; 2 | 3 | 4 | import io.swagger.annotations.Api; 5 | import io.swagger.annotations.ApiOperation; 6 | import org.alanhou.bean.User; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | import javax.servlet.http.Cookie; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | @RestController 14 | @Api(value = "/",description = "这是全部的 POST 请求") 15 | @RequestMapping("/v1") 16 | public class MyPostMethod { 17 | // 用于装 Cookies 信息的变量 18 | private static Cookie cookie; 19 | 20 | // 模拟用户登录成功获取到 Cookies,然后再访问其它接口获取列表 21 | @RequestMapping(value = "/login", method = RequestMethod.POST) 22 | @ApiOperation(value = "登录接口,成功后获取 Cookies 信息",httpMethod = "POST") 23 | public String login(HttpServletResponse response, 24 | @RequestParam(value = "userName", required = true) String userName, 25 | @RequestParam(value = "password", required = true) String password){ 26 | if(userName.equals("jack") && password.equals("123456")){ 27 | cookie = new Cookie("login", "true"); 28 | response.addCookie(cookie); 29 | return "恭喜你登录成功了!"; 30 | } 31 | return "用户名或密码错误!"; 32 | } 33 | 34 | @RequestMapping(value = "/getUserList",method = RequestMethod.POST) 35 | @ApiOperation(value = "获取用户列表",httpMethod = "POST") 36 | public String getUserList(HttpServletRequest request, 37 | @RequestBody User u){ 38 | User user; 39 | // 获取 cookies 40 | Cookie[] cookies = request.getCookies(); 41 | // 验证 cookies 是否合法 42 | for(Cookie c : cookies){ 43 | if(c.getName().equals("login") 44 | && c.getValue().equals("true") 45 | && u.getUserName().equals("jack") 46 | && u.getPassword().equals("123456") 47 | ){ 48 | user = new User(); 49 | user.setName("rose"); 50 | user.setAge("18"); 51 | user.setSex("male"); 52 | return user.toString(); 53 | } 54 | } 55 | return "参数不合法"; 56 | } 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /Chapter10/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${port:8888} -------------------------------------------------------------------------------- /Chapter10/target/classes/Application.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter10/target/classes/Application.class -------------------------------------------------------------------------------- /Chapter10/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${port:8888} -------------------------------------------------------------------------------- /Chapter10/target/classes/hello/SampleController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter10/target/classes/hello/SampleController.class -------------------------------------------------------------------------------- /Chapter10/target/classes/org/alanhou/bean/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter10/target/classes/org/alanhou/bean/User.class -------------------------------------------------------------------------------- /Chapter10/target/classes/org/alanhou/config/SwaggerConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter10/target/classes/org/alanhou/config/SwaggerConfig.class -------------------------------------------------------------------------------- /Chapter10/target/classes/org/alanhou/server/MyGetMethod.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter10/target/classes/org/alanhou/server/MyGetMethod.class -------------------------------------------------------------------------------- /Chapter10/target/classes/org/alanhou/server/MyPostMethod.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter10/target/classes/org/alanhou/server/MyPostMethod.class -------------------------------------------------------------------------------- /Chapter11/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alanhou.java 8 | Chapter11 9 | 1.0-SNAPSHOT 10 | 11 | 12 | RELEASE 13 | 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-web 19 | 2.0.4.RELEASE 20 | 21 | 22 | io.springfox 23 | springfox-swagger-ui 24 | ${swagger.version} 25 | 26 | 27 | io.springfox 28 | springfox-swagger2 29 | ${swagger.version} 30 | 31 | 32 | org.projectlombok 33 | lombok 34 | 1.16.14 35 | 36 | 37 | com.alibaba 38 | fastjson 39 | [1.2.31,) 40 | 41 | 42 | mysql 43 | mysql-connector-java 44 | 5.1.46 45 | 46 | 47 | org.mybatis.spring.boot 48 | mybatis-spring-boot-starter 49 | 1.3.1 50 | 51 | 52 | log4j 53 | log4j 54 | 1.2.17 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Chapter11/src/main/java/org/alanhou/Application.java: -------------------------------------------------------------------------------- 1 | package org.alanhou; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.ConfigurableApplicationContext; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | import javax.annotation.PreDestroy; 9 | 10 | @EnableScheduling 11 | @SpringBootApplication 12 | public class Application { 13 | private static ConfigurableApplicationContext context; 14 | 15 | public static void main(String[] args) { 16 | Application.context = SpringApplication.run(Application.class,args); 17 | } 18 | 19 | @PreDestroy 20 | public void close(){ 21 | Application.context.close(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter11/src/main/java/org/alanhou/controller/Demo.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.controller; 2 | 3 | import io.swagger.annotations.Api; 4 | import io.swagger.annotations.ApiOperation; 5 | import lombok.extern.log4j.Log4j; 6 | import org.alanhou.model.User; 7 | import org.mybatis.spring.SqlSessionTemplate; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | @Log4j 13 | @RestController 14 | @Api(value = "v1",description = "这是第一个版本的 demo") 15 | @RequestMapping("v1") 16 | public class Demo { 17 | 18 | // 首先获取一个执行 sql 语句的对象 19 | 20 | @Autowired 21 | private SqlSessionTemplate template; 22 | 23 | @RequestMapping(value = "/getUserCount",method = RequestMethod.GET) 24 | @ApiOperation(value = "可以获取到的用户数",httpMethod = "GET") 25 | public int getUserCount(){ 26 | // getUserCount对应 mysql.xml 中的配置 27 | return template.selectOne("getUserCount"); 28 | } 29 | 30 | @RequestMapping(value = "/addUser",method = RequestMethod.POST) 31 | public int addUser(@RequestBody User user){ 32 | return template.insert("addUser",user); 33 | } 34 | 35 | @RequestMapping(value = "/updateUser",method = RequestMethod.POST) 36 | public int updateUser(@RequestBody User user){ 37 | return template.update("updateUser",user); 38 | } 39 | 40 | @RequestMapping(value = "/deleteUser",method = RequestMethod.POST) 41 | public int delUser(@RequestParam int id){ 42 | return template.delete("deleteUser",id); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Chapter11/src/main/java/org/alanhou/model/User.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | private int id; 8 | private String name; 9 | private String sex; 10 | private int age; 11 | } 12 | -------------------------------------------------------------------------------- /Chapter11/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | 4 | logging: 5 | path: logs 6 | file: mylog.log 7 | 8 | spring: 9 | application: 10 | name: myTest 11 | datasource: 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://127.0.0.1:3306/test 14 | username: root 15 | password: 16 | 17 | mybatis: 18 | type-aliases-package: org.alanhou.model 19 | mapper-locations: 20 | - mapper/* -------------------------------------------------------------------------------- /Chapter11/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ${LOG_PATH}/${LOG_FILE} 9 | 10 | ${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd} 11 | 12 | 13 | ${FILE_LOG_PATTERN} 14 | 15 | 16 | 17 | 18 | 19 | 20 | ${FILE_LOG_PATTERN} 21 | 22 | 23 | 24 | 25 | 26 | ${LOG_PATH}/event.log 27 | 28 | ${LOG_PATH}/event.%d{yyyy-MM-dd}.log 29 | 30 30 | 31 | 32 | %msg%n 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Chapter11/src/main/resources/mapper/mysql.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 11 | 12 | insert into user(id,name,age,sex) 13 | values(#{id},#{name},#{age},#{sex}); 14 | 15 | 16 | 17 | update user set name=#{name},age=#{age} 18 | where id=#{id}; 19 | 20 | 21 | 22 | delete from user where id = #{id} 23 | 24 | -------------------------------------------------------------------------------- /Chapter11/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter11/target/classes/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | 4 | logging: 5 | path: logs 6 | file: mylog.log 7 | 8 | spring: 9 | application: 10 | name: myTest 11 | datasource: 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://127.0.0.1:3306/test 14 | username: root 15 | password: 16 | 17 | mybatis: 18 | type-aliases-package: org.alanhou.model 19 | mapper-locations: 20 | - mapper/* -------------------------------------------------------------------------------- /Chapter11/target/classes/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ${LOG_PATH}/${LOG_FILE} 9 | 10 | ${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd} 11 | 12 | 13 | ${FILE_LOG_PATTERN} 14 | 15 | 16 | 17 | 18 | 19 | 20 | ${FILE_LOG_PATTERN} 21 | 22 | 23 | 24 | 25 | 26 | ${LOG_PATH}/event.log 27 | 28 | ${LOG_PATH}/event.%d{yyyy-MM-dd}.log 29 | 30 30 | 31 | 32 | %msg%n 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Chapter11/target/classes/mapper/mysql.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 11 | 12 | insert into user(id,name,age,sex) 13 | values(#{id},#{name},#{age},#{sex}); 14 | 15 | 16 | 17 | update user set name=#{name},age=#{age} 18 | where id=#{id}; 19 | 20 | 21 | 22 | delete from user where id = #{id} 23 | 24 | -------------------------------------------------------------------------------- /Chapter11/target/classes/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/cases/AddUserTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.cases; 2 | 3 | import org.alanhou.config.TestConfig; 4 | import org.alanhou.model.AddUserCase; 5 | import org.alanhou.model.User; 6 | import org.alanhou.utils.DatabaseUtil; 7 | import org.apache.http.HttpResponse; 8 | import org.apache.http.client.methods.HttpPost; 9 | import org.apache.http.entity.StringEntity; 10 | import org.apache.http.util.EntityUtils; 11 | import org.apache.ibatis.session.SqlSession; 12 | import org.json.JSONObject; 13 | import org.testng.Assert; 14 | import org.testng.annotations.Test; 15 | 16 | import java.io.IOException; 17 | 18 | public class AddUserTest { 19 | 20 | @Test(dependsOnGroups = "loginTrue",description = "添加用户接口测试") 21 | public void addUser() throws IOException, InterruptedException { 22 | SqlSession session = DatabaseUtil.getSqlSession(); 23 | AddUserCase addUserCase = session.selectOne("addUserCase",1); 24 | System.out.println(addUserCase.toString()); 25 | System.out.println(TestConfig.addUserUrl); 26 | 27 | // 发请求,获取结果 28 | String result = getResult(addUserCase); 29 | // 验证返回结果 30 | Thread.sleep(3000); 31 | User user = session.selectOne("addUser",addUserCase); 32 | System.out.println(user.toString()); 33 | Assert.assertEquals(addUserCase.getExpected(),result); 34 | 35 | } 36 | 37 | private String getResult(AddUserCase addUserCase) throws IOException { 38 | HttpPost post = new HttpPost(TestConfig.addUserUrl); 39 | JSONObject param = new JSONObject(); 40 | param.put("userName",addUserCase.getUserName()); 41 | param.put("password",addUserCase.getPassword()); 42 | param.put("sex",addUserCase.getSex()); 43 | param.put("age",addUserCase.getAge()); 44 | param.put("permission",addUserCase.getPermission()); 45 | param.put("isDelete",addUserCase.getIsDelete()); 46 | 47 | // 设置头信息 48 | post.setHeader("content-type","application/json"); 49 | StringEntity entity = new StringEntity(param.toString(),"utf-8"); 50 | post.setEntity(entity); 51 | 52 | // 设置 cookies 53 | TestConfig.defaultHttpClient.setCookieStore(TestConfig.store); 54 | 55 | String result; // 存放返回结果 56 | HttpResponse response = TestConfig.defaultHttpClient.execute(post); 57 | result = EntityUtils.toString(response.getEntity(),"utf-8"); 58 | 59 | System.out.println(result); 60 | return result; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/cases/GetUserInfoTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.cases; 2 | 3 | import org.alanhou.config.TestConfig; 4 | import org.alanhou.model.GetUserInfoCase; 5 | import org.alanhou.model.User; 6 | import org.alanhou.utils.DatabaseUtil; 7 | import org.apache.http.HttpResponse; 8 | import org.apache.http.client.methods.HttpPost; 9 | import org.apache.http.entity.StringEntity; 10 | import org.apache.http.util.EntityUtils; 11 | import org.apache.ibatis.session.SqlSession; 12 | import org.json.JSONArray; 13 | import org.json.JSONObject; 14 | import org.testng.Assert; 15 | import org.testng.annotations.Test; 16 | 17 | import java.io.IOException; 18 | import java.util.ArrayList; 19 | import java.util.Arrays; 20 | import java.util.List; 21 | 22 | public class GetUserInfoTest { 23 | 24 | @Test(dependsOnGroups = "loginTrue", description = "获取 userId 为1的用户信息") 25 | public void getUserInfo() throws IOException { 26 | SqlSession session = DatabaseUtil.getSqlSession(); 27 | GetUserInfoCase getUserInfoCase = session.selectOne("getUserInfoCase",1); 28 | System.out.println(getUserInfoCase.toString()); 29 | System.out.println(TestConfig.getUserInfoUrl); 30 | 31 | JSONArray resultJson = getJsonResult(getUserInfoCase); 32 | 33 | User user = session.selectOne(getUserInfoCase.getExpected(),getUserInfoCase); 34 | 35 | List userList = new ArrayList(); 36 | userList.add(user); 37 | 38 | JSONArray jsonArray = new JSONArray((userList)); 39 | JSONArray jsonArray1 = new JSONArray(resultJson.getString(0)); 40 | 41 | Assert.assertEquals(jsonArray.toString(),jsonArray1.toString()); 42 | } 43 | 44 | private JSONArray getJsonResult(GetUserInfoCase getUserInfoCase) throws IOException { 45 | HttpPost post = new HttpPost(TestConfig.getUserInfoUrl); 46 | JSONObject param = new JSONObject(); 47 | param.put("id",getUserInfoCase.getUserId()); 48 | 49 | post.setHeader("content-type","application/json"); 50 | 51 | StringEntity entity = new StringEntity(param.toString(),"utf-8"); 52 | 53 | post.setEntity(entity); 54 | 55 | TestConfig.defaultHttpClient.setCookieStore(TestConfig.store); 56 | 57 | String result; 58 | HttpResponse response = TestConfig.defaultHttpClient.execute(post); 59 | 60 | result = EntityUtils.toString(response.getEntity(),"utf-8"); 61 | 62 | List resultList = Arrays.asList(result); 63 | JSONArray array = new JSONArray(resultList); 64 | 65 | return array; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/config/TestConfig.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.config; 2 | 3 | import org.apache.http.client.CookieStore; 4 | import org.apache.http.impl.client.DefaultHttpClient; 5 | 6 | public class TestConfig { 7 | public static String loginUrl; 8 | public static String updateUserInfoUrl; 9 | public static String getUserListUrl; 10 | public static String getUserInfoUrl; 11 | public static String addUserUrl; 12 | 13 | // DefaultHttpClient deprecated 替换 14 | public static DefaultHttpClient defaultHttpClient; 15 | // public static HttpClient defaultHttpClient; 16 | // public static HttpClientBuilder httpClientBuilder; 17 | public static CookieStore store; 18 | } 19 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/AddUserCase.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AddUserCase { 7 | private String userName; 8 | private String password; 9 | private String sex; 10 | private String age; 11 | private String permission; 12 | private String isDelete; 13 | private String expected; 14 | } 15 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/GetUserInfoCase.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GetUserInfoCase { 7 | private int userId; 8 | private String expected; 9 | } 10 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/GetUserListCase.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GetUserListCase { 7 | private String userName; 8 | private String age; 9 | private String sex; 10 | private String expected; 11 | } 12 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/InterfaceName.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | public enum InterfaceName { 4 | GETUSERLIST,LOGIN,UPDATEUSERINFO,GETUSERINFO,ADDUSERINFO 5 | } 6 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/LoginCase.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginCase { 7 | private int id; 8 | private String userName; 9 | private String password; 10 | private String expected; 11 | } 12 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/UpdateUserInfoCase.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class UpdateUserInfoCase { 7 | private int id; 8 | private int userId; 9 | private String userName; 10 | private String sex; 11 | private String age; 12 | private String permission; 13 | private String isDelete; 14 | private String expected; 15 | } 16 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/model/User.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | 8 | private int id; 9 | private String userName; 10 | private String password; 11 | private String age; 12 | private String sex; 13 | private String permission; 14 | private String isDelete; 15 | 16 | @Override 17 | public String toString(){ 18 | return( 19 | "{id:"+id+","+ 20 | "userName:"+userName+","+ 21 | "password:"+password+","+ 22 | "age:"+age+","+ 23 | "sex:"+sex+","+ 24 | "permission:"+permission+","+ 25 | "isDelete:"+isDelete+"}" 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/utils/ConfigFile.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.utils; 2 | 3 | import org.alanhou.model.InterfaceName; 4 | 5 | import java.util.Locale; 6 | import java.util.ResourceBundle; 7 | 8 | public class ConfigFile { 9 | private static ResourceBundle bundle = ResourceBundle.getBundle("application", Locale.CHINA); 10 | 11 | public static String getUrl(InterfaceName name){ 12 | String address = bundle.getString("test.url"); 13 | String uri = ""; 14 | // 最终的测试地址 15 | String testUrl; 16 | 17 | if(name == InterfaceName.GETUSERLIST){ 18 | uri = bundle.getString("getUserList.uri"); 19 | } 20 | 21 | if(name == InterfaceName.LOGIN){ 22 | uri = bundle.getString("login.uri"); 23 | } 24 | 25 | if(name == InterfaceName.UPDATEUSERINFO){ 26 | uri = bundle.getString("updateUserInfo.uri"); 27 | } 28 | 29 | if(name == InterfaceName.GETUSERINFO){ 30 | uri = bundle.getString("getUserInfo.uri"); 31 | } 32 | 33 | if(name == InterfaceName.ADDUSERINFO){ 34 | uri = bundle.getString("addUser.uri"); 35 | } 36 | 37 | testUrl = address + uri; 38 | return testUrl; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Chapter12/src/main/java/org/alanhou/utils/DatabaseUtil.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.utils; 2 | 3 | import org.apache.ibatis.io.Resources; 4 | import org.apache.ibatis.session.SqlSession; 5 | import org.apache.ibatis.session.SqlSessionFactory; 6 | import org.apache.ibatis.session.SqlSessionFactoryBuilder; 7 | 8 | import java.io.IOException; 9 | import java.io.Reader; 10 | 11 | public class DatabaseUtil { 12 | 13 | public static SqlSession getSqlSession() throws IOException { 14 | // 获取配置的资源文件 15 | Reader reader = Resources.getResourceAsReader("databaseConfig.xml"); 16 | SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader); 17 | //sqlSession 就是能够执行配置文件中的 SQL 语句 18 | SqlSession sqlSession = factory.openSession(); 19 | 20 | return sqlSession; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Chapter12/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | test.url = http://localhost:8888 2 | 3 | # 登录接口 4 | login.uri = /v1/login 5 | 6 | # 更新用户信息接口 7 | updateUserInfo.uri = /v1/updateUserInfo 8 | 9 | # 获取用户列表接口 10 | getUserList.uri = /v1/getUserList 11 | 12 | # 获取用户信息接口 13 | getUserInfo.uri = /v1/getUserInfo 14 | 15 | # 添加用户接口 16 | addUser.uri = /v1/addUser -------------------------------------------------------------------------------- /Chapter12/src/main/resources/databaseConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Chapter12/src/main/resources/testng.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Chapter12/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | test.url = http://localhost:8888 2 | 3 | # 登录接口 4 | login.uri = /v1/login 5 | 6 | # 更新用户信息接口 7 | updateUserInfo.uri = /v1/updateUserInfo 8 | 9 | # 获取用户列表接口 10 | getUserList.uri = /v1/getUserList 11 | 12 | # 获取用户信息接口 13 | getUserInfo.uri = /v1/getUserInfo 14 | 15 | # 添加用户接口 16 | addUser.uri = /v1/addUser -------------------------------------------------------------------------------- /Chapter12/target/classes/databaseConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/cases/AddUserTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/cases/AddUserTest.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/cases/GetUserInfoListTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/cases/GetUserInfoListTest.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/cases/GetUserInfoTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/cases/GetUserInfoTest.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/cases/LoginTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/cases/LoginTest.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/cases/UpdateUserInfoTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/cases/UpdateUserInfoTest.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/config/ExtentTestNGIReporterListener$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/config/ExtentTestNGIReporterListener$1.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/config/ExtentTestNGIReporterListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/config/ExtentTestNGIReporterListener.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/config/TestConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/config/TestConfig.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/AddUserCase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/AddUserCase.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/GetUserInfoCase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/GetUserInfoCase.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/GetUserListCase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/GetUserListCase.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/InterfaceName.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/InterfaceName.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/LoginCase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/LoginCase.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/UpdateUserInfoCase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/UpdateUserInfoCase.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/model/User.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/utils/ConfigFile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/utils/ConfigFile.class -------------------------------------------------------------------------------- /Chapter12/target/classes/org/alanhou/utils/DatabaseUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter12/target/classes/org/alanhou/utils/DatabaseUtil.class -------------------------------------------------------------------------------- /Chapter12/target/classes/testng.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Chapter13/src/main/java/org/alanhou/Application.java: -------------------------------------------------------------------------------- 1 | package org.alanhou; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.ConfigurableApplicationContext; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | import javax.annotation.PreDestroy; 9 | 10 | @EnableScheduling 11 | @SpringBootApplication 12 | public class Application { 13 | 14 | private static ConfigurableApplicationContext context; 15 | 16 | public static void main(String[] args) { 17 | Application.context = SpringApplication.run(Application.class,args); 18 | } 19 | 20 | @PreDestroy 21 | public void close(){ 22 | Application.context.close(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Chapter13/src/main/java/org/alanhou/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | @Configuration 14 | @EnableSwagger2 15 | public class SwaggerConfig { 16 | @Bean 17 | public Docket api(){ 18 | return new Docket(DocumentationType.SWAGGER_2) 19 | .apiInfo(apiInfo()) 20 | .pathMapping("/") 21 | .select() 22 | .paths(PathSelectors.regex("/.*")) 23 | .build(); 24 | } 25 | 26 | private ApiInfo apiInfo() { 27 | return new ApiInfoBuilder().title("UserManager service API") 28 | .contact(new Contact("Alan Hou","https://alanhou.org","demo@alanhou.org")) 29 | .description("This is UserManager service API") 30 | .version("1.0.0.0") 31 | .build(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Chapter13/src/main/java/org/alanhou/model/User.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class User { 7 | private int id; 8 | private String userName; 9 | private String password; 10 | private String age; 11 | private String sex; 12 | private String permission; 13 | private String isDelete; 14 | } 15 | -------------------------------------------------------------------------------- /Chapter13/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | 4 | logging: 5 | path: logs 6 | file: userManager.log 7 | 8 | spring: 9 | application: 10 | name: userManager 11 | datasource: 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://127.0.0.1:3306/course?serverTimeZone=GMT 14 | username: root 15 | password: 16 | mybatis: 17 | type-aliases-package: org.alanhou.model 18 | mapper-locations: 19 | - mapper/* 20 | -------------------------------------------------------------------------------- /Chapter13/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ${LOG_PATH}/${LOG_FILE} 9 | 10 | ${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd} 11 | 12 | 13 | ${FILE_LOG_PATTERN} 14 | 15 | 16 | 17 | 18 | 19 | 20 | ${FILE_LOG_PATTERN} 21 | 22 | 23 | 24 | 25 | 26 | ${LOG_PATH}/event.log 27 | 28 | ${LOG_PATH}/event.%d{yyyy-MM-dd}.log 29 | 30 30 | 31 | 32 | %msg%n 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Chapter13/src/main/resources/mapper/mysql.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | insert into 16 | user (userName,password,sex,age,permission,isDelete) 17 | values (#{userName},#{password},#{sex},#{age},#{permission},#{isDelete}); 18 | 19 | 20 | 21 | 47 | 48 | 49 | 50 | update user 51 | 52 | 53 | userName = #{userName}, 54 | 55 | 56 | sex = #{sex}, 57 | 58 | 59 | age = #{age}, 60 | 61 | 62 | permission = #{permission}, 63 | 64 | 65 | isDelete = #{isDelete}, 66 | 67 | 68 | where id = #{id} 69 | 70 | -------------------------------------------------------------------------------- /Chapter13/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter13/target/classes/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | 4 | logging: 5 | path: logs 6 | file: userManager.log 7 | 8 | spring: 9 | application: 10 | name: userManager 11 | datasource: 12 | driver-class-name: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://127.0.0.1:3306/course?serverTimeZone=GMT 14 | username: root 15 | password: 16 | mybatis: 17 | type-aliases-package: org.alanhou.model 18 | mapper-locations: 19 | - mapper/* 20 | -------------------------------------------------------------------------------- /Chapter13/target/classes/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ${LOG_PATH}/${LOG_FILE} 9 | 10 | ${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd} 11 | 12 | 13 | ${FILE_LOG_PATTERN} 14 | 15 | 16 | 17 | 18 | 19 | 20 | ${FILE_LOG_PATTERN} 21 | 22 | 23 | 24 | 25 | 26 | ${LOG_PATH}/event.log 27 | 28 | ${LOG_PATH}/event.%d{yyyy-MM-dd}.log 29 | 30 30 | 31 | 32 | %msg%n 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Chapter13/target/classes/mapper/mysql.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | insert into 16 | user (userName,password,sex,age,permission,isDelete) 17 | values (#{userName},#{password},#{sex},#{age},#{permission},#{isDelete}); 18 | 19 | 20 | 21 | 47 | 48 | 49 | 50 | update user 51 | 52 | 53 | userName = #{userName}, 54 | 55 | 56 | sex = #{sex}, 57 | 58 | 59 | age = #{age}, 60 | 61 | 62 | permission = #{permission}, 63 | 64 | 65 | isDelete = #{isDelete}, 66 | 67 | 68 | where id = #{id} 69 | 70 | -------------------------------------------------------------------------------- /Chapter13/target/classes/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter13/target/classes/org/alanhou/Application.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter13/target/classes/org/alanhou/Application.class -------------------------------------------------------------------------------- /Chapter13/target/classes/org/alanhou/config/SwaggerConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter13/target/classes/org/alanhou/config/SwaggerConfig.class -------------------------------------------------------------------------------- /Chapter13/target/classes/org/alanhou/controller/UserManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter13/target/classes/org/alanhou/controller/UserManager.class -------------------------------------------------------------------------------- /Chapter13/target/classes/org/alanhou/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter13/target/classes/org/alanhou/model/User.class -------------------------------------------------------------------------------- /Chapter5/Chapter5.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapter5/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alanhou.java 8 | Chapter5 9 | 1.0-SNAPSHOT 10 | 11 | 12 | org.testng 13 | testng 14 | RELEASE 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/BasicAnnotation.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng; 2 | 3 | import org.testng.annotations.*; 4 | 5 | public class BasicAnnotation { 6 | 7 | //最基本的注解,用来把方法标记为测试的一部分 8 | @Test 9 | public void testCase1(){ 10 | System.out.println("这是测试用例1"); 11 | } 12 | 13 | @Test 14 | public void testCase2(){ 15 | System.out.println("这是测试用例2"); 16 | } 17 | 18 | @BeforeMethod 19 | public void beforeMethod(){ 20 | System.out.println("BeforeMethod 是在测试方法之前运行的"); 21 | } 22 | 23 | @AfterMethod 24 | public void afterMetod(){ 25 | System.out.println("AfterMethod 是在测试方法之后运行的"); 26 | } 27 | 28 | @BeforeClass 29 | public void beforeClass(){ 30 | System.out.println("BeforeClass 是在类之前运行的方法"); 31 | } 32 | 33 | @AfterClass 34 | public void afterClass(){ 35 | System.out.println("AfterClass 是在类之后运行的方法"); 36 | } 37 | 38 | @BeforeSuite 39 | public void beforeSuite(){ 40 | System.out.println("BeforeSuite测试套件在BeforeClass之前运行"); 41 | } 42 | 43 | @AfterSuite 44 | public void afterSuite(){ 45 | System.out.println("AfterSuite测试套件在AfterClass之后运行"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/DependencyTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class DependencyTest { 6 | 7 | @Test 8 | public void test1(){ 9 | System.out.println("test1 run"); 10 | throw new RuntimeException(); 11 | } 12 | 13 | @Test(dependsOnMethods = {"test1"}) 14 | public void test2(){ 15 | System.out.println("test2 run"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/ExpectedException.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class ExpectedException { 6 | /** 7 | * 什么时候会用到异常测试? 8 | * 在我们期望结果为某一个异常的时候 9 | * 比如:我们传入了某些不合法的参数,程序抛出了异常 10 | * 也就是说我们的预期结果就是这个异常 11 | */ 12 | 13 | //这是一个测试结果会失败的异常测试 14 | @Test(expectedExceptions = RuntimeException.class) 15 | public void runTimeExceptionFailed(){ 16 | System.out.println("这是一个失败的异常测试"); 17 | } 18 | 19 | 20 | //这是一个测试结果会成功的异常测试 21 | @Test(expectedExceptions = RuntimeException.class) 22 | public void runTimeExceptionSuccess(){ 23 | System.out.println("这是我的异常测试"); 24 | throw new RuntimeException(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/IgnoreTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class IgnoreTest { 6 | 7 | @Test 8 | public void ignore1(){ 9 | System.out.println("ignore1 执行!"); 10 | } 11 | 12 | @Test(enabled = false) 13 | public void ignore2(){ 14 | System.out.println("ingore2 执行!"); 15 | } 16 | 17 | @Test 18 | public void ignore3(){ 19 | System.out.println("ignore3 执行!"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/TimeOutTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class TimeOutTest { 6 | 7 | @Test(timeOut = 3000) //单位为毫秒 8 | public void testSuccess() throws InterruptedException{ 9 | Thread.sleep(2000); 10 | } 11 | 12 | @Test(timeOut = 2000) 13 | public void testFailed() throws InterruptedException { 14 | Thread.sleep(3000); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/groups/GroupsOnClass1.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.groups; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | @Test(groups = "stu") 6 | public class GroupsOnClass1 { 7 | 8 | public void stu1(){ 9 | System.out.println("GroupsOnClass1中的 stu1运行"); 10 | } 11 | 12 | public void stu2(){ 13 | System.out.println("GroupsOnClass1中的 stu2运行"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/groups/GroupsOnClass2.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.groups; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | @Test(groups = "stu") 6 | public class GroupsOnClass2 { 7 | 8 | public void stu1(){ 9 | System.out.println("GroupsOnClass2中的 stu1运行"); 10 | } 11 | 12 | public void stu2(){ 13 | System.out.println("GroupsOnClass2中的 stu2运行"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/groups/GroupsOnClass3.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.groups; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | @Test(groups = "teacher") 6 | public class GroupsOnClass3 { 7 | 8 | public void teacher1(){ 9 | System.out.println("GroupsOnClass3中的 teacher1运行"); 10 | } 11 | 12 | public void teacher2(){ 13 | System.out.println("GroupsOnClass3中的 teacher2运行"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/groups/GroupsOnMethod.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.groups; 2 | 3 | import org.testng.annotations.AfterGroups; 4 | import org.testng.annotations.BeforeGroups; 5 | import org.testng.annotations.Test; 6 | 7 | public class GroupsOnMethod { 8 | 9 | @Test(groups = "server") 10 | public void test1(){ 11 | System.out.println("这是服务端组的测试方法1"); 12 | } 13 | 14 | @Test(groups = "server") 15 | public void test2(){ 16 | System.out.println("这是服务端组的测试方法2"); 17 | } 18 | 19 | @Test(groups = "client") 20 | public void test3(){ 21 | System.out.println("这是客户端组的测试方法3"); 22 | } 23 | 24 | @Test(groups = "client") 25 | public void test4(){ 26 | System.out.println("这是客户端组的测试方法4"); 27 | } 28 | 29 | @BeforeGroups("server") 30 | public void beforeGroupsOnServer(){ 31 | System.out.println("这是服务端组运行之前运行的方法"); 32 | } 33 | 34 | @AfterGroups("server") 35 | public void afterGroupsOnServer(){ 36 | System.out.println("这是服务端组运行之后运行的方法"); 37 | } 38 | 39 | @BeforeGroups("client") 40 | public void beforeGroupsOnClient(){ 41 | System.out.println("这是客户端端组运行之前运行的方法"); 42 | } 43 | 44 | @AfterGroups("client") 45 | public void afterGroupsOnClient(){ 46 | System.out.println("这是客户端组运行之后运行的方法"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/multiThread/MultiThreadOnAnnotation.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.multiThread; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class MultiThreadOnAnnotation { 6 | 7 | @Test 8 | public void test(){ 9 | System.out.println(1); 10 | System.out.printf("Thread Id: %s%n", Thread.currentThread().getId()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/multiThread/MultiThreadOnXml.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.multiThread; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class MultiThreadOnXml { 6 | 7 | @Test 8 | public void test1(){ 9 | System.out.printf("Thread Id: %s%n", Thread.currentThread().getId()); 10 | } 11 | 12 | @Test 13 | public void test2(){ 14 | System.out.printf("Thread Id: %s%n", Thread.currentThread().getId()); 15 | } 16 | 17 | @Test 18 | public void test3(){ 19 | System.out.printf("Thread Id: %s%n", Thread.currentThread().getId()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/parameter/DataProviderTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.parameter; 2 | 3 | import org.testng.annotations.DataProvider; 4 | import org.testng.annotations.Test; 5 | 6 | import java.lang.reflect.Method; 7 | 8 | public class DataProviderTest { 9 | 10 | @Test(dataProvider = "data") 11 | public void testDataProvider(String name, int age){ 12 | System.out.println("name=" + name + "; age=" +age); 13 | } 14 | 15 | @DataProvider(name="data") 16 | public Object[][] providerData(){ 17 | Object[][] o = new Object[][]{ 18 | {"Jack",10}, 19 | {"Anne",20} 20 | }; 21 | return o; 22 | } 23 | 24 | @Test(dataProvider = "methodData") 25 | public void test1(String name, int age){ 26 | System.out.println("test1方法 name=" + name + "; age=" +age); 27 | } 28 | @Test(dataProvider = "methodData") 29 | public void test2(String name, int age){ 30 | System.out.println("test2方法 name=" + name + "; age=" +age); 31 | } 32 | 33 | @DataProvider(name="methodData") 34 | public Object[][] methodDataTest(Method method){ 35 | Object[][] result = null; 36 | 37 | if(method.getName().equals("test1")){ 38 | result = new Object[][]{ 39 | {"Jack",10}, 40 | {"Anne",20} 41 | }; 42 | }else if(method.getName().equals("test2")){ 43 | result = new Object[][]{ 44 | {"Mark",15}, 45 | {"Sophia",25} 46 | }; 47 | } 48 | return result; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/parameter/ParameterTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.parameter; 2 | 3 | import org.testng.annotations.Parameters; 4 | import org.testng.annotations.Test; 5 | 6 | public class ParameterTest { 7 | 8 | @Test 9 | @Parameters({"name","age"}) 10 | public void paramTest1(String name, int age){ 11 | System.out.println("name=" + name + "; age=" + age); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/suite/LoginTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.suite; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class LoginTest { 6 | @Test 7 | public void loginTaobao(){ 8 | System.out.println("淘宝登录成功"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/suite/PayTest.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.suite; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | public class PayTest { 6 | @Test 7 | public void paySuccess(){ 8 | System.out.println("支付宝支付成功"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter5/src/main/java/org/alanhou/testng/suite/SuiteConfig.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.testng.suite; 2 | 3 | import org.testng.annotations.AfterSuite; 4 | import org.testng.annotations.AfterTest; 5 | import org.testng.annotations.BeforeSuite; 6 | import org.testng.annotations.BeforeTest; 7 | 8 | public class SuiteConfig { 9 | 10 | @BeforeSuite 11 | public void beforeSuite(){ 12 | System.out.println("Before Suite 运行了"); 13 | } 14 | 15 | @AfterSuite 16 | public void afterSuite(){ 17 | System.out.println("After Suite 运行了"); 18 | } 19 | 20 | @BeforeTest 21 | public void beforeTest(){ 22 | System.out.println("beforeTest"); 23 | } 24 | 25 | @AfterTest 26 | public void afterTest(){ 27 | System.out.println("afterTest"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Chapter5/src/main/resources/groupsOnClass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter5/src/main/resources/multiThread.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Chapter5/src/main/resources/parameter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter5/src/main/resources/suite.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/BasicAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/BasicAnnotation.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/DependencyTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/DependencyTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/ExpectedException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/ExpectedException.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/IgnoreTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/IgnoreTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/TimeOutTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/TimeOutTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnClass1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnClass1.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnClass2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnClass2.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnClass3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnClass3.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnMethod.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/groups/GroupsOnMethod.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/multiThread/MultiThreadOnAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/multiThread/MultiThreadOnAnnotation.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/multiThread/MultiThreadOnXml.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/multiThread/MultiThreadOnXml.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/parameter/DataProviderTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/parameter/DataProviderTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/parameter/ParameterTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/parameter/ParameterTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/suite/LoginTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/suite/LoginTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/suite/PayTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/suite/PayTest.class -------------------------------------------------------------------------------- /Chapter5/target/classes/org/alanhou/testng/suite/SuiteConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter5/target/classes/org/alanhou/testng/suite/SuiteConfig.class -------------------------------------------------------------------------------- /Chapter6/Chapter6.iml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Chapter6/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | org.alanhou.java 9 | Chapter6 10 | 1.0-SNAPSHOT 11 | 12 | 13 | 14 | 15 | org.apache.maven.plugins 16 | maven-compiler-plugin 17 | 18 | 1.6 19 | 1.6 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | com.relevantcodes 28 | extentreports 29 | 2.41.2 30 | 31 | 32 | 33 | com.vimalselvam 34 | testng-extentsreport 35 | RELEASE 36 | 37 | 38 | 39 | com.aventstack 40 | extentreports 41 | RELEASE 42 | 43 | 44 | 45 | org.testng 46 | testng 47 | RELEASE 48 | 49 | 50 | com.aventstack 51 | extentreports 52 | 4.0.0 53 | 54 | 55 | com.aventstack 56 | extentreports 57 | 4.0.0 58 | 59 | 60 | com.aventstack 61 | extentreports 62 | 4.0.0 63 | 64 | 65 | -------------------------------------------------------------------------------- /Chapter6/src/main/java/com/tester/extend/demo/TestMethodsDemo.java: -------------------------------------------------------------------------------- 1 | package com.tester.extend.demo; 2 | 3 | import org.testng.Assert; 4 | import org.testng.Reporter; 5 | import org.testng.annotations.Test; 6 | 7 | public class TestMethodsDemo { 8 | 9 | @Test 10 | public void test1(){ 11 | Assert.assertEquals(1,2); 12 | } 13 | 14 | @Test 15 | public void test2(){ 16 | Assert.assertEquals(1,1); 17 | } 18 | 19 | @Test 20 | public void test3(){ 21 | Assert.assertEquals("aaa","aaa"); 22 | } 23 | 24 | @Test 25 | public void logDemo(){ 26 | Reporter.log("这是我们自己写的日志"); 27 | throw new RuntimeException("这是我们自己抛的运行时异常"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Chapter6/src/main/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListener$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListener$1.class -------------------------------------------------------------------------------- /Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListener.class -------------------------------------------------------------------------------- /Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListenerOld$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListenerOld$1.class -------------------------------------------------------------------------------- /Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListenerOld.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter6/target/classes/com/tester/extend/demo/ExtentTestNGIReporterListenerOld.class -------------------------------------------------------------------------------- /Chapter6/target/classes/com/tester/extend/demo/TestMethodsDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter6/target/classes/com/tester/extend/demo/TestMethodsDemo.class -------------------------------------------------------------------------------- /Chapter6/target/classes/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Chapter7/README.md: -------------------------------------------------------------------------------- 1 | ### 基本操作说明 2 | 3 | **替换端口号和 json 文件即可** 4 | 5 | java -jar ./moco-runner-0.12.0-standalone.jar http -p 8888 -c startup1.json -------------------------------------------------------------------------------- /Chapter7/moco-runner-0.12.0-standalone.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter7/moco-runner-0.12.0-standalone.jar -------------------------------------------------------------------------------- /Chapter7/startup1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"这是我们的第一个 Mock", 4 | "访问链接":"http://localhost:8888/demo", 5 | "request":{ 6 | "uri":"/demo" 7 | }, 8 | "response":{ 9 | "text":"第一个 Moco 框架 Demo" 10 | } 11 | } 12 | ] -------------------------------------------------------------------------------- /Chapter7/startupGet.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "模拟一个没有参数的 GET 请求", 4 | "request":{ 5 | "uri":"/getdemo", 6 | "method":"get" 7 | }, 8 | "response":{ 9 | "text":"这是一个没有参数的 GET 请求" 10 | } 11 | }, 12 | { 13 | "description": "模拟一个带参数的 GET 请求", 14 | "request":{ 15 | "uri":"/getwithparam", 16 | "method":"get", 17 | "queries":{ 18 | "name": "Jack", 19 | "age": "18" 20 | } 21 | }, 22 | "response":{ 23 | "text":"这是一个带参数的 GET 请求" 24 | } 25 | } 26 | 27 | ] -------------------------------------------------------------------------------- /Chapter7/startupPost.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"模拟一个 POST 请求", 4 | "request":{ 5 | "uri":"/postdemo", 6 | "method":"post" 7 | }, 8 | "response":{ 9 | "text":"这是我们第一个 mock 的 post请求" 10 | } 11 | }, 12 | { 13 | "description":"这是一个带参数的 POST 请求", 14 | "request":{ 15 | "uri":"/postwithparam", 16 | "method":"post", 17 | "forms":{ 18 | "name":"Jack", 19 | "sex":"male" 20 | } 21 | }, 22 | "response":{ 23 | "text":"这是一个带参数的 POST 请求" 24 | } 25 | } 26 | ] -------------------------------------------------------------------------------- /Chapter7/startupWithCookies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"这是一个会返回 cookies 信息的 get 请求", 4 | "request":{ 5 | "uri":"/getcookies", 6 | "method":"get" 7 | }, 8 | "response":{ 9 | "cookies":{ 10 | "login":"true" 11 | }, 12 | "text":"恭喜你成功获得 cookies 信息" 13 | } 14 | }, 15 | { 16 | "description":"这是一个带 cookies 信息的 GET 请求", 17 | "request":{ 18 | "uri":"/get/with/cookies", 19 | "method":"get", 20 | "cookies":{ 21 | "login":"true" 22 | } 23 | }, 24 | "response":{ 25 | "text":"这是一个需要携带 cookies 信息才能访问的 get 请求" 26 | } 27 | }, 28 | { 29 | "description":"这是一个带 cookies 信息的 GET 请求", 30 | "request":{ 31 | "uri":"/post/with/cookies", 32 | "method":"post", 33 | "cookies":{ 34 | "login":"true" 35 | }, 36 | "json":{ 37 | "name":"Jack", 38 | "age":"18" 39 | } 40 | }, 41 | "response":{ 42 | "status":200, 43 | "json":{ 44 | "jack":"success", 45 | "status": "1" 46 | } 47 | } 48 | } 49 | ] -------------------------------------------------------------------------------- /Chapter7/startupWithHeader.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"这是一个带 header 信息的 post 请求", 4 | "request":{ 5 | "uri":"/post/with/headers", 6 | "method":"post", 7 | "headers":{ 8 | "content-type":"application/json" 9 | }, 10 | "json":{ 11 | "name":"rose", 12 | "sex":"female" 13 | } 14 | }, 15 | "response":{ 16 | "json":{ 17 | "rose":"success", 18 | "status":1 19 | } 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /Chapter7/startupWithRedirect.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"重定向到百度", 4 | "request":{ 5 | "uri":"/redirect" 6 | }, 7 | "redirectTo":"https://www.baidu.com" 8 | }, 9 | { 10 | "description":"重定向到一个自己的网页上", 11 | "request":{ 12 | "uri":"/redirect/topath" 13 | }, 14 | "redirectTo":"/redirect/new" 15 | }, 16 | { 17 | "description":"这是被重定向到的请求", 18 | "request":{ 19 | "uri":"/redirect/new" 20 | }, 21 | "response":{ 22 | "text":"重定向成功" 23 | } 24 | } 25 | ] -------------------------------------------------------------------------------- /Chapter9/Chapter9.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Chapter9/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alanhou.java 8 | Chapter9 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 13 | org.apache.httpcomponents 14 | httpclient 15 | [4.3.6,) 16 | 17 | 18 | org.testng 19 | testng 20 | RELEASE 21 | 22 | 23 | org.json 24 | json 25 | RELEASE 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Chapter9/src/main/java/org/alanhou/httpclient/demo/MyHttpClient.java: -------------------------------------------------------------------------------- 1 | package org.alanhou.httpclient.demo; 2 | 3 | import org.apache.http.HttpResponse; 4 | import org.apache.http.client.HttpClient; 5 | import org.apache.http.client.methods.HttpGet; 6 | import org.apache.http.impl.client.DefaultHttpClient; 7 | import org.apache.http.util.EntityUtils; 8 | import org.testng.annotations.Test; 9 | 10 | import java.io.IOException; 11 | 12 | public class MyHttpClient { 13 | 14 | @Test 15 | public void test1() throws IOException { 16 | 17 | //用来存放结果 18 | String result; 19 | HttpGet get = new HttpGet("http://www.baidu.com"); 20 | //用来执行 GET 方法 21 | HttpClient client = new DefaultHttpClient(); 22 | HttpResponse response = client.execute(get); 23 | result = EntityUtils.toString(response.getEntity(), "utf-8"); 24 | System.out.println(result); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Chapter9/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | test.url=http://localhost:8888 2 | 3 | getCookies.uri=/getcookies 4 | 5 | test.get.with.cookies = /get/with/cookies 6 | test.post.with.cookies = /post/with/cookies -------------------------------------------------------------------------------- /Chapter9/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | test.url=http://localhost:8888 2 | 3 | getCookies.uri=/getcookies 4 | 5 | test.get.with.cookies = /get/with/cookies 6 | test.post.with.cookies = /post/with/cookies -------------------------------------------------------------------------------- /Chapter9/target/classes/org/alanhou/httpclient/cookies/MyCookiesForPost.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter9/target/classes/org/alanhou/httpclient/cookies/MyCookiesForPost.class -------------------------------------------------------------------------------- /Chapter9/target/classes/org/alanhou/httpclient/cookies/MyCookiesFotGet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter9/target/classes/org/alanhou/httpclient/cookies/MyCookiesFotGet.class -------------------------------------------------------------------------------- /Chapter9/target/classes/org/alanhou/httpclient/demo/MyHttpClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/Chapter9/target/classes/org/alanhou/httpclient/demo/MyHttpClient.class -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoTest 2 | Java Automated Test Learning 3 | 4 | [Java接口自动化测试实战笔记](https://alanhou.org/java-automated-testing/) 5 | 6 | ![Java Automated Test](http://p2.pstatp.com/large/pgc-image/7a2464aae82141079a59ce757f9485bd) 7 | 8 | ## 主要内容: 9 | 10 | * 综述 11 | * 代码管理工具Git 12 | * 测试框架 TestNG 13 | * Mock 接口框架 14 | * HTTP 协议接口 15 | * SprintBoot 自动化测试开发 16 | * 数据持久层框架 MyBatis 17 | * MyBatis+MySQL实现用例管理 18 | * TestNG+MyBatis实现数据校验 19 | * Jenkins持续集成 20 | 21 | 文章链接:https://alanhou.org/java-automated-testing/ 22 | 23 | Course Link:https://coding.imooc.com/class/chapter/204.html 24 | 25 | -------------------------------------------------------------------------------- /logs/event.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alanhou7/AutoTest/c5b47714d438ca0a45450eee300a83c8ca0cb859/logs/event.log -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alanhou.java 8 | Chapter 9 | 1.0-SNAPSHOT 10 | 11 | 12 | Chapter5 13 | Chapter6 14 | 15 | 16 | --------------------------------------------------------------------------------