Package org.araneaframework.uilib.widgets.lists.tests.mock

Examples of org.araneaframework.uilib.widgets.lists.tests.mock.MockSqlStringExpression


      // normal
    }

    // SQL String
    assertEquals("SqlNotExpression must return \"NOT \"",
        new SqlNotExpression(new MockSqlStringExpression(""))
            .toSqlString(), "NOT ");
    assertEquals("SqlNotExpression must return \"NOT a\"",
        new SqlNotExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "NOT a");

    // SQL arguments
    assertTrue("SqlNotExpression must return an empty array", Arrays
        .equals(new SqlNotExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlNotExpression must return an empty array", Arrays
        .equals(new SqlNotExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlNotExpression must return (\"a\") as values", Arrays
        .equals(new SqlNotExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here


      // normal
    }

    // SQL String
    assertEquals("SqlUpperExpression must return \"UPPER()\"",
        new SqlUpperExpression(new MockSqlStringExpression(""))
            .toSqlString(), "UPPER()");
    assertEquals("SqlUpperExpression must return \"UPPER(a)\"",
        new SqlUpperExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "UPPER(a)");

    // SQL arguments
    assertTrue("SqlUpperExpression must return an empty array", Arrays
        .equals(new SqlUpperExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlUpperExpression must return an empty array", Arrays
        .equals(new SqlUpperExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlUpperExpression must return (\"a\") as values", Arrays
        .equals(new SqlUpperExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

      // normal
    }

    // SQL String
    assertEquals("SqlLowerExpression must return \"LOWER()\"",
        new SqlLowerExpression(new MockSqlStringExpression(""))
            .toSqlString(), "LOWER()");
    assertEquals("SqlLowerExpression must return \"LOWER(a)\"",
        new SqlLowerExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "LOWER(a)");

    // SQL arguments
    assertTrue("SqlLowerExpression must return an empty array", Arrays
        .equals(new SqlLowerExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlLowerExpression must return an empty array", Arrays
        .equals(new SqlLowerExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlLowerExpression must return (\"a\") as values", Arrays
        .equals(new SqlLowerExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

      // normal
    }

    // SQL String
    assertEquals("SqlIsNullExpression must return \" IS NULL\"",
        new SqlIsNullExpression(new MockSqlStringExpression(""))
            .toSqlString(), " IS NULL");
    assertEquals("SqlIsNullExpression must return \"a IS NULL\"",
        new SqlIsNullExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "a IS NULL");

    // SQL arguments
    assertTrue("SqlIsNullExpression must return an empty array", Arrays
        .equals(new SqlIsNullExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlIsNullExpression must return an empty array", Arrays
        .equals(new SqlIsNullExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlIsNullExpression must return (\"a\") as values", Arrays
        .equals(new SqlIsNullExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

      // normal
    }

    // SQL String
    assertEquals("SqlAscendingExpression must return \" ASC\"",
        new SqlAscendingExpression(new MockSqlStringExpression(""))
            .toSqlString(), " ASC");
    assertEquals("SqlAscendingExpression must return \"a ASC\"",
        new SqlAscendingExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "a ASC");

    // SQL arguments
    assertTrue("SqlAscendingExpression must return an empty array", Arrays
        .equals(new SqlAscendingExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlAscendingExpression must return an empty array", Arrays
        .equals(new SqlAscendingExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlAscendingExpression must return (\"a\") as values", Arrays
        .equals(new SqlAscendingExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

      // normal
    }

    // SQL String
    assertEquals("SqlDescendingExpression must return \" DESC\"",
        new SqlDescendingExpression(new MockSqlStringExpression(""))
            .toSqlString(), " DESC");
    assertEquals("SqlDescendingExpression must return \"a DESC\"",
        new SqlDescendingExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "a DESC");

    // SQL arguments
    assertTrue("SqlDescendingExpression must return an empty array", Arrays
        .equals(new SqlDescendingExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlDescendingExpression must return an empty array", Arrays
        .equals(new SqlDescendingExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlDescendingExpression must return (\"a\") as values", Arrays
        .equals(new SqlDescendingExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

      // normal
    }

    // SQL String
    assertEquals("SqlParanthesesExpression must return \"()\"",
        new SqlBracketsExpression(new MockSqlStringExpression(""))
            .toSqlString(), "()");
    assertEquals("SqlParanthesesExpression must return \"(a)\"",
        new SqlBracketsExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "(a)");

    // SQL arguments
    assertTrue("SqlParanthesesExpression must return an empty array", Arrays
        .equals(new SqlBracketsExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlParanthesesExpression must return an empty array", Arrays
        .equals(new SqlBracketsExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlParanthesesExpression must return (\"a\") as values", Arrays
        .equals(new SqlBracketsExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

    // SQL String
    assertEquals("SqlAndExpression must return an empty string",
        new SqlAndExpression().toSqlString(), "");
    assertEquals("SqlAndExpression must return \"a\"",
        new SqlAndExpression().add(new MockSqlStringExpression("a"))
            .toSqlString(), "a");
    assertEquals("SqlAndExpression must return \"a AND b\"",
        new SqlAndExpression().add(new MockSqlStringExpression("a"))
            .add(new MockSqlStringExpression("b")).toSqlString(),
        "a AND b");

    // SQL arguments
    assertTrue("SqlAndExpression must return an empty array", Arrays
        .equals(new SqlAndExpression().getValues(), new Object[0]));
    assertTrue("SqlAndExpression must return an empty array",
        Arrays
            .equals(
                new SqlAndExpression().add(
                    new MockSqlStringExpression(
                        new Object[0])).add(
                    new MockSqlStringExpression(
                        new Object[0])).getValues(),
                new Object[0]));
    assertTrue("SqlAndExpression must return (\"a\", \"b\") as values",
        Arrays.equals(new SqlAndExpression().add(
            new MockSqlStringExpression(new Object[] { "a" })).add(
            new MockSqlStringExpression(new Object[] { "b" }))
            .getValues(), new Object[] { "a", "b" }));
  }
View Full Code Here

    // SQL String
    assertEquals("SqlOrExpression must return an empty string",
        new SqlOrExpression().toSqlString(), "");
    assertEquals("SqlOrExpression must return \"a\"", new SqlOrExpression()
        .add(new MockSqlStringExpression("a")).toSqlString(), "a");
    assertEquals("SqlOrExpression must return \"a AND b\"",
        new SqlOrExpression().add(new MockSqlStringExpression("a"))
            .add(new MockSqlStringExpression("b")).toSqlString(),
        "a OR b");

    // SQL arguments
    assertTrue("SqlOrExpression must return an empty array", Arrays.equals(
        new SqlOrExpression().getValues(), new Object[0]));
    assertTrue("SqlOrExpression must return an empty array",
        Arrays
            .equals(
                new SqlOrExpression().add(
                    new MockSqlStringExpression(
                        new Object[0])).add(
                    new MockSqlStringExpression(
                        new Object[0])).getValues(),
                new Object[0]));
    assertTrue("SqlOrExpression must return (\"a\", \"b\") as values",
        Arrays.equals(new SqlOrExpression().add(
            new MockSqlStringExpression(new Object[] { "a" })).add(
            new MockSqlStringExpression(new Object[] { "b" }))
            .getValues(), new Object[] { "a", "b" }));
  }
View Full Code Here

    // SQL String
    assertEquals("SqlConcatenationExpression must return an empty string",
        new SqlConcatenationExpression().toSqlString(), "");
    assertEquals("SqlConcatenationExpression must return \"a\"",
        new SqlConcatenationExpression().add(
            new MockSqlStringExpression("a")).toSqlString(), "a");
    assertEquals("SqlConcatenationExpression must return \"a || b\"",
        new SqlConcatenationExpression().add(
            new MockSqlStringExpression("a")).add(
            new MockSqlStringExpression("b")).toSqlString(),
        "a || b");

    // SQL arguments
    assertTrue("SqlConcatenationExpression must return an empty array",
        Arrays.equals(new SqlConcatenationExpression().getValues(),
            new Object[0]));
    assertTrue("SqlConcatenationExpression must return an empty array",
        Arrays
            .equals(
                new SqlConcatenationExpression().add(
                    new MockSqlStringExpression(
                        new Object[0])).add(
                    new MockSqlStringExpression(
                        new Object[0])).getValues(),
                new Object[0]));
    assertTrue(
        "SqlConcatenationExpression must return (\"a\", \"b\") as values",
        Arrays.equals(new SqlConcatenationExpression().add(
            new MockSqlStringExpression(new Object[] { "a" })).add(
            new MockSqlStringExpression(new Object[] { "b" }))
            .getValues(), new Object[] { "a", "b" }));
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.uilib.widgets.lists.tests.mock.MockSqlStringExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.