MCPcopy Create free account
hub / github.com/apache/pig / test2

Method test2

test/org/apache/pig/parser/TestQueryLexer.java:55–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 @Test
56 public void test2() throws IOException {
57 String query = "A = load 'input' using PigStorage(';');" +
58 "B = foreach ^ A generate string.concatsep( ';', $1, $2 );";
59 CharStream input = new QueryParserStringStream( query, null );
60 QueryLexer lexer = new QueryLexer( input );
61 Token token;
62 try {
63 while( ( token = lexer.nextToken() ).getType() != Token.EOF ) {
64 if( token.getChannel() == Token.HIDDEN_CHANNEL )
65 continue;
66 if( token.getText().equals( ";" ) ) {
67 System.out.println( token.getText() );
68 } else {
69 System.out.print( token.getText() + "(" + token.getType() + ") " );
70 }
71 }
72 } catch(Exception ex) {
73 Assert.assertTrue( ex.getMessage().contains( "Unexpected character" ) );
74 return;
75 }
76 Assert.fail( "Query should fail." );
77 }
78}

Callers

nothing calls this directly

Calls 5

getTypeMethod · 0.65
equalsMethod · 0.45
printMethod · 0.45
containsMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected