Win a copy of Rust Web Development this week in the Other Languages forum!

Mike Clark

author
+ Follow
since Aug 15, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Clark

Thanks for everyone's great questions and kind hospitality! I enjoyed hanging out with y'all. I hope I've helped convince you that automation benefits everyone and you'll consider picking up a copy of the book.

I'll try to stop in once in a while. For now, I need to ride off into the sunset. :-)

Thanks again!

Mike
17 years ago
Thanks, Carol! I'm glad you enjoyed reading the posts, and I do appreciate you ordering the book.

As for the Pragmatic Automation website, we've only just begun. If anybody has automation stories, tools, tips, or tricks, please help your fellow programmers get off of the treadmill by suggesting content. We have more great stuff lined up, so stay tuned with your favorite RSS reader.

Mike

[ September 23, 2004: Message edited by: Mike Clark ]
[ September 23, 2004: Message edited by: Mike Clark ]
17 years ago
You could create common patternsets as you can assign ids to patternsets



Just one way that comes to mind.

Mike
17 years ago
Hi Jeff,

You asked about getting the relationship set up, so I'll take that as a license to gush. :-)

Working with my publishers, Dave and Andy, has been a wonderful experience for me. They not only know how to write great books (and edit, and typeset, and market), but they're also expert programmers. Being able to bounce technical ideas and code off of them was invaluable for me. It's really the kind of support every technical author dreams of, I think.

Moreover, I found the entire process to be refreshing in that it was agile. Everything was streamlined toward getting a book into readers' hands as soon as possible. But at the same time they offered me a blank canvas on which to create ideas, so I never felt constrained by a process. And I got a lot of timely and valuable feedback along the way.

In addition to all the personal support, the toolset support they built was a dream for a programmer like me. Indeed, it was a critical component in getting the book to print quickly because it stayed out of my way and eliminated rework. I've written about the tool chain several times in my blog:

http://www.clarkware.com/cgi/blosxom/2004/06/25#WYSIWYG
http://www.clarkware.com/cgi/blosxom/2004/07/14#BeyondTheBook

I can't overstate just how enjoyable Dave and Andy have been to work with. Suffice it to say, if I had the time and brainpower to write another book, I'd start writing another book for the Pragmatic Bookshelf tomorrow.

Mike
17 years ago
You can certainly run Ant build files and targets within Eclipse. Indeed, Eclipse has great support for Ant, including a nice syntax-aware editor.

I'm not aware of a way to have Eclipse generate an Ant build file from the information in Eclipse's internal build system.

Mike
[ September 23, 2004: Message edited by: Mike Clark ]
17 years ago
If I simply want to monitor that a web application is alive and well, I'll just use a simple Unix shell script. Here's the description of an example that does just that:

http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/ProgramsThatGrowl.rdoc

(After scraping the site, that script does a Mac-specific thing, but you can do whatever you want. Sending a text message to your cell phone is a fun and effective thing to do, for example.)

You can just as easily do this on Windows using the 'wget' program to hit the page instead of 'curl', or better yet, by using a scripting language such as Ruby.

If you need to drill into pages, and HTTP GETs with URLs won't get you there for some reason, you can use something like HttpUnit. Here's a simple method that uses the HttpUnit API to log into a web application using a login form, which then redirects the user to a product catalog page. Then it uses the resulting 'response' object to scrape an HTML table's contents:



You can also get the DOM tree back from an HttpUnit 'response' object and traverse it using XPath, for example.

Using HttpUnit is more heavy-handed than a scripting approach, but it demonstrates another way of going about screen-scraping deep into a web application.

Mike
[ September 23, 2004: Message edited by: Mike Clark ]
17 years ago

Originally posted by somkiat puisungnoen:
Can i use this solution in Ant 1.6 or not ? and How?



I'm using the Tomcat Ant tasks with Ant 1.6.2 and it's working fine.

I use the tasks in much the same way as prescribed by the Tomcat documentation:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant

Mike
17 years ago
In the Monitoring chapter, I discuss:

- How to monitor a Java process using a simple launcher
- How to monitor health externally by putting a monitor on log files
- How to monitor health internally by building trip wires and using a debug dump command
- How to monitor through screen scraping a web application, or embedding a web server

In that chapter I also offer techniques for monitoring scheduled builds.

Is there something specific you're hoping to find in terms of monitoring a Java application? If so, let me know and I'll be glad to tell you if it's in the book.

