How run unit tests in parallel with testng

1.To run unit test by classes parallel

 <plugin>      
  <groupId>org.apache.maven.plugins</groupId>      
  <artifactId>maven-surefire-plugin</artifactId>      
  <configuration>        
  <parallel>classes</parallel>      
    <threadCount>4</threadCount>      
  </configuration>      
 </plugin>

2.To run unit test by methods in parallel

<plugin>        
  <groupId>org.apache.maven.plugins</groupId>       
  <artifactId>maven-surefire-plugin</artifactId>        
  <configuration>        
    <parallel>methods</parallel>       
    <threadCount>4</threadCount>        
  </configuration>          
</plugin>

 

Reference:

http://books.sonatype.com/mcookbook/reference/ch07s06.html

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Posted in Uncategorized | Leave a comment

An multiple application pyramid project configuration

In the deployment of pyramid project, I don’t want to setup a separate process for each pyramid application. So it comes the requirement to deploy multiple application under one project.

Here’s an example configuration for a multiple app project. The project has 2 application, booksearch and mybackup. The configuration file syntax is the same as production.ini which is in paste deploy format. For interpretation of each section see: http://pythonpaste.org/deploy/#composite-applications

webapp-production.ini

[composite:main]
use = egg:Paste#urlmap
/ = home
/booksearch = booksearch
/mybackup = mybackup

[app:booksearch]
use = egg:booksearch

[app:mybackup]
use = egg:mybackup

[app:home]
use = egg:Paste#static
document_root = %(here)s/htdocs

[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 9090

You can run pserve to start the project:

$pserve webapp-production.ini

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Posted in python | Tagged , | Leave a comment

Install an OpenVPN server and connect to it on windows

Follow the tutorial on linode to install openvpn:
http://library.linode.com/networking/openvpn/debian-6-squeeze

Attention:
Both openvpn and dnsmasq shall be installed on the server.

And on the file /etc/openvpn/server.conf, the following line must be exist and not commented :
push “redirect-gateway def1″

By default the line is :
;push “redirect-gateway def1 bypass-dhcp”
The semi-colon should be removed, and “bypass-dhcp” should be removed too.

redirect-gateway option to configure the VPN as the default gateway (implemented on Linux and Windows only).

redirect-gateway bypass-dhcp option to add a route
allowing DHCP packets to bypass the tunnel, when the
DHCP server is non-local. Currently only implemented
on Windows clie