Tomcat-rails is now called Trinidad 1

Posted by david

One month ago I released Tomcat-rails, a little gem to simplify my development process with tomcat.

To get feedback I decided to send some emails to several mail lists. I was really interested in answers from jruby and tomcat users and developers, perhaps they could send me some advice to improve my code or ideas for new features.

I got good feedback from the jruby-user list, people used it with good results, others bump into problems with jruby-rack... but the answers from tomcat-user lists actually took me by surprise, just two or three minutes after I sent the email the first reply asked me to read the tomcat's legal page, from his own words, the name of my project didn't conform to the guidance set out in the trademarks section, and specifically in this point:

If you use the words "Tomcat" or "Apache" in your product name then you must call your product "... for Apache Tomcat" or "... for Tomcat". You may not call your product "Apache ..." or "Tomcat ...".

Some days after, the same guy sent me an email directly to remember me that I had to change the name of the project, and of course, reading the internal lists of the ASF I know the project got some mentions.

Well, the problem just finishes today, from now this project is called Trinidad. In few days the old repository and the web page will be remove, the new web page and the repository are still hosted in github but I also set up the project in rubyforge, so install the gem is even easier:


jgem install trinidad

Remember if you find a bug, you have improvements over my code or just have suggestions for new features, you can use the repository issues' page.

Usa ruby para testear tu código java 2

Posted by david

Aunque navegando por la web se pueden encontrar artículos sobre cómo usar rspec para testear código java y ya existe algún framework de bdd para java, desde hace unas semanas existe una librería que nos da las mejores herramentas de test que ruby posee para aplicarlas con nuestro código java.

JtestR es una librería que integra jruby con rspec, dust, mocha y ActiveSuport, y permite ejecutar nuestros test escritos en ruby con herramentas de automatización como Ant o Maven.

Para ejecutarlos con Ant es tan facil como incluir una nueva tarea en nuestro fichero de configuración:

<target name="test" description="Runs all tests">
  <taskdef name="jtestr" classname="org.jtestr.ant.JtestRAntRunner" classpath="lib/jtestr.jar"/>

  <jtestr tests="test/ruby"/>
</target>

Pero lo que más me gusta de este framework es poder usar rspec para testear mis clases java, un sencillo ejemplo podría ser este:

import java.util.HashMap

describe HashMap, "is empty" do
  before :each do
    @map = mock(HashMap)
  end

  it "should be empty" do
    @map.stubs(:size).returns(0)

    @map.should be_empty
  end
end

Una herramienta a tener en cuenta si, como yo, pasas el día entre código java y código ruby :-).