Package st.gravel.support.compiler.testtools

Examples of st.gravel.support.compiler.testtools.ClassBuilder


  @Test
  public void testArrayLiteral() throws InstantiationException,
      IllegalAccessException, IllegalArgumentException,
      InvocationTargetException, NoSuchMethodException, SecurityException {

    Class classA = new ClassBuilder("ClassA_testArrayLiteral")
        .method("foo ^#(aap 1 nil)")
        .method("bar ^#(aap 1 nil)")
        .method("eq ^self foo == self bar")
        .build();
View Full Code Here


  @Test
  public void testLargeIntegerLiteral() throws InstantiationException,
      IllegalAccessException, IllegalArgumentException,
      InvocationTargetException, NoSuchMethodException, SecurityException {

    Class classA = new ClassBuilder("ClassA_testLargeIntegerLiteral")
        .method("foo ^12389471234798172348979183249871234")
        .method("bar ^12389471234798172348979183249871234")
        .build();

    Object classAObj = classA.newInstance();
View Full Code Here

  public void testNested_on_do_2() throws NoSuchMethodException, SecurityException,
      IllegalAccessException, IllegalArgumentException,
      InvocationTargetException, InstantiationException {


    Class stClass = new ClassBuilder("FooObject_testNested_on_do_2").instVar("bar")
        .method("foo" + "  ^self foo: [TestExceptionA raise. bar := #failed]")
        .method("isFailed ^bar notNil")
        .method("foo: aBlock  "
            + "^[[aBlock value] on: TestExceptionB do: [:ex | ex testValue]] on: TestExceptionA do: [:ex1 | ex1 testValue]")
        .build();
View Full Code Here

  public void test_pass() throws NoSuchMethodException, SecurityException,
      IllegalAccessException, IllegalArgumentException,
      InvocationTargetException, InstantiationException {


    Class stClass = new ClassBuilder("FooObject_test_pass").instVar("bar")
        .method("foo" + "  ^self foo: [TestExceptionA raise. bar := #failed]")
        .method("isFailed ^bar notNil")
        .method("foo: aBlock  "
            + "^[[aBlock value] on: Exception do: [:ex | ex pass]] on: TestExceptionA do: [:ex1 | ex1 testValue]")
        .build();
View Full Code Here

  public void test_MessageNotUnderstood1() throws NoSuchMethodException, SecurityException,
      IllegalAccessException, IllegalArgumentException,
      InvocationTargetException, InstantiationException {


    Class stClass = new ClassBuilder("FooObject_test_MessageNotUnderstood1")
        .method("foo"
            + "^[3 zork] on: MessageNotUnderstood do: [:ex | 7]"
            )
        .build();
View Full Code Here

  @Test(expected=UnhandledException.class)
  public void test_MessageNotUnderstood2() throws Throwable {


    Class stClass = new ClassBuilder("FooObject_test_MessageNotUnderstood2")
        .method("foo"
            + "^3 zork"
            )
        .build();
View Full Code Here

 
  @Test
  public void test_MessageNotUnderstood3() throws Throwable {


    Class stClass = new ClassBuilder("FooObject_test_MessageNotUnderstood3")
        .method("foo"
            + "^[3 zork: 4] on: MessageNotUnderstood do: [:ex | ex receiver + ex message argument]"
            )
        .build();
View Full Code Here

 
  @Test
  public void test_MessageNotUnderstood4() throws Throwable {


    Class stClass = new ClassBuilder("FooObject_test_MessageNotUnderstood4")
        .method("foo"
            + "^self zork: 4"
            )
        .method("doesNotUnderstand: aMessage"
            + "^3 + aMessage argument"
View Full Code Here

TOP

Related Classes of st.gravel.support.compiler.testtools.ClassBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.