// Path: modules/api/src/main/java/javax/el/ELException.java
// public class ELException extends RuntimeException {
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * Creates an ELException with no detail message.
// 	 */
// 	public ELException() {
// 		super();
// 	}
// 
// 	/**
// 	 * Creates an ELException with the provided detail message.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 */
// 	public ELException(String message) {
// 		super(message);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given cause.
// 	 * 
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(Throwable cause) {
// 		super(cause);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given detail message and root cause.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


import javax.el.ELException;
import de.odysseus.el.TestCase;
import de.odysseus.el.tree.Bindings;

/*
 * Copyright 2006-2009 Odysseus Software GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */ 
package de.odysseus.el.tree.impl.ast;



public class AstBooleanTest extends TestCase {
	private Bindings bindings = new Bindings(null, null, null);
	
	AstBoolean parseNode(String expression) {
		return (AstBoolean)parse(expression).getRoot().getChild(0);
	}

	public void testEval() {
		assertEquals(true, parseNode("${true}").eval(bindings, null));
		assertEquals(false, parseNode("${false}").eval(bindings, null));
	}

	public void testAppendStructure() {
		StringBuilder s = new StringBuilder();
		parseNode("${true}").appendStructure(s, bindings);
		parseNode("${false}").appendStructure(s, bindings);
		assertEquals("truefalse", s.toString());
	}

	public void testIsLiteralText() {
		assertFalse(parseNode("${true}").isLiteralText());
	}

	public void testIsLeftValue() {
		assertFalse(parseNode("${true}").isLeftValue());
	}

	public void testGetType() {
		assertNull(parseNode("${true}").getType(bindings, null));
	}

	public void testIsReadOnly() {
		assertTrue(parseNode("${true}").isReadOnly(bindings, null));
	}

	public void testSetValue() {

// Path: modules/api/src/main/java/javax/el/ELException.java
// public class ELException extends RuntimeException {
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * Creates an ELException with no detail message.
// 	 */
// 	public ELException() {
// 		super();
// 	}
// 
// 	/**
// 	 * Creates an ELException with the provided detail message.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 */
// 	public ELException(String message) {
// 		super(message);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given cause.
// 	 * 
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(Throwable cause) {
// 		super(cause);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given detail message and root cause.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


// Path: modules/impl/src/test/java/de/odysseus/el/tree/impl/ast/AstBooleanTest.java
import javax.el.ELException;
import de.odysseus.el.TestCase;
import de.odysseus.el.tree.Bindings;

/*
 * Copyright 2006-2009 Odysseus Software GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */ 
package de.odysseus.el.tree.impl.ast;



public class AstBooleanTest extends TestCase {
	private Bindings bindings = new Bindings(null, null, null);
	
	AstBoolean parseNode(String expression) {
		return (AstBoolean)parse(expression).getRoot().getChild(0);
	}

	public void testEval() {
		assertEquals(true, parseNode("${true}").eval(bindings, null));
		assertEquals(false, parseNode("${false}").eval(bindings, null));
	}

	public void testAppendStructure() {
		StringBuilder s = new StringBuilder();
		parseNode("${true}").appendStructure(s, bindings);
		parseNode("${false}").appendStructure(s, bindings);
		assertEquals("truefalse", s.toString());
	}

	public void testIsLiteralText() {
		assertFalse(parseNode("${true}").isLiteralText());
	}

	public void testIsLeftValue() {
		assertFalse(parseNode("${true}").isLeftValue());
	}

	public void testGetType() {
		assertNull(parseNode("${true}").getType(bindings, null));
	}

	public void testIsReadOnly() {
		assertTrue(parseNode("${true}").isReadOnly(bindings, null));
	}

	public void testSetValue() {

		try { parseNode("${true}").setValue(bindings, null, null); fail(); } catch (ELException e) {}
