MXUnit Blog

MXUnit is a unit test framework built by ColdFusion developers for ColdFusion developers. This represents some general rants and the like for project related stuff, unit testing, and CF in general.

Monday, August 25, 2008

Eclipse running out of memory?

At home, where I do most of my experimental development, I have a fairly substantial machine. It's windows, but don't hold it against me. It performs like a mofo. 64-bit, 4GB memory, Core2. At work, I have 32-bit, 2GB memory, Core2.

I run Eclipse 3.3 with tons of plugins. I generally run eclipse from the command line with 512M heap, using the jdk1.6 JVM

So imagine my surprise when I start getting OutOfMemory errors from eclipse at home. I traced it to the JBoss plugin, but couldn't figure out for the life of me why it was causing this behavior. I wasn't actively using any of the functionality in the plugin at the time I'd get the errors. I turned off auto-activation at startup for the jboss and a handful of other plugins, but to no avail.

And this was getting in the way of me getting stuff done. Eclipse "manage configuration" is a flaky piece of shit, so disabling suspect plugins didn't work. Thus, I did what any red-blooded American would do: wipe out any folders in the plugins/features directories that referenced jboss. It was time for a fresh start.

That fixed the memory problems and let me get back to work.

But honestly.... could you live with that answer? I couldn't. So off I went. I asked the interwebs, and after nice traipse through various newsgroups and wikis and bugtrackers, I stumbled on a fix. Ooooooh, what a maddening f*cking fix.

Here's the bottom line: my memory troubles went away when I added this to my startup file:

-XX:MaxPermSize=256m

That's all.

By the way, here's where I ended up: https://bugs.eclipse.org/bugs/show_bug.cgi?id=92250. If you're interested, that bug explains pretty well why I was hitting the memory issues I had. It doesn't explain why it was JBoss plugin causing it... but right now, I don't care.

I also installed the memory monitor plugin attached to that bug. It's no better than what you get from jconsole, but marginally more convenient than attaching eclipse to a jmx session and typing "jconsole".

So, if you're getting OutOfMemory errors while running eclipse, and increasing the heap isn't cutting it (-vmargs -Xmx512M), it's possibly not a heap problem but a permgen problem.

--marc

Thursday, August 21, 2008

MXUnit 1.0.2 Now Available

MXUnit 1.0.2 is now available for download. This release adds new functionality for mocking/injecting properties into objects at time of test, which arose from this discussion. It's similar to the injectMethod functionality introduced in 1.0.1, but for properties instead of methods. Details are here.

In addition, a few more bugs have been fixed for Railo and openBD compatibility.

Finally, I want to point out again the eclipse dictionary and snippets that are available in the download. See the "cfeclipse" directory. In particular, check out the copysnippets.xml ANT file. It makes keeping your set of mxunit cfeclipse snippets much easier. It will not tramp on your existing shortcuts, as it only adds/overrides shortcuts whose snippets are in the mxunit package.

The eclipse dictionary is not the entire mxunit api.... just the public stuff that you care about (assertions, etc). There are instructions in each directory for how to "install" the dictionary and snippets.

Enjoy.

marc

Thursday, August 14, 2008

Securing a RemoteFacade.cfc

Nathan Mische has a nice article on how to let the mxunit see a RemoteFacade.cfc file sitting behind a basic authentication scheme. Check it out here http://www.mischefamily.com/nathan/index.cfm/2008/8/13/Basic-Authentication-With-ColdFusion

Tuesday, August 5, 2008

MXUnit eclipse plugin update. This one's for Barney

A new version of the MXUnit plugin for Eclipse is now available. I know... you're so excited you can hardly contain yourself! Before you hit the update button, here's what's new:

  • A new "Show Failures Only" button to filter out the passing tests and show you just the bad stuff. This is a persistent toggle, meaning that once you turn it on, subsequent test suites will continue to filter out passing tests until you toggle off. However, if ALL tests pass, the filter is ignored.
  • A new feature just for Barney Boisvert (read here for the inspiration). This is a small helper for people who use the project-level facade URL feature. This new feature is also documented in the integrated help within the plugin. Thanks for the suggestion, Barney!
  • A bug fix. Have you ever seen it where you run a bunch of tests, and maybe the console view is open on the bottom of the workbench, and the scrollbars in the test run view get hidden? If you have suffered through this tragic, disgraceful behavior, you can sleep a little easier now. It is gone.
Enjoy.

Thursday, July 31, 2008

Railo, Testing, and Stogies

Last night, Gert Franz from Railo visited our Baltimore Adobe User Group. First, thanks to Gert for spending so much time with us. Next, thanks to Nic Tunney for leading the group, as always. Finally, extra special thanks to Bob Clingan for setting it all up.

So, real quick: Railo is impressive. It's damn near unbelievable that such a small team of people could create a product so solid and forward thinking. Some of my favorite things:

  • Virtual file system. Treating an ftp site or an S3 instance as just another resource? BADASS.
  • Railo's notion of contexts. Each app is an isolated thing. We've been working around that problem with CF for a long time. With railo, it's simply not a problem
  • cfvideo is really, really cool. Now, I know that a lot of people don't want to see this in CF. And I know it won't be in the open source version of Railo. Still.... watching the kinds of sweet things Gert demoed, I can see its value
