Exemplo n.º 1
0
  @Test
  public void modTest() {
    startTest("Modifier test");
    attr = Method.Create("+ abstract static x( ):int");

    // Methods cannot be abstract and static
    assertTrue(attr == null);

    attr = Method.Create("- static modTest():int");
    assertFalse(attr == null);
    assertTrue(attr.isStatic());
    assertFalse(attr.isAbstract());

    attr = Method.Create("- abstract regex():Pattern");
    assertFalse(attr == null);
    assertTrue(attr.isAbstract());
    assertFalse(attr.isStatic());

    passed();
  }
Exemplo n.º 2
0
  @Test
  public void basicTest() {
    startTest("Basic Test");
    attr = Method.Create("- _name():String");

    assertNotNull(attr);

    assertTrue(attr.getName().equals("_name"));
    assertTrue(attr.getType().equals("String"));
    assertTrue(attr.getAccess() == Access.PRIVATE);

    assertFalse(attr.isStatic());
    assertFalse(attr.isAbstract());

    assertTrue(Method.Create("_name : String") == null);
    assertTrue(Method.Create("_name String") == null);

    // decided not to test
    // Method meth = Method.Create ( "_name( ) String " );

    passed();
  }