diff options
author | aclement <aclement> | 2010-08-19 19:04:52 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-08-19 19:04:52 +0000 |
commit | eab15393e510aeb107faa10f45d9d6b0d4ad4b17 (patch) | |
tree | db7c8238533b5cfb0130a93011e6cf78626f4dda /org.aspectj.matcher | |
parent | 26a5a7ea4a834fd989d04613e8b0a4358ba11060 (diff) | |
download | aspectj-eab15393e510aeb107faa10f45d9d6b0d4ad4b17.tar.gz aspectj-eab15393e510aeb107faa10f45d9d6b0d4ad4b17.zip |
source locs
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r-- | org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/NamePatternParserTestCase.java | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/NamePatternParserTestCase.java b/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/NamePatternParserTestCase.java index e6c5d3910..f224b1737 100644 --- a/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/NamePatternParserTestCase.java +++ b/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/NamePatternParserTestCase.java @@ -10,59 +10,56 @@ * PARC initial implementation * ******************************************************************/ - package org.aspectj.weaver.patterns; -import org.aspectj.weaver.patterns.BasicTokenSource; -import org.aspectj.weaver.patterns.IToken; -import org.aspectj.weaver.patterns.ITokenSource; -import org.aspectj.weaver.patterns.NamePattern; -import org.aspectj.weaver.patterns.NamePatternTestCase; -import org.aspectj.weaver.patterns.PatternParser; - import junit.framework.TestCase; /** * @author hugunin - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. + * + * To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates. To enable + * and disable the creation of type comments go to Window>Preferences>Java>Code Generation. */ -public class NamePatternParserTestCase extends TestCase { +public class NamePatternParserTestCase extends TestCase { /** * Constructor for PatternTestCase. + * * @param name */ public NamePatternParserTestCase(String name) { super(name); } - + public void testMatch() { checkMatch(NamePatternTestCase.matchAll); checkMatch(NamePatternTestCase.match1); checkMatch(NamePatternTestCase.match2); - - + NamePattern p = new PatternParser("abc *").parseNamePattern(); assertEquals(new NamePattern("abc"), p); } + // public void testTypePattern() { + // TypePattern tp = new PatternParser(" (@Ann *) ").parseTypePattern(); + // assertEquals(2, tp.start); + // assertEquals(9, tp.end); + // } + /** * Method checkMatch. + * * @param string * @param matchAll * @param b */ private void checkMatch(String[] patterns) { - for (int i=0, len=patterns.length; i < len; i++) { + for (int i = 0, len = patterns.length; i < len; i++) { String pattern = patterns[i]; - ITokenSource tokenSource = BasicTokenSource.makeTokenSource(pattern,null); + ITokenSource tokenSource = BasicTokenSource.makeTokenSource(pattern, null); NamePattern p1 = new PatternParser(tokenSource).parseNamePattern(); NamePattern p2 = new NamePattern(pattern); assertEquals("pattern: " + pattern, p2, p1); - assertEquals("eof", IToken.EOF, tokenSource.next()); + assertEquals("eof", IToken.EOF, tokenSource.next()); } } } |