1 19 20 package org.netbeans.api.lexer; 21 22 import org.netbeans.junit.NbTestCase; 23 24 28 public class CustomTokenClassTest extends NbTestCase { 29 30 public CustomTokenClassTest(String name) { 31 super(name); 32 } 33 34 public void testCustomTokenClass() throws Exception { 35 try { 36 Token token = new CustomToken(); 37 fail("IllegalStateException expected from constructor of Token class."); 38 } catch (IllegalStateException e) { 39 } 41 } 42 43 private static final class CustomToken extends Token { 44 45 public TokenId id() { 46 return null; 47 } 48 49 public CharSequence text() { 50 return null; 51 } 52 53 public boolean isCustomText() { 54 return false; 55 } 56 57 public int length() { 58 return 0; 59 } 60 61 public int offset(TokenHierarchy tokenHierarchy) { 62 return 0; 63 } 64 65 public boolean isFlyweight() { 66 return false; 67 } 68 69 public boolean isPreprocessedText() { 70 return false; 71 } 72 73 public CharSequence preprocessedText() { 74 return null; 75 } 76 77 public String preprocessError() { 78 return null; 79 } 80 81 public int preprocessErrorIndex() { 82 return 0; 83 } 84 85 public boolean hasProperties() { 86 return false; 87 } 88 89 public Object getProperty(Object key) { 90 return false; 91 } 92 93 public PartType partType() { 94 return null; 95 } 96 97 } 98 99 } 100 | Popular Tags |