Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

TagUnit for the Display Tag

Simon Brown was nice enough to whip up an application for testing the display tag library. Amazingly enough, it passes all the tests! At first glance, Simon's TagUnit seems to just test getters and setters and if classes are loadable. I think these are great tests, but for truly robust tests for the display tag, I think we need tests that test specific behavior (i.e. you click on a column heading and it sorts that column). IMO, WebTest is probably the best candidate. The problem is, it might take awhile to write these tests, and no one seems to have much time to work on the display tag project. Any volunteers? ;-)

Posted in Java at Mar 23 2003, 08:24:10 AM MST 2 Comments
Comments:

Sorry Matt, I forgot to mention in my e-mail that the WAR file I sent you just runs the automatic tests for a tag library and you're exactly right in they test that getters, setters and that tag/TEI classes are loadable. However, this is just a small part of the TagUnit framework because also included are a whole load of tags that can be used on a JSP page to perform assertions. For example, there's an <assertEquals> tag to compare two pieces of content. There are also <assertNotEquals>, <assertContains> and <assertMatches> tags for further comparing content. We can also assert for the existence of attributes that a tag introduces into the page with the <assertPageContextAttribute> tag, and we can also run tests over the TLD file to check the contract that a tag provides. For example, you might want to automate testing the tag specification so that you know when somebody modifies characteristics of the tag, including the names of a tag's attributes and whether they are required and accept request-time expressions. Essentially, TagUnit provides a way to write JUnit style tests using custom tags within a JSP page rather than the Cactus method of using Java code. This allows you to build up a suite of tests based around how the tags are used on a JSP page, rather than simply calling their methods from within Java code. Apologies for not writing any of these tests for the display taglib - it was late. ;-)

Posted by Simon Brown on March 23, 2003 at 10:18 AM MST #

Just reading my comment back ... I put angle brackets around the tag names so they got zapped! TagUnit has tags including assertEquals, assertNotEquals, assertContains (string contains substring), assertMatches (string matches regex), assertPageContextAttribute (checks for existence of attribute that a tag sets/introduces into the page), assertBodyContent, assertAttribute, etc. Sorry about that!

Posted by Simon Brown on March 23, 2003 at 04:23 PM MST #

Post a Comment:
  • HTML Syntax: Allowed