|
Java
[
Brett
]
11:13, Friday, 17 March 2006
I got back into doing a small feature enhancement for Continuum the other day. There was just one problem - after I built Continuum myself and ran it, my machine dropped to a blue screen of death and rebooted. (Yes, I'm back on Windows). This was pretty strange, as running Continuum that others built work just fine, and I really didn't have time to investigate it any further.
[
Brett
]
21:39, Monday, 6 March 2006
TestNG has been on my "must play with that some day" list for quite some time. Though I'm yet to write any significant tests with it, I was lucky to recently get some exposure to it to prod me along. This came in the form of support for Maven 2 contributed by Jesse Kuhnert, who not only did the initial patch but continually and patiently prodded me to look at it. I'd also listened to Cédric's JavaPosse podcast (or at least the first half, it seems to cut all the old ones off in the middle). I'd also started to get the IDEA plugin, assuming I got the right one The main reason I had put it off for so long was that I hadn't yet learned much about actually using TestNG and I knew I was going to have to make some changes to our test runner code called Surefire that has been around a long time and not evolved with the Maven 2 architecture. The patch for TestNG worked out of the box, but didn't (couldn't) integrate with other features. There were some rough edges along the way. Since the patch was using a few internal APIs from TestNG that were public, upgrading through releases that had come since constantly broke the code. Might be time to introduce them to Clirr, another of my favourite new toys :) However, the refactoring is now done and the TestNG code all revisited, and we've landed support that is comparable to JUnit (3) and the basic POJO test runner that is built in. It supports all of the fork modes (none, once for the whole suite, or fork for each test set), but more importantly integrates with anything else in the build lifecycle, such as Cobertura, without any additional configuration. This required very little TestNG specifics, so hopefully the basis is now there for other providers, as we start to see requests for JUnit 4 roll in. This is pretty satisfying, as we get to see the fulfilment of Maven's promised build knowledge reusability in action. Once released, using TestNG tests is just a matter of including: <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>4.6.1</version> <scope>test</scope> <classifier>jdk15</classifier> </dependency> </dependencies>
Another great thing is that you can try out TestNG immediately, even with your JUnit tests in place - the test runner finds each Java file and sets the JUnit flag for tests if appropriate so that they can be mixed in the directory with TestNG tests. There are some instructions for those that might be game enough to test it before the release, but it is not quite there yet and there are still some minor bugs to be resolved. Hopefully, these won't hold it up for too long. All in all, I think this is a great development and I certainly anticipate trying out TestNG on my current project. Just as soon as I get through all the mail I haven't read while I was playing around with it. Technorati Tags: maven
[
Brett
]
22:01, Tuesday, 10 January 2006
Do yourself a favour - check out Jetty6.
Luckily, Jetty6 to the rescue. I've heard much about it recently and I know they just did a Maven 2 plugin that sounded cool. I wasn't really aiming to learn another new technology, but thought it was worth a shot since it was on my todo list and I wasn't getting anywhere. Less than 5 minutes later, the environment is running flawlessly with features I've had to fumble around to set up for other containers in the past:
First, the normal Maven2 stuff: run the archetype command to generate a skeleton webapp project, start adding web content, and run mvn package to build the WAR. I'd done all this before using Tomcat today. Because of the way I was using Tomcat, I wasn't using mvn package, but had used mvn idea:idea to generate the appropriate webapp IDEA module and was letting it do all the exploded webapp creation in the Maven layout, so I could continue to use that as is. To set up Jetty6, I added this to the POM: <plugin> The rest of the defaults were fine. Then: mvn jetty6:runJetty is now sitting on localhost:8080 with the webapp running, listening for changes. This is my ideal set up for development, and I don't see myself going back any time soon. A huge thanks to the Greg and Jan for their work on this. I'm really looking forward to using it some more.
[
Brett
]
11:45, Friday, 6 January 2006
Both Steve and Lars have been talking about how they think Maven repositories could be improved. Lots of good points, lots I agree with, lots I'd have already done if there were more hours in the day :)
The good news is that you can help - we've gotten plenty and have seen quite an improvement since Maven 2.0 was released. There's still work to do, but we are moving forward.
[
Brett
]
13:26, Friday, 23 December 2005
It's been a fruitful hour or so realising some things about how IntelliJ works and how the debugger behaves differently to running the code outright. Lesson 1: The appearance (or lack) of <Click to see difference> in Junit results is not random. It only appears when you are comparing Strings in assertEquals - for objects, you get the traditional "expected <....> but was <....>". So if your String methods are consistent with equals(), then you can put a .toString() in your assertEquals to get this to appear. Or, a better solution: Lesson 2: You can copy the text between <...> in the junit output to the clipboard, then select the second set, right click and say "Compare with clipboard". This gives you effectively the above without modifying your assertion questionably. Lesson 3: The debugger changes the way your code executes, but only if you step through. Specifically, if toString() has side effects. This one bears more explaining. My tests failed under Maven. My tests failed when run from IntelliJ. My tests failed when I run through the IntelliJ debugger without breaks. But as soon as I set a breakpoint and then continue execution, test succeeds. I'm trying to figure out why equals() is broken (its failing, but toString() produces identical results and displays all the elements), but stepping through is not going to help. Why would it be different when stepping into the debugger? Because some of the variables were lazily initialised, and this was done in toString() via a call to a getter, but not equals() which was just using the variable reference. The debugger, when stepping, calls toString() on methods. This probably also highlights why its not a hot idea for toString() to have side effects :) Things I should have known already, but weren't immediately obvious at the time.
[
Brett
]
21:37, Monday, 28 November 2005
Mergere has an opportunity for a developer in our product development team, developing our software lifecycle management system, based on Apache Maven and Continuum. The role includes responsibility for all aspects of a project, including helping to identify requirements, designing and documenting specifications, implementing and testing solutions, and managing time lines for the successful and timely delivery of the projects. Mergere offers a flexible, distributed work environment. We follow the best practices of Community-oriented Realtime Engineering (CoRE) to increase project visibility and lower communication overheads. Resumes should be sent to brett *at* mergere *dot* com. OpenDocument, PDF or plain text formatted are preferred. Specific Responsibilities: * Design and implementation of Mergere products * Adhere to the product plans throughout project life cycle * Identify possible project risks and implement corrective action to ensure project success * Work with Mergere sales, marketing, architects, and quality assurance, to ensure successful project completion * Work with Mergere community-oriented engineering team that participate in relevant open source projects * Work with Mergere client technical services to ensure products meet the requirements of clients * Participate in ongoing design and process improvements related to planning, development, and delivery of Mergere solutions * Participate in improving Mergere business practices and processes Required Skills: * 4+ years experience in software development * Strong Java programming and design skills * Knowledge of different development methodologies * Details and results oriented * Efficient and effective when working independently, with cross-functional teams. * Excellent communication (verbal, written and presentation) and interpersonal skills * Proven technical and organizational skills * Thrive on working in a fast-paced environment * Effective problem solver * A driven and positive personality * Able and willing to learn Mergere product offerings * Experience in using Apache Maven and related tools * Active involvement with a Java Open Source community * Able and willing to travel 4-6 weeks per year
[
Brett
]
18:18, Wednesday, 22 June 2005
Looks like there a few fun gatherings happening at JavaOne next week. I'm a first-timer, so I'm looking forward to it. <plug> I thought I'd get the word out - hope to see you there, and during the conference drop by the Mergere booth and say hi! (apologies to javablogs readers who see this twice... I've filed it! http://jira.atlassian.com/browse/BLOG-156) **Seating is limited -- Register Now to Attend** This free event includes appetizers, open beer and wine bar, and t-shirts for all attendees!
[
Brett
]
12:40, Wednesday, 1 June 2005
I've been given the opportunity to present on Maven 2.0 and Continuum at the Sydney Java Users Group tonight at 6pm. I'd encourage people in Sydney to get along to the group if they can. It's free, and they usually have some great speakers there, me being the exception :) All the details are at:
[
Brett
]
23:30, Monday, 25 April 2005
The Maven team have released a set of Ant tasks for performing dependency management within your Ant scripts. This includes:
The tasks are based on the Maven 2.0 artifact handling code, so behave identically. The version included is slightly newer, from the upcoming alpha-2 release. This gives you access to the more than 8500 artifacts available in the Maven central repository, and the ability to utilise the published artifacts from other Maven 1.0 or Maven 2.0 built applications. An example use: Download: http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-artifact-ant-2.0-alpha-1-dep.jar
[
Brett
]
17:40, Tuesday, 31 August 2004
This arrived today (right now it can be viewed here: http://javablogs.com/ViewHotBlogEntries.action)
[
Brett
]
11:30, Friday, 23 April 2004
After a long break, the Sydney JUG meeting was on again last night and had the privilege of seeing Mike Cannon-Brookes deliver another talk on SiteMesh (he originally spoke about it in the context of java.blogs at SJUG last July. I gave a thought to investigating it at the time - and got as far as downloading 1.5 and reading the docs (the ones that weren't marked TODO at least!), but didn't see the advantages over Tiles. However, it was good to see it given more attention last night and got to learn about some more advanced features like DecoratorMappers and inline decorators. It is more obvious now that SiteMesh might be the better solution for us, even in a Struts environment. The advantages I see in SiteMesh over Tiles are: Good luck at the TSS Symposium Mike!
[
Brett
]
09:04, Friday, 5 December 2003
I finally got around to picking up a copy of JUnit in Action today. I recently read the sample chapters from TSS and it's great reading. I thought I knew my way around writing tests pretty well, but I've learned some good ideas on mock objects from this. It reads really easily, very "step-by-step", and it should be good for evangelizing unit tests to fellow team members. Nice job Vincent and Ted!
[
Brett
]
08:15, Monday, 17 November 2003
As any product approaches version "10", there seems to be an aversion to using a version. Red Hat Linux stopped at 9 and merged with Fedora. Mac OS decided roman numerals were the go, Microsoft started throwing all sorts of years, letters, and marketing symbols behind the versions of their software. Sun's application server isn't really that close to 10 (currently at 7 and I'm not sure there were really 6 versions before that), but it seems that the history of rebranding it is going to continue. Sun ONE as a brand is probably not that old itself, but it seems that the J2EE 1.4 RI will now equal Sun's application server (I'm not sure they were that much different before) and be called the Java System Application Server. This move actually makes a lot of sense to me, but I wish they'd make up their minds! I've actually been trying out S1AS7 recently as we are going to have to start doing some work with a JMS queue and don't currently own an application server. I've had some issues configuring it and loading any apps that use log4j, but other than that it was pretty simple.
[
Brett
]
08:04, Tuesday, 11 November 2003
It's been a long time coming (I promised myself this two years ago!), but I finally took the plunge and started writing some Cactus test cases. I had it in my head that it was going to require a lot of work, but thanks to a lot of recent usability enhancements by the Cactus team, and a well-written Maven plugin, setting up was a breeze. Once I had a simple test case in place, I just had to add 4 or 5 properties to my We use webapp deployment descriptors in Tomcat 4.1 (and in resin via an xml entity included in resin.conf) to configure all of the JNDI resources which were necessary when moving onto a more complicated test case. I originally fudged around with trying to keep one copy of these but decided in the end that a customised server.xml with them included was the best solution for now. Making the cactus plugin aware of these files might be one of my other side projects. There have been a few small things that can still be improved (which I promptly entered into bugzilla :) but overall it's great. I also have to say that the documentation is quite good too - something usually missing in open source projects - which made a huge difference.
[
Brett
]
08:17, Friday, 7 November 2003
For those that couldn't be in Sydney to see Mike Cannon-Brookes speak at SJUG a few months back, this tech talk on TSS has a lot of similar elements in there. Interesting reading/listening depending on your preference for video or transcript. I've promised myself I'll give WebWork2 a try "real soon now", but regardless I think we are probably tied to Struts and Tiles here due to the large amount of infrastructure and code invested into it by now. Not that there is anything wrong with Struts! There certainly seems to be a lot of favourable comments for WebWork over Struts, but I still find I can churn new actions out nice and quickly, and don't tend to get too bogged down in repetitive form beans by reusing one across a sub-application and using validator to define all the rules on the input. Still, I can see where it can be cleaner, and maybe WebWork is the way to go. Has anyone had a negative experience with WebWork2? That's something I'm yet to hear.
[
Brett
]
07:57, Tuesday, 4 November 2003
I'm impressed. I haven't checked out JMeter for some time, although even when I did use it briefly about August last year for a large project's load testing requirements, it did the job. The more recent versions have added a little polish, but now come with an ant task for automating the load test run and the server-side capacilities seem a lot clearer although I still haven't given them a try. I think I'll be using it more often from now on, as automating such tests is a necessity, and its great to be able to test several components of your app in one platform (full web requests vs just the SQL you are running via the JDBC tests). Add in a little functional testing by checking so pre and post conditions and you've got a reasonable solution. Considering we've used a commercial product with which I no longer have any confidence in its consistency or results, I'm really impressed with JMeter. One thing though, the "add component" interface and the open/save model needs a serious redesign. Probably my only complaint a year ago and it is still there. File open does an import, and save does a subtree export. This is fine, but really it needs a workspace open/save option that is the default, and adding bits into the work space under separate test plans needs to be easier. I think it is possible under the current interface, but its certainly unclear. But this is only a minor complaint, because once it is setup you rarely worry about it.
[
Brett
]
11:03, Friday, 5 September 2003
I can't believe I'm still discovering neat new things in IntelliJ. Ok, so that's partly to do with not having done a lot of development since I got it, which is unfortunate.
I'd recommend checking them out. Build 915 is much more stable than 908, and they have several new features over the 800's - I wonder if they are getting close to a release? (we get free upgrades until the end of September, so I hope so! :) I still can't seem to get the hotswapping to work (not that I use it often) though, nor the error reporting through the proxy. That's a shame because there are a couple of errors I have noticed.
[
Brett
]
18:29, Thursday, 4 September 2003
I've been playing with DBUnit recently, and it is pretty much everything I was looking for.
[
Brett
]
18:32, Wednesday, 13 August 2003
I downloaded the latest IntelliJ Aurora build yesterday. It seems more stable (no more syntax errors popping up warning dialogs!), and added some new features such as the ability to indent XML files with 2 spaces while Java with 4.
[
Brett
]
18:46, Sunday, 3 August 2003
Being a new IntelliJ user, I must admit to not having done a lot of research about what was available for it plugin-wise. I've now found the community site and the early access site. A few of the plugins are quite handy, but I was much more impressed by IntelliJ Aurora, the current beta version. Not only is it running rather smoothly on my laptop (128mb RAM rarely cuts it for an IDE these days), but the look and feel is now much more polished, and the featureset has grown quite a bit. I'm especially pleased to see line wrapping added to the reformatting commands, and the new project enhancements are exactly what I was looking for. |