Example usage for junit.framework AssertionFailedError getMessage

List of usage examples for junit.framework AssertionFailedError getMessage

Introduction

In this page you can find the example usage for junit.framework AssertionFailedError getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail63() {
    String query = "foreach (load 'myfile' as (col1, col2 : (sub1, sub2), col3 : (bag1))) generate col1 ;";
    try {// w w w.j av a 2 s.c  om
        buildPlan(query);
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail64() {
    String query = "foreach (load 'myfile' as (col1, col2 : bag{age: int})) generate col1 ;";
    try {/*from  w w  w  . j  a  v  a 2s . com*/
        buildPlan(query);
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail65() {
    buildPlan("a = load 'a' as (name, age, gpa);");
    buildPlan("b = load 'b' as (name, height);");
    buildPlan("c = cogroup a by (name, age), b by (name, height);");
    try {//  www  .  j a  va 2  s  .  co  m
        buildPlan("d = foreach c generate group.name, a.name, b.height as age, a.age;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail67() {
    buildPlan(" a = load 'input1' as (name, age, gpa);");
    try {/* w w  w.j  a  v a2  s  . c o  m*/
        buildPlan(" b = foreach a generate age, age * 10L, gpa/0.2f, {16, 4.0e-2, 'hello'};");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail68() {
    buildPlan(" a = load 'input1' as (name, age, gpa);");
    try {//from ww w .  j av a2  s .  c  om
        buildPlan(" b = foreach a generate {(16 L, 4.0e-2, 'hello'), (0.5f, 'another tuple', 12L, {()})};");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail72() {
    buildPlan("split (load 'a') into x if $0 > '7', y if $0 < '7';");
    try {//from  w ww. j a v  a 2  s  .  c o  m
        buildPlan("c = foreach y generate (bag)$1;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
    try {
        buildPlan("c = foreach y generate (bag{int, float})$1;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
    try {
        buildPlan("c = foreach y generate (tuple)$1;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail81() {
    buildPlan("a = load 'input1' using PigStorage() as (name, age, gpa);");
    try {/*from   w ww. j a  va 2  s.  com*/
        buildPlan("split a into b if name lt 'f', c if (name ge 'f' and name le 'h'), d if name gt 'h';");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail82() {
    buildPlan("a = load 'myfile';");
    buildPlan("b = group a by $0;");
    String query = "c = foreach b {" + "c1 = order $1 by *;" + "c2 = $1;" + "generate flatten(c1), c2;" + "};";
    try {//from  w  w  w .  j  a v  a  2 s  .  co m
        buildPlan(query);
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Exception"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail89() {
    buildPlan("c = load 'myfile' as (i: int);");
    try {/*from ww  w. jav a 2 s  . c  o  m*/
        buildPlan("d = foreach c generate $0, $5;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Out of bound access"));
    }
}

From source file:org.apache.pig.test.TestLogicalPlanBuilder.java

@Test
public void testQueryFail90() throws FrontendException, ParseException {
    buildPlan("a = load 'myfile' as (name:Chararray, age:Int, gpa:Float);");
    buildPlan("b = group a by (name, age);");

    try {//www.  jav a  2  s .  c o  m
        buildPlan("c = foreach b generate group as mygroup:(myname, myage, mygpa), COUNT(a) as mycount;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Schema size mismatch"));
    }

    try {
        buildPlan("c = foreach b generate group as mygroup:(myname: int, myage), COUNT(a) as mycount;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Type mismatch"));
    }

    try {
        buildPlan("c = foreach b generate group as mygroup:(myname, myage: chararray), COUNT(a) as mycount;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Type mismatch"));
    }

    try {
        buildPlan("c = foreach b generate group as mygroup:{t: (myname, myage)}, COUNT(a) as mycount;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Type mismatch"));
    }

    try {
        buildPlan("c = foreach b generate flatten(group) as (myname, myage, mygpa), COUNT(a) as mycount;");
    } catch (AssertionFailedError e) {
        assertTrue(e.getMessage().contains("Schema size mismatch"));
    }
}