Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Archives

< At last, free certified SSL certificates for open-source projects   JIA, here I come >
RIFE 1.1 released

Below are the highlights:

You can also read the full changelog for more details.

Dual licensing under CDDL and LGPL

We have decided to dual license the framework and add CDDL as an option alongside the previous LGPL license.

The CDDL offers a copy-left open-source license that doesn't have any ambiguities regarding the terms 'linking' and 'executable', which make no sense in a Java application. There is no possible viral behavior that extends beyond RIFE itself. The CDDL protects us by requiring all source modifications to RIFE to be contributed back under the same license, but imposes no restrictions at all on the use of RIFE in a commercial application.

However, to be able to combine RIFE with a GPL license, a stronger copy-left license is required. In this case, the LGPL can be selected.

[ top ]

Detailed template error messages

All template parsing error messages are now reported with the exact location of the line and column where the error occurred. The erroneous text is show in the error message and an arrow is used to clearly indicate the error, for example:

latest:4:2: the V tag 'newsitems' was not terminated
    <!--V 'newsitems'--><!--V-->
    ^

[ top ]

Out-of-container testing framework

RIFE web applications can now be fully tested outside of a servlet container. This offers much more flexibility and makes it possible to assert conditions based on the site structure and the templates that have been used. To provide HTML parsing and DOM manipulation, RIFE relies on NekoHTML, which in turn relies on Xerces. You need these libraries in your classpath to perform some of the testing functionalities.

To test your web application, you need to have an instance of a Site that contains the elements and all the other declarations that you want to test. Typically this will be exactly the same site as the one that is setup for your real web application in the repository.

It can be obtained like this:

Site site = Site.getRepInstance();

It's however possible to build a site on the fly with only certain elements or sub-sites, if they need to be tested in isolation or in different situations (very useful for reusable components).

For example:

Site site = new SiteBuilder("test")

        
.setArrival("Home")
        
.addGlobalExit("home", "Home")
        
.enterElement("pub/home.xml")
            
.setId("Home")
            
.setUrl("home")
        
.leaveElement()
    
.getSite();

Once the site instance has been obtained or created, you can start a MockConversation and perform all the test tasks. For more information, it's best to look at the javadocs of the com.uwyn.rife.test package.

Below is an example test case:

MockConversation conversation = new MockConversation(Site.getRepInstance());

MockResponse response;
ParsedHtml parsed;

// go to the homepage
response = conversation.doRequest("/");
parsed 
= response.getParsedHtml();

// get the link to the admin site and click on it
MockLink link_admin = parsed.getLinkWithText("here");
response 
= link_admin.click();
parsed 
= response.getParsedHtml();

// check that the authentication page is shown
assertEquals("RIFE/Jumpstart - Admin - Authentication", parsed.getTitle());

// fill in the form on the authentication page and submit it with wrong credentials
MockForm form_credentials = parsed.getFormWithName("credentials");
response 
= form_credentials
    
.parameter("login", "wronglogin")
    
.parameter("password", "wrongpassword")
    
.submit();
parsed 
= response.getParsedHtml();

// check that the authentication page is still shown
assertEquals("RIFE/Jumpstart - Admin - Authentication", parsed.getTitle());
assertEquals
("The login and the password that you provided are not valid.", 
             response.xpathString("//*[@id='error_area']/text()"));

// fill in the form on the authentication page and submit it with correct credentials
form_credentials = parsed.getFormWithName("credentials");
response 
= form_credentials
    
.parameter("login", "admin")
    
.parameter("password", "password")
    
.submit();
parsed 
= response.getParsedHtml();

// check that the administration homepage is shown
assertEquals("RIFE/Jumpstart - Admin - Home", parsed.getTitle());

// check that the authentication cookie has been added
assertEquals(1, response.getNewCookieNames().size());
assertEquals
("authid", response.getNewCookieNames().get(0));

RIFE's advanced features, for instance continuations, require a custom classloader that loads all the classes in the application. To ensure that this classloader is used right from the start, it's recommended to prefix your test framework main class with the RunWithEngineClassLoader class on the command line. For example for JUnit (all on one line):

java -Drife.webapp.path=../src:../tests:../build/classes:../build/tests:../lib
     com.uwyn.rife.test.RunWithEngineClassLoader junit.textui.TestRunner
     com.uwyn.rife.jumpstart.TestApplication

Note the rife.webapp.path JVM property, it should contain all the paths with the classes and resources that are part of this application (not the JDK classes, but those that typically end up in the WEB-INF directory). The classloader will only process these classes.

[ top ]

Full changelog

2005-09-23  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * RELEASE 1.1

  * Added dual license for CDDL

2005-09-22  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Site builder API improvements

  * Added easy xpath evaluations to MockResponse

2005-09-21  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Bugfix to RunWithEngineClassLoader

  * Minor fix to properly support config properties in the rep.

  * Javadocs fixes

  * Removed all property name conflict checks.

  * Reimplemented the engine IoC property hierarchy.

  * Fixed a regression bug in the exit url generation.

2005-09-20  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Added support for getProperty(String name, Object defaultValue) in
  ElementSupport

  * RIFE-226 : Allow generation of EXIT:QUERY links to url-less embedded
  elements

2005-09-19  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Refactored IoC property support into a separate package.

  * Implemented RIFE-221 : Support IoC for the repository and its participants

2005-09-15  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Applied jboyens' patch for making the selected date clickable in JDateSelector

2005-09-14  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * RIFE-224 : Template engine exceptions should give context information:
  filename, line, colum

  * RIFE-217 : AttributeNotEndedException should give context information like
  line/column number

  * Site DTD update

2005-09-13  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * RIFE-218 : Submissions do not allow unlimited number of file uploads

  * RIFE-88 : Write unittests for rep participant cleanup

  * RIFE-62 : Write detailed unittests for authentication cookie handling

  * RIFE-196 : Add RoleUserAttributes.removeRole

2005-09-12  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Finished the testing framework javadocs.

  * Project file updates for the new EngineClassLoader main wrapper.

  * Testing framework refactorings.

  * Added RunWithEngineClassloader class.

  * Added javadocs for classes and interfaces that have been added to the
  engine package for the implementation of the testing framework.

  * Minor API fixes.

2005-09-11  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Source cleanups

  * Added methods to MockResponse to obtain the target element, target element
  info and target element id.

  * Added parameters extraction methods to MockLink.

  * Added support for session state storage in test framework.

2005-09-10  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Added support for file uploads in out of container testing.

  * Added some OOT tests

  * Added some form api methods.

  * Added support for browser-central cookies that are persisted across request.

  * Added support for select boxes selected options to response form parsing.

  * Further OOT improvements

2005-09-09  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Initial working version of out-of-container tests.

  * Gate, Request and Response refactoring to make it possible to add support
  for out-of-container testing.

2005-09-02  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * Fixed RIFE-219 : Strange error message when instantiating
  GenericQueryManager when bean has identifier(true) property which is not
  called "id" and does not have no-arg constructor

2005-08-30  Geert Bevin  <gbevin[remove] at uwyn dot com>

  * RELEASE 1.0

[ top ]

posted by Geert Bevin in RIFE on Sep 26, 2005 11:03 AM : 0 comments [permalink]
 

Comments

Add a new comment

Comments on this blog entry have been closed.

< At last, free certified SSL certificates for open-source projects   JIA, here I come >
 
 
 
Google
rifers.org web