/* $Id: VisitorTest.java,v 1.2 2005/10/13 03:37:54 m31 Exp $
 *
 * This file is part of the project "Hilbert II" - http://www.qedeq.org
 *
 * Copyright 2000-2005,  Michael Meyling <mime@qedeq.org>.
 *
 * "Hilbert II" is free software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

package org.qedeq.kernel.dto.elli;

import org.qedeq.kernel.base.elli.Atom;
import org.qedeq.kernel.base.elli.Element;
import org.qedeq.kernel.base.elli.ElementList;
import org.qedeq.kernel.base.elli.Visitor;
import org.qedeq.kernel.test.QedeqTestCase;

/**
 * Test {@link org.qedeq.kernel.base.elli.Visitor} and {@link org.qedeq.kernel.base.elli.Visitable}
 * implementations. 
 * 
 * @version $Revision: 1.2 $
 * @author Michael Meyling
 */
public class VisitorTest extends QedeqTestCase implements Visitor {

    /**
     * Constructor.
     */
    public VisitorTest() {
        super();
    }

    /**
     * Constructor.
     * 
     * @param   name    Test case name.
     */
    public VisitorTest(String name) {
        super(name);
    }

    /**
     * Test implementation of {@link org.qedeq.kernel.base.elli.Visitable}
     *
     */
    public void testVisit() {
        Element el = new ElementListImpl("myOperator", new Element[] {
            new AtomImpl("Hello"), 
            new AtomImpl("Again"),
            new ElementListImpl("again", new Element[] {
                new AtomImpl("one"), 
                new AtomImpl("two"),
                new AtomImpl("three")
            })
        });
        el.accept(this);
    }
    
    protected void setUp() throws Exception {
        super.setUp();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void visit(Atom atom) {
        System.out.println("Visiting atom:" + atom.toString());
        
    }

    public void visit(ElementList list) {
        System.out.println("Visiting list:" + list.getOperator());
    }

}
