/*
 *  Copyright (C) 2011 The Animo Project
 *  http://animotron.org
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public License
 *  as published by the Free Software Foundation; either version 3
 *  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 Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
package org.animotron.statement.operator;

import org.animotron.ATest;
import org.animotron.expression.JExpression;
import org.animotron.statement.compare.WITH;
import org.animotron.statement.query.ANY;
import org.junit.Test;

import static org.animotron.expression.JExpression._;
import static org.animotron.expression.JExpression.text;

/**
 * @author <a href="mailto:shabanovd@gmail.com">Dmitriy Shabanov</a>
 * @author <a href="mailto:gazdovsky@gmail.com">Evgeny Gazdovsky</a>
 *
 */
public class YetAnotherAnyTest extends ATest {

    @Test
    public void deep_any() throws Exception {

        JExpression.__(
                new JExpression(
                        _(THE._, "A", _(AN._, "S"), _(AN._, "X", text("α")))
                ),
                new JExpression(
                        _(THE._, "B", _(AN._, "A"), _(AN._, "Y", text("β")))
                ),
                new JExpression(
                        _(THE._, "C", _(AN._, "B"), _(AN._, "Z", text("γ")))
                )
        );

        JExpression a = new JExpression(
            _(THE._, "a", _(ANY._, "S", _(WITH._, "X", text("α"))))
        );
        assertAnimoResult(a, "the a the A (S) (X \"α\").");

        JExpression b = new JExpression(
            _(THE._, "b", _(ANY._, "S", _(WITH._, "Y", text("β"))))
        );
        assertAnimoResult(b, "the b the B (A) (Y \"β\").");

        JExpression c = new JExpression(
            _(THE._, "c", _(ANY._, "S", _(WITH._, "Z", text("γ"))))
        );
        assertAnimoResult(c, "the c the C (B) (Z \"γ\").");
    }

    @Test
    public void one_more_deep_any() throws Exception {

        JExpression.__(
                new JExpression(
                        _(THE._, "A", _(AN._, "S"), _(AN._, "X", text("α")))
                ),
                new JExpression(
                        _(THE._, "B", _(AN._, "A"), _(AN._, "X", text("β")))
                ),
                new JExpression(
                        _(THE._, "C", _(AN._, "B"), _(AN._, "X", text("γ")))
                )
        );

        JExpression a = new JExpression(
            _(THE._, "a", _(ANY._, "S", _(WITH._, "X", text("α"))))
        );
        assertAnimoResult(a, "the a the A (S) (X \"α\").");

        JExpression b = new JExpression(
            _(THE._, "b", _(ANY._, "S", _(WITH._, "X", text("β"))))
        );
        assertAnimoResult(b, "the b the B (A) (X \"β\").");

        JExpression c = new JExpression(
            _(THE._, "c", _(ANY._, "S", _(WITH._, "X", text("γ"))))
        );
        assertAnimoResult(c, "the c the C (B) (X \"γ\").");
    }
}
@@ -1950,32 +1950,39 @@
 ssertAnimoResult
+OneStep
 (a, %22the a the A
@@ -1992,32 +1992,32 @@
 ) (X %5C%22%CE%B1%5C%22).%22);%0A
-
 %0A        JExpres
@@ -2138,32 +2138,39 @@
 ssertAnimoResult
+OneStep
 (b, %22the b the B
@@ -2326,32 +2326,39 @@
 ssertAnimoResult
+OneStep
 (c, %22the c the C
@@ -3016,16 +3016,23 @@
 moResult
+OneStep
 (a, %22the
@@ -3204,16 +3204,23 @@
 moResult
+OneStep
 (b, %22the
@@ -3359,32 +3359,32 @@
 ))))%0A        );%0A
-
         assertAn
@@ -3392,16 +3392,23 @@
 moResult
+OneStep
 (c, %22the

update tests