Skip to content

Instantly share code, notes, and snippets.

View ZhouMeichen's full-sized avatar

Michelle ZhouMeichen

View GitHub Profile
(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(if window-system
(progn
(tool-bar-mode -1)
(setq frame-title-format '("%b [%m] Emacs " emacs-version))
(set-frame-size (selected-frame) 100 36))
version: '3.0'
services:
wordpress:
image: wordpress
restart: always
ports:
- 80:80
environment:
WORDPRESS_DB_HOST: db
@ZhouMeichen
ZhouMeichen / pmtest.js
Created June 29, 2019 13:16
API test using Postman (JSON Schema, Status code, Data value, Header, Response time)
//GET: https://reqres.in/api/users?page=2
var schema = {
"properties": {
"page": {
"type": "integer"
},
"per_page": {
"type": "integer",
"enum": [
1,
@ZhouMeichen
ZhouMeichen / Sha1.java
Last active May 10, 2019 05:19
Implement JMeter Java Request to test websocket API (transmit audio data)
package test;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Sha1 {
private static final String HEX_DIGITS = "0123456789abcdef";
private static final int BYTE_MSK = 0xFF;
private static final int HEX_DIGIT_BITS = 4;
@ZhouMeichen
ZhouMeichen / config.yml
Last active May 10, 2019 05:12
Test data generator
method1:
connect_username: sa
connect_password: pwd
connect_host: 172.29.140.157
connect_database: DB_Test
connect_encode: GBK
telnet_host: 172.29.131.102
telnet_port: 3001
telnet_user: zhou_meichen
telnet_pwd: pwd
@ZhouMeichen
ZhouMeichen / db.rb
Last active May 10, 2019 05:19
Generate XML data from SQL Server, post it to MQ, and save response to local XML file
#encoding: utf-8
class MSSQL
attr_accessor :connect_username
attr_accessor :connect_password
attr_accessor :connect_host
attr_accessor :connect_database
attr_accessor :connect_encode
attr_accessor :sql
@ZhouMeichen
ZhouMeichen / browser.rb
Last active May 10, 2019 05:21
UI layer smoke test with Selenium+Cucumber
#encoding: utf-8
class Browser
def self.init
if ARGV[0].to_s.downcase == "firefox"
@driver = Selenium::WebDriver.for :firefox
elsif ARGV[0].to_s.downcase == "chrome"
@driver = Selenium::WebDriver.for :chrome
elsif ARGV[0].to_s.downcase == "ie"
@driver = Selenium::WebDriver.for :ie
@ZhouMeichen
ZhouMeichen / WebPerformance.jmx
Last active May 10, 2019 05:22
Load test with JMeter HTTP Request Sampler
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@ZhouMeichen
ZhouMeichen / JMeterJavaSampler.java
Created March 1, 2015 06:35
调用WebSphere MQ接口实现消息的读取,利用JMeter的Java请求进行性能测试
package test;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerClient;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;
@ZhouMeichen
ZhouMeichen / README.txt
Created December 10, 2014 09:10
接口测试脚本(WebService+CSV in Windows)
1、安装Rubyinstaller for windows
前往“http://rubyinstaller.org/downloads/”网站下载RubyInstaller for Windows。一般,请下载1.9.3以上版本。按照提示安装即可,其中需要勾选“Add Ruby executables to your PATH”选项。
#####################################################################
2、安装gem
此工具所需gem包含:tiny_tds。可直接在命令行中联网安装,打开“cmd”,输入“gem install tiny_tds”。若联网安装失败,可使用已下载的“tiny_tds-0.6.2.gem”,在命令行中输入“gem install 路径/tiny_tds-0.6.2.gem”进行安装。
#####################################################################
3、根据具体测试环境修改conf文件夹中的config.yml
(1)method1:
connect_username:数据库登陆名
connect_password:数据库登陆密码