Monday, December 16, 2013
Getting Started of GWT
Simple Note
Just follow the official Getting Started document: http://www.gwtproject.org/gettingstarted.html
(MyWebApp can be an absolute path when creating webapp)
Really excellent document, I cannot say anything else further to make it better.
Sunday, December 15, 2013
ZK JMeter: Loop Controller with AURequest
Simple Note
This script is modified from TestSimpleRecord.jmx at https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/jmeterTestingScript
* Counter Increment: 2, since there are 2 au requests under loop controller
(i.e., Increment should match the amount of au requests under loop controller)
* Use ${ZSID_C} for ZK-SID of the 1st au request under loop controller,
* Use ${__intSum(${ZSID_C},1,ZSID_C)} for ZK-SID of the 2nd (and after if any) au requests under loop controller.
Pre-Request
Record JMeter Testing Script for ZK
http://ben-bai.blogspot.tw/2013/12/record-jmeter-testing-script-for-zk.html
Modify Demo
http://screencast.com/t/Uut8mUa3b0G
Download
Testing Project
https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/TestProjForJMeter
Demo Flash
https://github.com/benbai123/ZK_Practice/blob/master/General/JMeter/demo/AURequestLoop.swf
Jmeter Script
TestLoopAURequest.jmx at https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/jmeterTestingScript
Saturday, December 14, 2013
Record JMeter Testing Script for ZK
Simple Note
Tested with JMeter 2.9 and ZK 6.5.2
* Input address and port in HTTP Request Default so they will not be recorded in request and can be changed easily if address/port are changed.
* Need to remove UserDefinedVariable (dtid: 0) before each record then add it back.
* Add parameter tdtid: ${__intSum(${dtid},1,dtid)} to the request for loading page
* Change parameter dtid to ${dtid} for each au request.
* Included pattern:
.*/zkau.*
.*\.zul
.*/TestProjForJMeter.* (for welcome page or any other url matched by servlet, index.zul here)
* Excluded pattern:
.*/zkau/web/.* (ignore the requests for load resources)
Record Demo
http://screencast.com/t/4rUMLerhQg
Recorded requests:
1. Page load
2. Click "click to start tast"
3. Click "increase first intbox"
4. Click "increase second intbox" (it is wrong in the demo, fixed in latest project)
5. Click "increase first intbox" again
6. Click "increase second intbox" again
7. Remove desktop
Reference
ZK Document
http://books.zkoss.org/wiki/Small_Talks/2012/January/Execute_a_Loading_or_Performance_Test_on_ZK_using_JMeter
JMeter User Manual
http://jmeter.apache.org/usermanual/functions.html#__intSum
Download
Testing Project
https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/TestProjForJMeter
Demo Flash
https://github.com/benbai123/ZK_Practice/blob/master/General/JMeter/demo/SimpleRecord.swf
Jmeter Script
TestSimpleRecord.jmx at https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/jmeterTestingScript
Sunday, December 1, 2013
JAVA: ZIp or Unzip Files/Folders with zip4j
Simple Note
Testing Project extract resource/test.xlsx to tmp folder then compress files/folders under tmp folder to dist/test.xlsx with zip4j.
dist/test.xlsx is readable by MS Excel.
Testing Project
https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/JAVA/IO/FileProcessing/ZIPorUNZIP
References
examples downloaded from http://www.lingala.net/zip4j/download.php
Saturday, November 30, 2013
Write ByteArrayOutputStream to File
Simple Note
test/Test.java shows how to write a ByteArrayOutputStream to a File (dist/test.txt)
https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/JAVA/IO/WriteByteAarrayOutputStreamToFile
Polymorphism in C++
Simple Note
From reference:
One of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer to its base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, that brings Object Oriented Methodologies to its full potential.
Also refer to http://ben-bai.blogspot.tw/2013/11/virtual-keyword-in-c.html
Tested with Dev-C++ 4.9.9.2
Code
https://github.com/benbai123/C_Cplusplus_Practice/blob/master/CPP/CPP_Basic/CPP_Extend_and_scope/polymorphism/basic/polymorphism_basic.cpp
Result
Refer to http://ben-bai.blogspot.tw/2013/11/virtual-keyword-in-c.html
Reference
http://www.cplusplus.com/doc/tutorial/polymorphism/
From reference:
One of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer to its base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, that brings Object Oriented Methodologies to its full potential.
Also refer to http://ben-bai.blogspot.tw/2013/11/virtual-keyword-in-c.html
Tested with Dev-C++ 4.9.9.2
Code
https://github.com/benbai123/C_Cplusplus_Practice/blob/master/CPP/CPP_Basic/CPP_Extend_and_scope/polymorphism/basic/polymorphism_basic.cpp
Result
Refer to http://ben-bai.blogspot.tw/2013/11/virtual-keyword-in-c.html
Reference
http://www.cplusplus.com/doc/tutorial/polymorphism/
Friday, November 29, 2013
Virtual Keyword in C++
Simple Note
Use virtual keyword to define a function in a class that can be redefined in its derived class.
The only valid declaration (virtual or non-virtual) is the declaration within first level Class (first level here means the base class), redefine it in derived class will be ignored.
Also refer to http://ben-bai.blogspot.tw/2013/11/polymorphism-in-c.html
Tested with Dev-C++ 4.9.9.2
Program
https://github.com/benbai123/C_Cplusplus_Practice/blob/master/CPP/CPP_Basic/CPP_Extend_and_scope/virtual/virtual.cpp
Result
Reference
http://www.cplusplus.com/doc/tutorial/polymorphism/
Use virtual keyword to define a function in a class that can be redefined in its derived class.
The only valid declaration (virtual or non-virtual) is the declaration within first level Class (first level here means the base class), redefine it in derived class will be ignored.
Also refer to http://ben-bai.blogspot.tw/2013/11/polymorphism-in-c.html
Tested with Dev-C++ 4.9.9.2
Program
https://github.com/benbai123/C_Cplusplus_Practice/blob/master/CPP/CPP_Basic/CPP_Extend_and_scope/virtual/virtual.cpp
Result
Reference
http://www.cplusplus.com/doc/tutorial/polymorphism/
Subscribe to:
Posts (Atom)
