Esempio n. 1
0
 @Test
 public void emptyContext() throws Exception {
   RenderingContext ctx = RenderingContext.CtxBuilder.get();
   try (Closeable wrapped = ctx.wrap().open()) {
     assertNull(ctx.getParameter(PARAM));
   }
 }
Esempio n. 2
0
 @Test
 public void subContext() throws Exception {
   RenderingContext ctx = RenderingContext.CtxBuilder.get();
   try (Closeable wrapped = ctx.wrap().with(PARAM, VALUE1).open()) {
     Object value = ctx.getParameter(PARAM);
     assertNotNull(value);
     assertEquals(VALUE1, value);
     try (Closeable wrapped2 = ctx.wrap().with(PARAM, VALUE2).open()) {
       value = ctx.getParameter(PARAM);
       assertNotNull(value);
       assertEquals(VALUE2, value);
     }
     value = ctx.getParameter(PARAM);
     assertNotNull(value);
     assertEquals(VALUE1, value);
   }
 }
Esempio n. 3
0
 @Test
 public void noContext() throws Exception {
   RenderingContext ctx = RenderingContext.CtxBuilder.get();
   assertNull(ctx.getParameter(PARAM));
 }