com.google.caja.parser.quasiliteral
Class InnocentCodeRewriterTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.google.caja.util.CajaTestCase
              extended by com.google.caja.parser.quasiliteral.RewriterTestCase
                  extended by com.google.caja.parser.quasiliteral.InnocentCodeRewriterTest
All Implemented Interfaces:
junit.framework.Test

public class InnocentCodeRewriterTest
extends RewriterTestCase

Author:
adrienne.felt@gmail.com, ihab.awad@gmail.com

Field Summary
 
Fields inherited from class com.google.caja.parser.quasiliteral.RewriterTestCase
rewriter
 
Fields inherited from class com.google.caja.util.CajaTestCase
is, mc, mq, SEED
 
Constructor Summary
InnocentCodeRewriterTest()
           
 
Method Summary
protected  java.lang.Object executePlain(java.lang.String caja)
          Given some code, execute it without rewriting and return the value of the last expression in the code.
protected  java.lang.Object rewriteAndExecute(java.lang.String pre, java.lang.String trans, java.lang.String post)
          Given some code, rewrite it, then execute it in the proper context for the rewritten version and return the value of the last expression in the original code.
 void setUp()
           
 void testForEachFunc()
           
 void testForEachPlain()
           
 void testThis()
           
 
Methods inherited from class com.google.caja.parser.quasiliteral.RewriterTestCase
assertAddsMessage, assertConsistent, assertMessageNotPresent, assertMessageNotPresent, checkAddsMessage, checkAddsMessage, checkDoesNotAddMessage, checkFails, checkSucceeds, checkSucceeds, checkSucceeds, checkSucceeds, containsConsistentMessage, containsConsistentMessage, emulateIE6FunctionConstructors, getRewriter, makeSynthetic, rewriteAndExecute, rewriteTopLevelNode, setRewriter, syntheticTree
 
Methods inherited from class com.google.caja.util.CajaTestCase
assertArrayEquals, assertCloneable, assertDeepEquals, assertMessage, assertMessage, assertMessagesLessSevereThan, assertNoErrors, assertNoMessage, assertNoWarnings, checkHeadless, css, css, cssDecls, cssDecls, dataFromResource, formatShort, fromResource, fromResource, fromString, fromString, fromString, html, htmlFragment, js, js, js, jsExpr, jsExpr, markup, markupFragment, minify, plain, quasi, render, render, renderProgram, runTest, tearDown, xml, xmlFragment
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InnocentCodeRewriterTest

public InnocentCodeRewriterTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Overrides:
setUp in class CajaTestCase
Throws:
java.lang.Exception

testForEachPlain

public final void testForEachPlain()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testForEachFunc

public final void testForEachFunc()
                           throws java.lang.Exception
Throws:
java.lang.Exception

testThis

public final void testThis()
                    throws java.lang.Exception
Throws:
java.lang.Exception

executePlain

protected java.lang.Object executePlain(java.lang.String caja)
                                 throws java.io.IOException
Description copied from class: RewriterTestCase
Given some code, execute it without rewriting and return the value of the last expression in the code.

Specified by:
executePlain in class RewriterTestCase
Throws:
java.io.IOException

rewriteAndExecute

protected java.lang.Object rewriteAndExecute(java.lang.String pre,
                                             java.lang.String trans,
                                             java.lang.String post)
                                      throws java.io.IOException,
                                             ParseException
Description copied from class: RewriterTestCase
Given some code, rewrite it, then execute it in the proper context for the rewritten version and return the value of the last expression in the original code.

Specified by:
rewriteAndExecute in class RewriterTestCase
Parameters:
pre - a prefix program fragment to be executed plain.
trans - a program fragment to be rewritten.
post - a postfix program fragment to be executed plain.
Throws:
java.io.IOException
ParseException


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0