Nov 27 2008

Working in the shop with dad…

Category: WoodworkingPhil @ 8:07 pm

My parents came for a visit this Thanksgiving and I was able to spend some time in the shop with my dad. I installed a cyclone dust collector last Spring, and realized that this thing really  sucked…  I installed the dust collector on the outside of my shop,  and when it runs, it basically creates a vacuum inside my shop. The amount of air being removed from room is amazing, you can really notice it when you try to shut the door. This was not a big deal during the summer months (other than it might not have been running at peak efficiency), but now that it is cold outside, it was sucking all of my heat out with the dust!  We came up with this idea to box in the dust collector filter, and push the clean (warm) air back into my shop.  We built a 66″x 24×24 frame out of split 2x4s and covered it with drywall. I still want to make a frame around the front panel, so I can take it off easier. I need to (should) clean the filter out every so often, to keep the suction at a maximum level. We then cut a 14×14 inch hole in the back of the box, which when went through to my shop. Inside the shop, we covered the hole with a furnace return grill; it looks pretty cool.  We did not make any real dust after putting it together, but the initial tests seems promising. The cyclone sounds a little different when it running, but not that much louder. It really equalized the pressure in the room, as the doors are much easier to close now. Hopefully, the motor is not working as hard and actually pulling more air through the duct work.

All in all, I think it was a pretty good little project, well worth the effort. I had been wanting to move the filter bag for months. I originally had it hanging right in front of the cyclone, which was always in my way! Now, I have no excuses to not work in my shop!

Nov 23 2008

XBox (Hardware) = Pathetic

Category: MiscPhil @ 1:40 pm

I’m no gamer, but when you have have two boys (13 and 11), you can avoid it!  We purchased an XBox 360 last year for Christmas… can you say “excited” kids?  Anyway, that XBox lasted about two (2) weeks and we were introduced the the “Red Ring of Death”… Sounds like a really cool video game, right? Unfortunately, it means your XBox is toast! We returned it and decided to buy another one from Best Buy, only because they offered an extended warranty. Normally, we do not buy the warranty, but if you do a Google search on XBox reliablity, and you will see thousands of pages of people with issues…. I hoped it would be money well spent, at least it  would make it easier on the kids.

Needless to say,  less that eleven months later, we had our second failure, this time it was an E74. When I take it back to Best Buy tomorrow, I will find out the real value of the warranty. Rather than boxing it up and mailing it off to Microsoft, I believe I just take it back to Best Buy and they give me a new one… That’s the way it is supposed to work… I think… I hope!

The XBox hardware might be a piece of junk, but I do think they have a pretty nice on-line environment. It is really cool all of the stuff the kids can do on line. We installed the XBox Live 2.0 upgrade last week; it looked really cool from the few minutes I watched. I will be very interested to hear how the Netflix integration works out… unfortunately, we don’t have Netfix!!!!

Nov 23 2008

Unit Testing with Spring 2.5.x

Category: Java,TestingPhil @ 1:08 pm

Sometime back, using the Spring Framework and jUnit 4.x was not very elegant. Spring only supported dependency injection by sub-classing their AbstractDependencyInjectionSpringContextTests class. The coolest thing about jUnit 4.x was the implementation of annotations and the elimination of the requirement to extend the jUnit TestCase class. Obviously, this was considered an issue by many people, as several projects created their own solutions for jUnit 4.x integration. One such implemenation was Unitils, which I used on several projects. I did not take advantage of all of the Unitils features (Mock Objects, JPA, or DBUnit integration), only the dependency injection and a little of the Hibernate and Transaction management support.

Someone recently hipped me to the fact, that somewhere along the way, Spring finally added support for jUnit 4.x. I wanted to see if I could possibly eliminate the need to Unitils.  Only have only played with the integration for short time, but it appears to do what is required. The only real issue I encountered was having to downgrade from jUnit 4.5 to jUnit 4.4.  Unfortunately jUnit 4.5 broke the integration, and will not work. However, moving back to jUnit 4.4 solved all of the issues.

The basic class level annotations that you need to be aware of are @RunWith(SpringJUnit4ClassRunner.class) and @ContextConfiguration(locations = { “/com/sample/resources/applicationContext.xml” }).  I have seen the @RunWith annotation used by many new jUnit extensions, it seems pretty cool. The ContextConfiguration is pretty obvious, you can provide a list of XML files which contain your Spring context

Next you can simple provide the @Autowired or @Resource annotation to your test class properties. Spring will then inject those objects for you at execution time. They did provide the @Qualifier(“alternateBeanName”) annotation which allows you to remove possible ambiguity.

One thing that was not entirely obvious to me was the @TestExecutionListeners annotation. One of the Spring examples had it set to {}, which effectively turns off the dependency injection. It would have best to leave it out! Anyway, there are several other Listeners that you might want to be aware of, such as dealing with Transactions and a dirty spring context.

On of the more interesting annotations, (which was not in Unitils) was the idea of making tests specific to an environment. While this  is probably not that common, I have had situations where I can only run a test in the CI (Continuous Integration) environment, or maybe only I only want it to run on my development box. The @IfProfileValue annotaion provides this ability. The default implementation allows you to do simple “if logic” base on Java properties. It is also possible to define your own configuration (something that determines the value of the requested attributes) class, using the @ProfileValueSourceConfiguration(Include.class). Pretty cool, I can actually see using this feature in the future.

There are plenty of other annotations that will be useful, such as @BeforeTransaction, @AfterTransaction, @Rollback, and @NotTransactional.

I believe that the @RunWith and @ProfileValueSourceConfiguration annotations can be very useful in building a consistency unit test strategy, effectively hiding much of the noise associated with most jUnits (noise = configuration and setup tasks). Personally, I find jUnit 4.x much more elegant that the original (pre 4.x) strategy, providing a much cleaner implementation.

I believe that unit testing is essential to projects, and will continue on my personal mission to push for Test Driven Development. I truly believe that done right, “Testing is basically Free”… especially when you consider the integration environments provided by Spring and development tools such as Eclipse. How can anyone afford NOT to test?  Enough soapbox for the day, here was yet another little TDD article.

Nov 20 2008

Ubuntu 8.10 Update…. and OpenOffice 3.0

Category: UbuntuPhil @ 9:51 pm

This was not one of my more pleasant Linux experiences. The upgrade seemed to take more than it gave! Anyway, my issues have finally settled down and everything is almost working. (I’m starting to miss downloading my daily bug fixes!) I believe the only real issue I have is SAMBA; I cannot access my NAS device anymore (or any windows boxes for that matter). That is kind of a drag when you need to share files!

I was really looking forward to OpenOffice 3.0 with the upgrade, unfortunately it was not ready to be included in the release. I did not want to do the manual installation, so I’ve been waiting. Tonight I Googled and found a super easy upgrade path. The upgrade seems to have worked like a champ. My machine completely rocks, especially when compared to my work computer!!! The OpenOffice applications launch in what seems like 2 seconds! And it is not even cached!

One other bummer, not related to this upgrade is Adobe Air. It still is not working on the 64-bit machine. At least it installs normally now, but there seems to a serious network problem. All of the Air applications run, but do not connect to any of the back-end services. My 32-bit installation works fine…