- Interesting recent long discussion (with a bit of framework flame-war in between) and tips on when to pick what web client framework. Tapestry, Wicket, Stripes, GWT, Flex seem to jump out.
- Interesting Javascript optimizer: Razor Optimizer. It dynamically analyzes the runtime profile information, trying to load each Javascript function only when needed, potentially creating 60-90% savings. It does require a client and server component. The question is: are you prepared to take a (small?) risk that your Javascript is dynamically modified?
- Good article that explains why Scrum often fails as implementation of Agile. Lots of times Scrum is only seen as fast Sprints and Scrums. But: "Don't leave out the 'regular' agile good engineering practices". Check also the comments for good tips.
- A good introduction to RESTful webservices.
- Great, soapUI 2.5 now also suppports testing RESTful webservices. It includes testing JSON output.
The best articles and links to interesting posts for technical team leaders building sophisticated websites, applications and mobile apps. Think about: software architecture, hardware architecture, design, programming, frameworks, scalability, performance, quality assurance, security, resolving issues, fixing bugs and Android.
Sunday, November 30, 2008
Best of this Week Summary 17 November - 30 November 2008
Thursday, November 20, 2008
JSFUnit static analysis unit testing in ADF
Introduction
Currently I'm working on the framework design of an ADF application in JDeveloper 11.1.1.0.0 (yes sometimes a man's got to do what a man's got to do ;-). One of the parts is how we are going to do (unit) testing. And one of elements in there is testing the JSF part of the ADF application. Application Developer Framework consists of several layers where the View layer consists of a JSF implementation. This JSF implementation is named ADF Faces (RichFaces) and built on top of Trinidad, the open source JSF components implementation. ADF Faces has many components Ajax-ized and has more components than Trinidad.
My eye caught JSFUnit, an open source project from JBoss. I was only able to focus on the static analysis part JSFUnit offers (it offers also other dynamic "regular unit" tests). But little information was found about that. I couldn't find any installation tips for ADF (JBoss here and here, and Websphere setup tips were available).
Thus it was just me and the computer. Here's the steps that in the end did do the job (running on Windows XP).
Setup
A couple of things are needed for all types of static analysis.
Three types of static tests are possible with JSFUnit. I'll describe setting up each type seperately. Most information was deducted from this part of the JSFUnit documentation.
Configuration static analysis
These tests test your JSF configuration. See the above mentioned documentation part for examples of what tests are performed.
TLD analysis
These tests test your TLDs. See the above mentioned documentation part for examples of what tests are performed.
View static analysis
These tests test your JSF views. See the above mentioned documentation part for examples of what tests are performed.
Conclusion
So that's it. Not hard at all! If you want to know a bit more high level stuff about JSFUnit, check this presentation by the project lead at the Javapolis conference (currently rebranded to Devox conference). And here's another introduction presentation.
The Shale Test Framework could be an interesting alternative for unittesting JSF. Needs some more investigation...
Currently I'm working on the framework design of an ADF application in JDeveloper 11.1.1.0.0 (yes sometimes a man's got to do what a man's got to do ;-). One of the parts is how we are going to do (unit) testing. And one of elements in there is testing the JSF part of the ADF application. Application Developer Framework consists of several layers where the View layer consists of a JSF implementation. This JSF implementation is named ADF Faces (RichFaces) and built on top of Trinidad, the open source JSF components implementation. ADF Faces has many components Ajax-ized and has more components than Trinidad.
My eye caught JSFUnit, an open source project from JBoss. I was only able to focus on the static analysis part JSFUnit offers (it offers also other dynamic "regular unit" tests). But little information was found about that. I couldn't find any installation tips for ADF (JBoss here and here, and Websphere setup tips were available).
Thus it was just me and the computer. Here's the steps that in the end did do the job (running on Windows XP).
Setup
A couple of things are needed for all types of static analysis.
- Download via JSFUnit Getting Started under the section “Files”: jboss-jsfunit-core-1.0.0.Beta3.jar en jboss-jsfunit-analysis-1.0.0.Beta3.jar
- Note that it was not necessary to download/install myfaces-api-1.2.0.jar or JSF 1.2 API.
- Start JDeveloper 11.1.1.0.0 and open an ADF application with Model and ViewController project.
- Right-click the ViewController project, select Properties and select Libraries and Classpath in the popup. Add the above downloaded jars there.
Three types of static tests are possible with JSFUnit. I'll describe setting up each type seperately. Most information was deducted from this part of the JSFUnit documentation.
Configuration static analysis
These tests test your JSF configuration. See the above mentioned documentation part for examples of what tests are performed.
- Create a JUnit testclass in your ViewController project. Modify it such that it matches this example class:
package test.com.project;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import org.jboss.jsfunit.analysis.AbstractFacesConfigTestCase;
public class JSFUnitStaticAnalysisConfigTest extends AbstractFacesConfigTestCase {
private static Setpaths = new HashSet() {{
// Example absolute path: add("C:/work/workspace/jsf-unit/src/faces-config.xml");
// Relative path example below.
add("public_html\\WEB-INF\\faces-config.xml");
}};
public JSFUnitStaticAnalysisConfigTest() {
super(paths);
}
}
Note the paths variable which points to the faces-config file to validate. Relative paths work too. Of course might not be valid in your test/production environment.
Tip: notice for easier separation at deployment, I put the test class in a separate package, starting with "test.". - And you're set: run the test. Of course you should see a green bar. If not, your config is probably not 100% ok (probably because what if a JSFUnit test is incorrect... Of course you then immediately contribute to the JSFUnit community project :-). I had for example several Serialization errors.
Below is a screenshot with the result of running the config testcase:
TLD analysis
These tests test your TLDs. See the above mentioned documentation part for examples of what tests are performed.
- Add the dependent libraries mentioned here, at the bottom of the page: maven-taglib and commons-logging. For the commons-logging you can use the one provided by JDeveloper: Commons Logging 1.0.4. The third one, jsp-api-2.1.jar does not seem to be necessary in the ADF project.
- Create a JUnit testclass in the ViewController project with .tld files. Modify it such that it matches this example class:
package test.com.project;
import java.util.HashSet;
import java.util.Set;
import org.jboss.jsfunit.analysis.AbstractTldTestCase;
import static org.junit.Assert.*;
public class JSFUnitStaticAnalysisTLDTest extends AbstractTldTestCase {
private static Setpaths = new HashSet() {{
// Example: add("C:/work/workspace/jsf-unit/src/demo.tld");
add("C:\\myprojects\\app\\src\\META-INF\\myjsf.tld");
}};
public JSFUnitStaticAnalysisTLDTest() {
super(paths);
}
}
Note the paths variable which points to the .tld to validate. Did not try if a relative path also works. - And you're set: run the test. Of course you should see a green bar. If not, your .tld is probably not 100% ok.
Below is a screenshot with the result of running the TLD testcase:
View static analysis
These tests test your JSF views. See the above mentioned documentation part for examples of what tests are performed.
- No extra libs are needed, so we can immediately create a JUnit testclass in the ViewController project. Modify it such that it matches this example class:
package test.com.project;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import org.jboss.jsfunit.analysis.AbstractFacesConfigTestCase;
import org.jboss.jsfunit.analysis.AbstractViewTestCase;
public class JSFUnitStaticAnalysisViewTest extends AbstractViewTestCase {
private static Set absoluteViewPaths = new HashSet() {{
// Example: add("C:/work/project/src/home.xhtml");
add("C:\\myprojects\\app\\mysite\\ViewController\\public_html\\detailsPage.jspx");
}};
private static Set recursiveViewPaths = new HashSet() {{
// Example: add("C:/work/project/src/views");
add("C:\\myprojects\\app\\mysite\\ViewController\\public_html");
}};
public JSFUnitStaticAnalysisViewTest() {
super(absoluteViewPaths, recursiveViewPaths,
"public_html\\WEB-INF\\faces-config.xml");
}
}
Note the paths variables. Nowhere I could find what they exactly mean. The above runs a test that passes, so I assume the paths are set correctly... - And you're set: run the test. Of course you should see a green bar. If not, your view is probably not 100% ok.
Below is a screenshot with the result of running the view testcase:
Conclusion
So that's it. Not hard at all! If you want to know a bit more high level stuff about JSFUnit, check this presentation by the project lead at the Javapolis conference (currently rebranded to Devox conference). And here's another introduction presentation.
The Shale Test Framework could be an interesting alternative for unittesting JSF. Needs some more investigation...
Saturday, November 15, 2008
Best of this Week Summary 04 November - 16 November 2008
- Part 2 in a series on server load architectures: application-level load balancing, including client-stickiness.
- How to write maintainable CSS; a presentation by Natalie Downe.
- ProgrammableWeb is tracking APIs and has now reached the 1000 milestone. In the pie charts you can see the top 15 categories and which protocols they use: 63% of the APIs uses REST! 22% SOAP. The protocols diagram is shown below:
- Here's some more details on why Google forked OpenID. See my related post of two weeks ago.
- A presentation with the current state (it's growing big time!) of OpenSocial shown at OpenSocial's first birthday at MySpace's headquarters.
- I'm currently trying out Wicket with Spring and Hibernate, using AppFuse Light as a starting point. In case you're looking for an introduction to Wicket, check out this one that has been around for a while, and this new one that's been posted this week.
Sunday, November 9, 2008
Best of this Week Summary 03 November - 09 November 2008
- Three reasons why you could switch from Subversion to Git (distributed source code management tool, created by Linux Torvalds). Here's a quite extensive comparison and here you can compare it yourself.
- What makes good REST? Roy Fielding lists a couple of criteria.
- Tips and Q&A on optimizing and tuning Apache Tomcat.
- Yahoo! opened up its open strategy platform: Yahoo! Application Platform (YAP), Yahoo! Social Platform (YSP), and Yahoo! Query Language (YQL). All services are accessed via oAuth.
- Is the Sun (pun intended ;-) setting for Swing in favor of JavaFX???
Saturday, November 1, 2008
Best of this Week Summary 29 October - 02 November 2008
- Lots of OpenID news this week: Microsoft Live ID will be an OpenID provider. It is still in a testing phase; you can already try it out. Google is also going to be an OpenID provider, including the use of OAuth. But that looks less promising when looking carefully: the implementation is not completely following the OpenID standards! See step 3 and 4 in the image below.
A clarification on why Google has done this can be found here. Basically, two reasons:
- this way users can use their Gmail accounts instead of the normally required URLs. But a URL does exist in the form of 'https://www.google.com/accounts/o8/id'.
- Google doesn't allow OpenID for users at sign-in, because its federated login would break many of their rich-client applications. Google is working on this one.
- this way users can use their Gmail accounts instead of the normally required URLs. But a URL does exist in the form of 'https://www.google.com/accounts/o8/id'.
- Whitepaper on how the JTeam company has implemented Continous Integration. Their complete list of CI tools is described; handy when you're looking for inspiration.
- Things to think about when considering Maven as your build tool (different angle on the post :-)
- Interesting posts from the Google Chrome team on the decisions they made creating the browser.