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

    String fieldsClause = "CUSTOMERNAME";
    String conditionClause = "CUSTOMERNAME IN (''';''', 'Toys ''R'' us' )";

    // Correctness of the next statement is tested in SqlFieldsTest
    //
    SqlFields fields = new SqlFields("Service", rowMeta, fieldsClause);

    SqlCondition sqlCondition = new SqlCondition("Service", conditionClause, rowMeta, fields);
    Condition condition = sqlCondition.getCondition();

    assertNotNull(condition);
    assertFalse(condition.isEmpty());
    assertTrue(condition.isAtomic());
    assertEquals(Condition.FUNC_IN_LIST, condition.getFunction());

    assertEquals("CUSTOMERNAME", condition.getLeftValuename());
    assertEquals("'\\;';Toys 'R' us", condition.getRightExactString());
  }
/**
   * Test IN-clause with escaped quoting and semi-colons in them.
   *
   * @throws Exception
   */
Test IN-clause with escaped quoting and semi-colons in them.
@throws Exception
Test IN - clause with escaped quoting and semi - colons in them . @throws Exception
@Test
  public void testCondition30() throws Exception {
    IRowMeta rowMeta = SqlTest.generateGettingStartedRowMeta();
    String fieldsClause = "CUSTOMERNAME";
    String conditionClause = "CUSTOMERNAME IN (''';''', 'Toys ''R'' us' )";
    SqlFields fields = new SqlFields("Service", rowMeta, fieldsClause);
    SqlCondition sqlCondition = new SqlCondition("Service", conditionClause, rowMeta, fields);
    Condition condition = sqlCondition.getCondition();
    assertNotNull(condition);
    assertFalse(condition.isEmpty());
    assertTrue(condition.isAtomic());
    assertEquals(Condition.FUNC_IN_LIST, condition.getFunction());
    assertEquals("CUSTOMERNAME", condition.getLeftValuename());
    assertEquals("'\\;';Toys 'R' us", condition.getRightExactString());
  }
@ Test public void testCondition30 ( ) throws Exception { IRowMeta rowMeta = SqlTest . generateGettingStartedRowMeta ( ) ; String fieldsClause = "CUSTOMERNAME" ; String conditionClause = "CUSTOMERNAME IN (''';''', 'Toys ''R'' us' )" ; SqlFields fields = new SqlFields ( "Service" , rowMeta , fieldsClause ) ; SqlCondition sqlCondition = new SqlCondition ( "Service" , conditionClause , rowMeta , fields ) ; Condition condition = sqlCondition . getCondition ( ) ; assertNotNull ( condition ) ; assertFalse ( condition . isEmpty ( ) ) ; assertTrue ( condition . isAtomic ( ) ) ; assertEquals ( Condition . FUNC_IN_LIST , condition . getFunction ( ) ) ; assertEquals ( "CUSTOMERNAME" , condition . getLeftValuename ( ) ) ; assertEquals ( "'\\;';Toys 'R' us" , condition . getRightExactString ( ) ) ; }
Test IN-clause with escaped quoting and semi-colons in them.
Test IN - clause with escaped quoting and semi - colons in them .
// Correctness of the next statement is tested in SqlFieldsTest //