org.apache.myfaces.view.facelets.tag.ui.template
Class CompositionTestCase

java.lang.Object
  extended by org.apache.myfaces.test.base.junit4.AbstractJsfConfigurableMockTestCase
      extended by org.apache.myfaces.view.facelets.FaceletTestCase
          extended by org.apache.myfaces.view.facelets.tag.ui.template.CompositionTestCase

public class CompositionTestCase
extends FaceletTestCase


Field Summary
 
Fields inherited from class org.apache.myfaces.view.facelets.FaceletTestCase
dispenser, vdl
 
Fields inherited from class org.apache.myfaces.test.base.junit4.AbstractJsfConfigurableMockTestCase
application, config, externalContext, facesContext, facesContextFactory, lifecycle, lifecycleFactory, renderKit, request, response, servletContext, session
 
Constructor Summary
CompositionTestCase()
           
 
Method Summary
protected  void setUpServletObjects()
           
 void testComposition1()
          Test if ui:composition is used on a page with a reference to a template, it should trim everything, but take its content and insert it on a template ui:insert without name spot if available.
 void testComposition2EmptyComposition()
          An empty ui:composition does not means the content of a ui:insert without name to be rendered
 void testComposition3EmptyComposition()
          An empty ui:composition does not means the content of a ui:insert without name to be rendered
 void testComposition4DefineOverInsert()
          A ui:define takes precedence over a ui:insert
 void testComposition5()
          A ui:insert on nested composition takes the top TemplateClient.
 void testCompositionNested1()
          An ui:define on the outer most composition takes precedence over the inner one.
 void testCompositionNested2()
           
 void testCompositionTrimEffect()
          Test if ui:composition is used on a page without a reference to a template, it should trim everything outside the template
 
Methods inherited from class org.apache.myfaces.view.facelets.FaceletTestCase
createExpressionFactory, getContext, getDirectory, getLocalFile, loadStandardFacesConfig, resolveUrl, setFactories, setProjectStage, setUp, setUpApplication, setupBehaviors, setupComponents, setupConvertersAndValidators, setUpExternalContext, setupRenderers, setUpRenderKit, setUpView
 
Methods inherited from class org.apache.myfaces.test.base.junit4.AbstractJsfConfigurableMockTestCase
setUpFacesContext, setUpJSFObjects, setUpLifecycle, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositionTestCase

public CompositionTestCase()
Method Detail

setUpServletObjects

protected void setUpServletObjects()
                            throws Exception
Overrides:
setUpServletObjects in class FaceletTestCase
Throws:
Exception

testCompositionTrimEffect

public void testCompositionTrimEffect()
                               throws Exception
Test if ui:composition is used on a page without a reference to a template, it should trim everything outside the template

Throws:
Exception

testComposition1

public void testComposition1()
                      throws Exception
Test if ui:composition is used on a page with a reference to a template, it should trim everything, but take its content and insert it on a template ui:insert without name spot if available. It also test if no definition for a ui:insert with name is set, just render the content inside ui:insert

Throws:
Exception

testComposition2EmptyComposition

public void testComposition2EmptyComposition()
                                      throws Exception
An empty ui:composition does not means the content of a ui:insert without name to be rendered

Throws:
Exception

testComposition3EmptyComposition

public void testComposition3EmptyComposition()
                                      throws Exception
An empty ui:composition does not means the content of a ui:insert without name to be rendered

Throws:
Exception

testComposition4DefineOverInsert

public void testComposition4DefineOverInsert()
                                      throws Exception
A ui:define takes precedence over a ui:insert

Throws:
Exception

testComposition5

public void testComposition5()
                      throws Exception
A ui:insert on nested composition takes the top TemplateClient. In few words, ui:composition acts like a decorator pattern, so it allows override all definitions from other templates that uses ui:composition

Throws:
Exception

testCompositionNested1

public void testCompositionNested1()
                            throws Exception
An ui:define on the outer most composition takes precedence over the inner one.

Throws:
Exception

testCompositionNested2

public void testCompositionNested2()
                            throws Exception
Throws:
Exception


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.