スキップしてメイン コンテンツに移動

投稿

C#: Generate Integer Sequence

This is quick tips. If you would like to generate sequence in C#, you can do like below: // generate 1, 2, 3,...., 24 foreach (var i in Enumerable.Range(1, 25)){ // do somthing nice :D } In my opinion, C# (.Net implementation) has nicer built-in libraries and syntax than Java...

JsTestDriver Trouble and Tips

I am looking for testing tools for Javascript and reached at This Stackoverflow page . The page contains bunch of useful information :) After reading the page, I decided to use JsTestDriver for the following reason. having high affinity with CI server providing plugin for codecoverage - ( lcov format) JUnit format report To run Javascript test, you need to start up JsTestDriver server. The command is simple. java -jar JsTestDriver-1.3.4.b.jar --port 9876 One thing you should be careful about is if you run the above command in the directory which includes jsTesDriver.conf, the jar automatically picked up the jsTestDriver.conf and and it starts as server mode. Ok now you need to run client side (actual tests) against the server. You will use FireFox + Xvfb or PhantomJS as headless browser. java -jar JsTestDriver-1.3.4.b.jar --browser {path to browser} --tests all --config jsTestDriver.conf --testOutput testResult Also jsTestDriver.conf should something like this: server:

Selenium IDEの使い勝手について調査

Selenium IDEの概要 FireFoxのPlugin 公式ドキュメント 独断と偏見に満ちた長所・短所 長所 作成したテストを様々なプログラミング言語で出力可能 (File->Export Test Suite As...) ブラウザ上での操作をSelenium IDE Commandとして記録するマクロ機能あり 短所 正直、このpluginを導入するより、普通のSeleniumを使って、システムの実装言語だけでテストが完結している方が、プロジェクトの運用コストや学習コストが低くてすむ可能性大。 スクリプトを書いてみた感じだと'''面倒くさい'''。後々のテストのメンテナンスに難あり。 その他、メモ Html内の要素の選択方法 XPath, CSS, DOM, id属性, name属性などが使える Selenium CoreのLocatorsを参照 Assertion or Verification? Assert: テストに失敗すると、それ以降のテストコマンドは実行されない Verify: テストに失敗すると、結果はFailとして表示されるが、Verify以降のテストコマンドは引き続き実行される waitForコマンドは特定の要素が出現するまで待って、出現したら次のテストコマンドを実行する。Ajax系のテストに最適。

Phalanger

I didn't know that there is a PHP compiler - Phalanger It compiles PHP on .Net/Mono platform. The aim of Phalanger is improving performance of PHP  Web application. I am surprised that PHP compiled by Phalanger is four times faster than offical PHP 5.4. Will try it when I have a free time.

SWF Investigator

Not sure everyone is interested in Flash technology but I found an interesting powerful tool - Adobe SWF Investigator . It can analyze SWF file by useful provided functionality like disassembler, SWF Viewer etc. Here is the screenshot. I think this kind of tool should be released much more earlier... I think flash is already fade-out phase. But still the tool is useful for flash developer.

Get Useful SVN info in Ant

Hello there! I am trying to get svn info from Ant. I think there are two ways. SvnAnt Execute SVN command and extract information on Ant I've tried first option - SvnAnt but there is an issue for me. I need to pick up proper version of JavaHL based on Subversion client version installed on machine. Since I would like to shared the ant script between Windows and Linux box, it's a bit pain for me to switch the JavaHL in my Ant script. So I decided to go for second option. This method is really straight forward but a bit hack. The advantage of this method is it works at least svn command is available on your machine and it doesn't depend on svn client version. The disadvantage is it really depends on svn info output string e.g. it's design for human readability, not designed for API. Anyway, here is the example for getting svn revision and set it to build.current.revision property. What this target do is redirecting svn info output and extracting revision li

Setup Headless Browser

Recently I was trying to setup Selenium Tests on CI Server on Linux (Cent OS) box in order to test my web project. I need headless browser for Selenium Tests on CI Server. There are 2 options: PhantomJS FireFox + Xvfb PhantomJS is really cool and I confirmed it worked fine on my Windows XP. I would have liked to use PhantomJS on my Linux box, too. However looks the latest binary build is unable to run on my Linux box because the required libc and libstdc++ are missing in the box: $ phantomjs/bin/phantomjs phantomjs/bin/phantomjs: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by phantomjs/bin/phantomjs) phantomjs/bin/phantomjs: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by phantomjs/bin/phantomjs) phantomjs/bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by phantomjs/bin/phantomjs) phantomjs/bin/phantomjs: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by /home/duke/bin/ph