View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.cpd;
5   
6   import java.io.IOException;
7   
8   import net.sourceforge.pmd.testframework.AbstractTokenizerTest;
9   import net.sourceforge.pmd.testframework.StreamUtil;
10  
11  import org.junit.Before;
12  import org.junit.Test;
13  
14  
15  public class PLSQLTokenizerTest extends AbstractTokenizerTest {
16  
17  	private static final String FILENAME = "sample-plsql.sql";
18  	
19  	@Before
20  	@Override
21  	public void buildTokenizer() {
22  		this.tokenizer = new PLSQLTokenizer();
23  		this.sourceCode = new SourceCode(new SourceCode.StringCodeLoader(this.getSampleCode(), FILENAME));
24  	}
25  	
26  	@Override
27  	public String getSampleCode() {
28  		 return StreamUtil.toString(PLSQLTokenizer.class.getResourceAsStream(FILENAME));
29  	 }
30  
31  	@Test
32  	public void tokenizeTest() throws IOException {
33  		this.expectedTokenCount = 1422;
34  		super.tokenizeTest();
35  	}
36  
37      public static junit.framework.Test suite() {
38          return new junit.framework.JUnit4TestAdapter(PLSQLTokenizerTest.class);
39      }
40  }