Mike
17 years ago

Originally posted by Mikalai Zaikin:
Assuming that book is about Ant, I have asked if there is anything for Ant (for example, task definition) which allows to create different reports on commitments.



The book is about automation. Ant happens to be one automation tool for building, packaging, and deploying Java projects.

I'm not aware of any custom Ant tasks that create reports on CVS commits.

Mike
17 years ago
In Hatcher and Loughran's "Java Development with Ant" book, there's a gold mine of best practices tucked away in "Appendix D: The elements of Ant style".

Mike
17 years ago
Java Web Start, for example, checks the version of the application on the deployment server every time the local application is run. If the remote version is newer than the local version, then the local version is auto-updated. JWS has more advanced configuration options, including the ability to automatically generate and return incremental updates to JAR files, if possible.

I use JWS as one example auto-update technology. For applications that can live within the JWS sandbox, JWS works quite well.

Mike
17 years ago

Originally posted by No�l Verdurmen:
I heard the book from Mike Clark is mainly for experienced developers.



As an aside, I'd be interested to hear where you heard that.

All the reviews and such that I've read seem to agree that it's an easy book to read and apply, while still teaching the old hands something new.

Mike
17 years ago
If you've ever installed Tomcat on Windows, then you've used the NSIS (Nullsoft Scriptable Install System) installer. I like it for Windows installation/uninstallation because it's scriptable, which means you can add custom steps relatively easily. I also like it because it's free. :-)

http://nsis.sourceforge.net/

In terms of how to use NSIS, I dedicate seven pages of the book to writing an NSIS script that creates an executable installer, with a custom page in the install wizard, for the example application.

Mike
17 years ago

Originally posted by No�l Verdurmen:
I heard the book from Mike Clark is mainly for experienced developers. I am not yet very experienced, but I know a little about Ant, cvs and JUnit.

Could "Pragmatic Project Automation" also be used as an introduction into this topic?



In terms of CVS and JUnit, you'll want to check out the other two titles in the Pragmatic Starter Kit: "Pragmatic Version Control Using CVS" and "Pragmatic Unit Testing in Java with JUnit". They're intended for beginners, but veterans have taken away much from these books, as well. More information on the Starter Kit is available at

http://www.pragmaticprogrammer.com/starter_kit/

In terms of Ant, Pragmatic Project Automation has a 15-page section in the One-Step Builds chapter that shows you how to write an Ant build file that compiles and tests an example project. It's intended to be introductory material for someone who has never written an Ant build file. After that, I don't go much deeper into Ant.

The other recipes in the automation book are intended to be easy for beginners to implement. For example, the CruiseControl section walks you step-by-step through the process of configuring and running CruiseControl. In the sections where I use CVS and JUnit, the commands and tests will be familiar to someone who has used these tools. For those who haven't, that's where the three books in the Starter Kit complement each other.

Hope that helps.

Mike
17 years ago

Originally posted by Craig Demyanovich:
Have you shipped any tests with any of your software, like JDepend? If so, has anyone communicated using them to solve a problem with installation/configuration? Or, have you shipped tests only on projects on which you've consulted?



I ship unit tests with both JDepend and JUnitPerf. In the case of JUnitPerf, I've had a couple of users email with failed test reports. This is usually due to timing issues or peculiarities with versions of Java. Off the top of my head, I don't recall any installation-related test failures for JDepend, but I'll have to check on that.

By virtue of shipping tests with both of these open source tools, I've had users submit bug reports, proposed patches, and enhancement requests that included unit tests. I suspect because the tests were readily available these end-users chose to use tests as a way to 1) highlight a corner case that illuminated a bug, 2) communicate that their patch worked and didn't break existing functionality, and 3) to demonstrate how an enhancement would work if the software were changed to make the test pass. Each time I've received tests like this, I've found it to be compelling and quite helpful.

As another data point, while maintaining the JUnit FAQ I've seen recurring installation problems related to the onerous classpath. A while back I wrote a Java class called WhichJUnit that asserts that certain critical classes can be found on the classpath. Although I can't quantify how effective that has been, we seem to see less classpath-related questions on the JUnit mailing list. WhichJUnit is available at

http://junit.sourceforge.net/doc/faq/faq.htm#running_2

Apologies for the long answer to a short question. I'm using this to work through some ideas on shipping tests, and your questions are helping! :-)

Mike
17 years ago