core/src/test/java/org/apache/hop/core/sql/SqlTest.java
@Test
  public void testSql17() throws Exception {
    IRowMeta rowMeta = generateGettingStartedRowMeta();

    String sqlString =
        "SELECT * FROM \"GETTING_STARTED\" WHERE \"GETTING_STARTED\".\"CUSTOMERNAME\" IN ('ANNA''S DECORATIONS; LTD', "
            + "'MEN ''R'' US RETAILERS; Ltd.' )";

    Sql sql = new Sql(ThinUtil.stripNewlines(sqlString));

    assertEquals("GETTING_STARTED", sql.getServiceName());
    sql.parse(rowMeta);

    assertNotNull(sql.getWhereCondition());
    assertEquals("CUSTOMERNAME", sql.getWhereCondition().getCondition().getLeftValuename());
    assertEquals(
        "ANNA'S DECORATIONS\\; LTD;MEN 'R' US RETAILERS\\; Ltd.",
        sql.getWhereCondition().getCondition().getRightExactString());
  }
/**
   * Tests semi-coluns and quoting in literal strings in IN clause
   *
   * @throws Exception
   */
Tests semi-coluns and quoting in literal strings in IN clause
@throws Exception
Tests semi - coluns and quoting in literal strings in IN clause @throws Exception
@Test
  public void testSql17() throws Exception {
    IRowMeta rowMeta = generateGettingStartedRowMeta();
    String sqlString =
        "SELECT * FROM \"GETTING_STARTED\" WHERE \"GETTING_STARTED\".\"CUSTOMERNAME\" IN ('ANNA''S DECORATIONS; LTD', "
            + "'MEN ''R'' US RETAILERS; Ltd.' )";
    Sql sql = new Sql(ThinUtil.stripNewlines(sqlString));
    assertEquals("GETTING_STARTED", sql.getServiceName());
    sql.parse(rowMeta);
    assertNotNull(sql.getWhereCondition());
    assertEquals("CUSTOMERNAME", sql.getWhereCondition().getCondition().getLeftValuename());
    assertEquals(
        "ANNA'S DECORATIONS\\; LTD;MEN 'R' US RETAILERS\\; Ltd.",
        sql.getWhereCondition().getCondition().getRightExactString());
  }
@ Test public void testSql17 ( ) throws Exception { IRowMeta rowMeta = generateGettingStartedRowMeta ( ) ; String sqlString = "SELECT * FROM \"GETTING_STARTED\" WHERE \"GETTING_STARTED\".\"CUSTOMERNAME\" IN ('ANNA''S DECORATIONS; LTD', " + "'MEN ''R'' US RETAILERS; Ltd.' )" ; Sql sql = new Sql ( ThinUtil . stripNewlines ( sqlString ) ) ; assertEquals ( "GETTING_STARTED" , sql . getServiceName ( ) ) ; sql . parse ( rowMeta ) ; assertNotNull ( sql . getWhereCondition ( ) ) ; assertEquals ( "CUSTOMERNAME" , sql . getWhereCondition ( ) . getCondition ( ) . getLeftValuename ( ) ) ; assertEquals ( "ANNA'S DECORATIONS\\; LTD;MEN 'R' US RETAILERS\\; Ltd." , sql . getWhereCondition ( ) . getCondition ( ) . getRightExactString ( ) ) ; }
Tests semi-coluns and quoting in literal strings in IN clause
 @throws Exception
Tests semi - coluns and quoting in literal strings in IN clause @throws Exception