And there's so much more but I don't want to blabber.

Two other things: I asked Gert if they expected to keep up the same pace of development when it goes open source. One thing he said was that the first thing they do when they get a bug is write a test. They fix the bug, prove it's fixed with the test, and keep that test around forever. We try like hell to do this with MXUnit, by the way. Anyway, he said that he believes part of the reason they can move forward with features is that they just don't have a whole lot of bugs. I took it to mean that their use of TDD contributes to that quality. So... mad props, Gert!

Finally, the coolest thing of all: the Davidoff site runs on Railo. For those not in the know, Davidoff are a luxury cigar. In fact, I'm so cheap I've never had one. But still... I thought that was rad.

Here's what I came away with: up until now, my only experience with Railo has been working to get MXUnit running on it successfully. But now, after last night's presentation, I'm definitely going to see if I can get some of our apps at work running on it. I'm particularly interested in looking at the performance.

When OBD came out, there was nothing about it that made me consider for even a second approaching the subject where I work. With Railo, though, I see definite potential and consider it worth my time to pursue this investigation.

And it's not just because I got a free t-shirt.

Wednesday, July 30, 2008

Coldbox and the CFEclipse Frameworks explorer

I just tried installing CFEclipse 3.2 beta again, and I see that coldbox still isn't supported in the Frameworks explorer. So I'm like, "hey, I remember Mark saying that the frameworks explorer was a framework for exploring frameworks", so I decided to dig into the XML and see if I could get it going. So I'm poking around in the cfeclipse code, just getting familiar with what's going on, and I fire up a debug session, and I add a coldbox project, and I set the coldbox.xml.cfm file as a config file, and I open up the explorer, and there's all these rad icons in there. So I'm like, WTF?

So I open up the frameworks config directory, and lo and behold, there's coldbox right in there already.

Now, the file timestamps indicate that this was in there before 1.3.2 was released, so I'm not sure what might have happened that this stuff didn't make it into the build. Nonetheless, that saved me a lot of time because all the work was done. However, this didn't solve the central problem, because if the stuff ain't in the distribution, how do I get it in my current CFEclipse install?

Here's what you do:

1) download the attached file and unzip it into your eclipse\plugins\org.cfeclipse.cfml.frameworks_1.0.3 directory

OR, if you want to get it from source:

1) check out the cfeclipse frameworks directory from SVN. If you want to save yourself the headaches, just read this (http://trac.cfeclipse.org/cfeclipse/wiki/CheckingOutCFEclipse) and do the team project set thing. it's a snap.

2) that will get all the cfeclipse code into your workspace. NOT your current plugins directory... your workspace.

3) go into your workspace, navigate to the frameworks project, and copy the config and icons directories into another temp location

4) remove the .svn stuff from there

5) now, take those directories and copy them into your eclipse\plugins\org.cfeclipse.cfml.frameworks_1.0.3 directory

6) restart eclipse.

7) find a coldbox project, find the coldbox.xml.cfm file, right click, set as config file, and bam. Done!

Now, looking at how frameworks explorer works, I gotta tell you: it is unbelievably cool. Mad props to you, Mark Drew, for this gem.

esher, out!org.cfeclipse.cfml.frameworks_1.0.3.zip

Tuesday, July 29, 2008

It's not you, Arturo...

A little over a year ago, I sprung 5 bucks on an Arturo Fuente. Until then, I'd never spent that much on a stogie.

It was a life-altering cigar. Literally. I've spent more money on Fuentes since then than I ever would've spent on stogies had I stuck with my 1.20/stick cheapo La Fincas. Not life altering in the same way that marriage or children are, not even close. But still... Fuentes have been my staple stogie, a friend I return to time and again.

Since then, I've bought boxes of Monte Cristos, smoked kickass Cohibas, Ashtons, and all manner of brands in between. I won 3 monster Gurkha "shaggy" cigars at an event at Cross Street Tobacco in Federal Hill, stickering at 15/stick, and they were magnificent. To the hunchbacked guys huddled over their rolling tables in the forests of Nicaragua and Honduras, a hearty "Thank you!"

My wife and kids are out of town this week, at my in-laws. I couldn't go b/c of work, but I miss them terribly. So I decided to while away the time with good beers (Dogfish), programming, and cigars. My wife and daughters come home tomorrow (Thank God!), so I decided to spend the last night of my short-lived quasi-bachelorhood with a new stogie.

I'm sorry, Arturo. It's not you. I still love you. But damn...

Onyx Maduro, you .... *gasp*.... complete me. (super ghey reference, I know)

Lord, what a stogie. A 2-hour smoke, burnt down to the very nub, and excellent all the way. Most stogies start to suck after an hour or so. They get hot, tarrish, nasty. But this one, jeeeeesh.

I'm in awe.

I married my bride at 4 on a Saturday afternoon. My firstborn, Alexis, was born at 10:15 on a Saturday Night. My dear little Sidney was born in the wee hours on a Thursday. Those nights are reserved in the "Best Saturday and Thursday nights of my life".

Tonight, thanks to you Onyx, gets the Wednesday slot.