Wednesday, 12. January 2011
How to Inherit from a Maven Plugin
For PatternTesting I wanted to inherit classes from the aspectj-maven-plugin but the parameters of the super class were not inialized by Plexus. Why? Because the javadoc tags are not accessible to Plexus.

For that reason there is a maven-inherit-plugin available, which allows you to extend non-local Maven plugins. You must add the OPS4J repository (as described on the maven-inherit-plugin page) and follow the steps of the usage page.

... link (0 Kommentare)   ... comment


Saturday, 1. January 2011
2011
Und? Gute Vorsätze für's neue Jahr gefasst? Nein? Da hätte ich einen Vorschlag: reichen Sie doch einen Beitrag zu den Stuttgarter Testtagen ein.

Ansonsten wünsche ich allen Lesern ein gutes neues Jahr, Stehvermögen bei den Vorsätzen und endlich das lang versprochene Java 7.

... link (0 Kommentare)   ... comment


Tuesday, 2. November 2010
maven-ooo-plugin-it or "How to create a GIT project"
This article has two goals:
  • to report some news about the new maven-ooo-plugin-it project
  • to give a short introduction how to start a project with a local GIT repository and push it later to github

Local GIT Repository Created

Yesterday I decided to start my own integration test project for the maven-ooo-plugin. Here are the steps to create a GIT repository for this project (GIT must be installed):
  1. create the project directory (mkdir maven-ooo-plugin-it)
  2. change to this directory (cd maven-ooo-plugin-it)
  3. create local GIT repository (git init)
The other steps I did with Eclipse: I created a new project with the maven-ooo-plugin-it directory as new location and started the development. Later I called "Team > Share Project..." to connect the project to the local GIT repository and to commit my new files.

Pushed to GITHUB

Today I wanted to push this project to github. If you log and follow the Dashboard link you find a New Repository button which I used to create the maven-ooo-plugin-it repository on github. Now I got a list of steps which I followed:
  1. cd cd maven-ooo-plugin-it
  2. git remote add origin git@github.com:oboehm/maven-ooo-plugin-it.git
  3. git push origin master
That's all.

... link (0 Kommentare)   ... comment


Saturday, 23. October 2010
News from maven-ooo-plugin
The maven-ooo-plugin is now nearly working. mvn package generates now an OpenOffice plugin with .oxt suffix. But not always. It is hard to find the reason why the registration of the plugin can fail.

As I learned today one reason for an com.sun.star.deployment.DeploymentException can be:
  • an incomplete classpath entry in the generated manifest file,
  • a missing __writeRegistryServiceInfo or
  • a missing __getComponentFactory method in a Java component
Unfortunately you get not really a hint form OpenOffice if the registration of a plugin fails. For more info you can read the OpenOffice forum.

... link (0 Kommentare)   ... comment


