List of unit testing frameworks for Java

A programmer-oriented testing framework for Java

A Mocking framework that tastes really good

A JUnit extension to perform unit testing with database-driven programs

A Java logging API by means of a simple facade pattern (DbUnit uses SLF4J for logging purposes.).

A relational database management system written in Java

A YAML parser and emitter for the Java programming language

How to use Hubot behind a proxy.

You may fail to run a bot which uses http connection with Hubot if you are behind a proxy such as Squid.
Hubot behind a proxy · Issue #287 · github/hubot · GitHub
For example, you'll have following type of error messages when you run "hubot youtube me [search key words]".

events.js:72
            throw er; // Unhandled 'error' event
                      ^
Error: connect ECONNREFUSED
  at errnoException (net.js:900:11)
  at Object.afterConnect [as oncomplete] (net.js:891:19)

In this case, you might be able to solve the issue to specify proxy address and proxy port in node-scoped-http-client which is one of the wrapper libraries of Node.js's HTTP client and used by Hubot.

How to modify the source code (hubot/node_modules/scoped-http-client/src/lib/index.js) is as follows.

port = this.options.port || ScopedClient.defaultPort[this.options.protocol] || 80;
req = (this.options.protocol === 'https:' ? https : http).request({
  // port: port,
  port: 3127,           // you have to specify a proxy port.
  // host: this.options.hostname,
  host: 'localhost',   // you have to specify a proxy server address or hostname.
  method: method,
  // path: this.fullPath(),
  path: 'http://' + this.options.hostname + this.fullPath(),
  headers: headers,
  agent: this.options.agent || false
});

How to run pcap4j on Mac OS X.

Pcap4J is a Java library for capturing, crafting and sending packets.

And, according to its README, Mac OS X is not included in supported operating system.

But, you can run Pcap4J on Mac OS X in the following way.

 

[Preparetion]

  1. Download pcap4j.jar from GitHub.
  2. Install libpcap using MacPorts (> sudo port install libpcap).
  3. Download jna-3.3.0.jar from here, and put it in the same folder with the pcap4j.jar. Don't use the latest JNA, or you'll have a java exception (java.lang.AbstractMethodError: com.sun.jna.Structure.getFieldOrder()Ljava/util/List).
  4. Download slf4j-1.7.2.zip from here and unarchive it. Then, put slf4j-api-1.7.2.jar and slf4j-nop-1.7.2.jar in the same folder with the pcap4j.jar (You don't have to put slf4j-nop-1.7.2.jar, but you can suppress the "SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"" message.).

 

[How to run]

Launch a terminal, and run java command like as follows.

> sudo java -cp pcap4j.jar:jna-3.3.0.jar:slf4j-api-1.7.2.jar -Dorg.pcap4j.core.pcapLibName=libpcap.dylib -Dorg.pcap4j.sample.Loop.count=2 org.pcap4j.sample.Loop icmp

The point is you have to specify org.pcap4j.core.pcapLibName Java property, because the file name of libpcap is different from what pcap4j is expected (libpcap.so).

 

[Note]

I don't know why IP address information is not displayed.

-------------

    (snip)

NIF[0]: en0

          : description: null

NIF[1]: p2p0

          : description: null

NIF[2]: lo0

          : description: null

    (snip)

-------------

 

[Detail version information]

  • Mac OS X 10.8.2
  • Java 1.6.0 Update 37
  • libpcap 1.3.0
  • jna 3.3.0
  • slf4j-api 1.7.2

How to stop "Listen has fallen back to polling" warning of Sass while watching for changes.

You would have a following warning message while you are trying to watch for changes with Sass.

---------------------------------------------------------------------------

WARNING: Listen has fallen back to polling, learn more at https://github.com/guard/listen#fallback.

---------------------------------------------------------------------------

 

In this case, run following command at first.

---------------------------------------------------------------------------

> gem install listen

---------------------------------------------------------------------------

 

Then, if you still have a warning message like as follows,

---------------------------------------------------------------------------

[Listen warning]:

  Missing dependency 'rb-inotify' (version '~> 0.8.8')!

  Please run the following to satisfy the dependency:

    gem install --version '~> 0.8.8' rb-inotify

  

  For a better performance, it's recommended that you satisfy the missing dependency.

  Listen will be polling changes. Learn more at https://github.com/guard/listen#polling-fallback.

---------------------------------------------------------------------------

 

Run following command (It depends on the message).

---------------------------------------------------------------------------

gem install rb-inotify

---------------------------------------------------------------------------

 

Keyboard shortcuts for HP WebOS running in VirtualBox on Mac OS.

  • fn + left  -->  Pushing Home button (Minimizes and maximizes the card)
  • fn + right + right -->  Showing lock screen
  • fn + F6 + F9  -->  Rotating device clockwise
  • fn + F9 + F6  -->  Rotating device counterclockwise
  • left or right  -->  Switching the app left or right in the Card view
  • left click + swipe  -->  Scrolling window

f:id:tomute:20120604232218p:plain

Note: After shrink an app image with fn + left key, drag the app and drop it off the screen (e.g. buttom of the screen), and you can clear the app.

How to solve “Failed to validate oauth signature and token” error message on Twitter Oauth.

You would receive this error message from Twitter when you try to get request token. In this case, you can solve the error message if you make your system clock be accurate.