public void testConstSerialisation() throws IOException { field.setConst(true); field.setName("renamed"); unit = CodeMirror.assertReflection(fact, unit); field = ((ASClassType) unit.getType()).getField("renamed"); assertNotNull(field); assertTrue(field.isConst()); }
public void tearDown() { if (expr != null) { StringWriter buff = new StringWriter(); LinkedListTree ast = ((ASTExpression) expr).getAST(); new ASTPrinter(buff).print(ast); LinkedListTree parsed = AS3FragmentParser.parseExpr(buff.toString()); CodeMirror.assertASTMatch(ast, parsed); } }
public void testInit() throws IOException { // should no none to start with, assertNull(field.getInitializer()); field.setInitializer(fact.newStringLiteral("foo")); assertTrue(field.getInitializer() instanceof ASStringLiteral); field.setInitializer("1"); assertTrue(field.getInitializer() instanceof ASIntegerLiteral); field.setInitializer((String) null); // remove it again assertNull(field.getInitializer()); field.setInitializer((Expression) null); // when already absent // complicated initialiser value, field.setInitializer("function() { trace('test'); }"); CodeMirror.assertReflection(fact, unit); }
protected void tearDown() throws IOException { CodeMirror.assertReflection(fact, unit); }