Wednesday, 15. September 2010
Java Aktuell mit PatternTesting
Vor einigen Monaten hatten sich die DOAG (Deutsche Oracle Anwendergruppe) und verschiedene Java User Groups (darunter auch die JUGS in einem gemeinsamen Dachverband, der iJUG zusammengeschlossen. Ursprünglich war geplant, die Zeitschrift "Java aktuell" zum Java Forum Stuttgart rauszugeben - das hätte perfekt mit dem Vortrag "Pleiten, Pech und PatternTesting zusammengepasst, da genau zu diesem Thema auch ein entsprechender Artikel drin steht.

Na ja, jetzt sind es halt zwei Monate später. Aber wer Interesse daran hat, die Zeitschrift gibt es noch im gut sortierten Zeitschriftenladen...

... link (0 Kommentare)   ... comment


Sunday, 12. September 2010
PatternTesting 1.0.2 released

Two objects which are equals should return the same hash code (and not the other way around, as some developers think).

...Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
This is corresponding Javadoc about the equals method. For those who forget this PatternTesting offers now an ObjectTester which checks classes with overwitten equals methods:
    ObjectTester.assertEquals(my.little.Dummy.class);
The ObjectTester will create with this call two Dummy objects to check the implementation. If it is not ok an Assertion Error will be thrown.

You can also add a package to check if all classes in the package have a correct equals/hashCode implementation:
    ObjectTester.assertEquals(Dummy.class.getPackage());
    ObjectTester.assertEqualsOfPackage("my.little");
Both calls are identical. You can also exclude classes from this check. This is sometimes necessary for classes where the constructor produces different objects (as is the case for the Date class, for example).

In a similar way you can check classes with the SerializableTester and CloneableTester if they are really serializable or clonable.

... link (0 Kommentare)   ... comment


Wednesday, 1. September 2010
Maven an Projekt-Struktur anpassen
Oft steht man vor dem Problem, dass man ein bestehendes Projekt auf Maven umstellen will, ohne die Projekt-Struktur umzustellen. Das geht mit folgendem Eintrag in der POM:
<build>
  ...
  <sourceDirectory>${basedir}/src</sourceDirectory>
  <testSourceDirectory>${basedir}/test</testSourceDirectory>
  <resources>
    <resource>
      <directory>src</directory>
    </resource>
  </resources>
  <testResources>
    <testResource>
      <directory>test</directory>
    </testResource>
  </testResources>
  ...
</build>
In diesem Beispiel liegen die Sourcen unter src und die Test-Sourcen unter test (inkl. der jeweiligen Resource- und Property-Dateien).

... link (0 Kommentare)   ... comment


Tuesday, 10. August 2010
maven-ooo-plugin
Two weeks ago I started to automate the build process for an OpenOffice extension project (Java). I was happy to found a Maven plugin and a description on the OpenOffice wiki. But the last log entry on the CVS page says it: the development was started - that's all.

At github I found an enhancement of this Maven plugin. But the only stuff which was working on my MacBook was 'mvn archetype:create...'. Because I needed the plugin I forked it to my maven-ooo-plugin clone and tried to continue the work of Cédric and Frédéric.

What's working:
  • mvn archetype:create (more or less, no changes from my side)
  • mvn generate-sources (call of idlc, regmerge and javamaker, see OOo Java Eclipse Tutorial)
What does not work:
  • mvn package (creation of OXT, the OpenOffice extension)
I have tested the plugin on MacOS and Linux, but not on Windows (I have no Windows computer). The next steps I plan is to begin with the .oxt creation and to look for a Maven repository where I can deliver it.

... link (0 Kommentare)   ... comment


Wednesday, 4. August 2010
Umlaute und SAXParseExceptions
Neulich hatte ich das Problem, dass beim Validieren einer XML-Datei immer eine SAXParseException auftrat, sobald Umlaute ins Spiel kamen. Ursache dafür war folgender Aufruf
    validator.validate(new StreamSource(reader))
Marc Guillemot macht mich darauf aufmerksam, dass in den Javadocs zum StreamSource-Konstruktor der folgende Hinweis enthalten ist:
...Normally, a stream should be used rather than a reader, so that the XML parser can resolve character encoding specified by the XML declaration...
Und tatsächlich - nachdem ich den Reader durch einen InputStream ersetzt hatte, lief mein Testfall ohne Fehler durch.

... link (0 Kommentare)   ... comment


Sunday, 18. July 2010
PatternTesting 1.0.1 released
Today PatternTesting 1.0.1 was released. Some feedback from the Java Forum Stuttgart and some minor bug fixes were included. For more info see the release notes.

If you use Maven PatternTesting is not yet sync'd to the Central Maven Repository (the ticket for upload is still "reopened"). So add labs.agentes.de/repository to your POM as described in Build with Maven.

The next event where you can watch PatternTesting live will be probably the gearconf in Düsseldorf. I plan to present a little drama with Christian Heise about a normal day in a developers life.

Stay tuned...

... link (0 Kommentare)   ... comment


Monday, 5. July 2010
JFS reviewed
Zusammen mit meinem Kollegen, Christian Heise, hatte ich die Gelegenheit, über PatternTesting in Form eines kleinen Theaterstücks zu referieren. Allerdings wurde aus dem fiktiven Theaterstück bald Realität, als mein Kollege nach dem Vortrag ins Geschäft zurück musste. Die vorgestellten Beispiele sind im Maven-Repository oder im CVS zu finden.

Daneben gab es viele erstklassige Vorträge auf dem Java Forum Stuttgart. Als Mitorganisator war es nicht immer einfach, sich für die richtigen Vorträge zu entscheiden, aber ich denke, es ist uns ganz gut gelungen. Etwas blöd war die Lage des Mozart-Saals, bei dem man erst mal raus in die gleißende Sonne musste, ehe man dann in ein dunkles Loch hinabstieg. Aber von dieser "Umleitung" haben wir leider auch erst kurz vorher von der Messeleitung erfahren. Auf Heise Developer steht ein sehr schöner Artikel über das Java Forum, dem ich mich nur anschließen kann.

... link (0 Kommentare)   ... comment


Sunday, 20. June 2010
PatternTesting 1.0.0 released
Since 0.9.9 end of last year it was quite calm about PatternTesting. But now PatternTesting 1.0.0 is released.

What's new with 1.0.0? For Maven user the group id has changed to "org.patterntesting". While it is not yet sync'd to Maven's default repository you can find it in labs.agentes.de/repository/.

For Non-Maven user the download was now simplified. You need only to download patterntesting-libs-1.0.0-bin.zip from Sourceforge which contains all PatternTesting libraries and the libraries where PatternTesting depends on.

Some of the samples are now documented in the PatternTesting Wiki under Getting Started but are not yet available for download. This will come with PatternTesting 1.0.1. But you can find the sources in CVS below the patterntesting-samples module (the intro and jfs2010 directory).

With PatternTesting 1.0.0 also the home page has moved to patterntesting.org. If you are interested in PatternTesting you can see it also at the Java Forum Stuttgart at 1st July.

Happy PatternTesting...

... link (0 Kommentare)   ... comment


Thursday, 17. June 2010
Eclipse Demo Camp ruft...
Bald, bald, bald kommt die neue Eclipse-Version "Helios". Und passend dazu gibt es am 30. Juni ein Eclipse Demo Camp in Stuttgart als kleine Einstimmung auf das Java Forum Stuttgart...

... link (0 Kommentare)   ... comment


Monday, 7. June 2010
Der LinuxTag ruft... (Teil 2)
LinuxTagEndlich sind auch die Folien zu "Pleiten, Pech und PatternTesting" fertig. Beide Foliensätze sind in www.agentes.de/download/linuxtag-oliverboehm.zip zusammengepackt.

... link (0 Kommentare)   ... comment