JML

org.multijava.mjc
Class TestJTypeDeclaration

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.multijava.util.testing.TestCase
              extended byorg.multijava.mjc.TestJTypeDeclaration
All Implemented Interfaces:
junit.framework.Test

public class TestJTypeDeclaration
extends TestCase

Unit tests for JTypeDeclaration


Field Summary
private  ArrayList classes
           
private  TestMjcParser parserHelper
           
 
Fields inherited from class org.multijava.util.testing.TestCase
NEWLINE
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestJTypeDeclaration(String name)
           
 
Method Summary
private  JCompilationUnitType getCheckedAST(String sourceCode)
          Returns a typechecked AST for the given source code string.
private  CMethodSet getGFsMethods(JCompilationUnitType unit)
          Returns a set of the methods that will be used for generating the first external generic function in the given compilation unit.
private  CMethodSet getTypesMethods(JCompilationUnitType unit)
          Returns a set of the methods that will be used for generating the first type declaration in the given compilation unit.
private  CMethodSet methodsFromSourceClass(CSourceClass clazz)
           
 void setUp()
           
 void tearDown()
           
 void test_dispatcherWrapMethods_method1()
          Test one internal method of local internal generic function using single dispatch.
 void test_dispatcherWrapMethods_method10()
          Test two external methods of local external generic function using multiple dispatch.
 void test_dispatcherWrapMethods_method11()
          Test two internal methods of local external generic function using multiple dispatch.
 void test_dispatcherWrapMethods_method12()
          Test three external method of local external generic function using single dispatch.
 void test_dispatcherWrapMethods_method13()
          Test three internal method of local internal generic function using multiple dispatch.
 void test_dispatcherWrapMethods_method14()
          Test three internal method of non-local internal generic function using multiple dispatch.
 void test_dispatcherWrapMethods_method15()
          Test three external methods of local external generic function using multiple dispatch.
 void test_dispatcherWrapMethods_method16()
          Test three internal method of local external generic function using multiple dispatch.
 void test_dispatcherWrapMethods_method17()
          Test pleomorphic method of internal and external generic function.
 void test_dispatcherWrapMethods_method18()
          Test multiple pleomorphic method of internal and external generic function.
 void test_dispatcherWrapMethods_method2()
          Test one internal method of non-local internal gf using single dispatch.
 void test_dispatcherWrapMethods_method3()
          Test one external method of local external generic function using single dispatch.
 void test_dispatcherWrapMethods_method4()
          Test one internal method of local external generic function using single dispatch.
 void test_dispatcherWrapMethods_method5()
          Test one internal method of non-local internal gf using multiple dispatch.
 void test_dispatcherWrapMethods_method6()
          Test one internal method of local external gf using multiple dispatch.
 void test_dispatcherWrapMethods_method7()
          Test two external method of local external gf using single dispatch.
 void test_dispatcherWrapMethods_method8()
          Test two internal method of local internal gf using multiple dispatch.
 void test_dispatcherWrapMethods_method9()
          Test two internal method of non-local internal gf using multiple dispatch.
private  String warnings()
          Returns the warnings generated by the must recent compilation attempt.
 
Methods inherited from class org.multijava.util.testing.TestCase
assertDiff, assertEquals
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classes

private ArrayList classes

parserHelper

private TestMjcParser parserHelper
Constructor Detail

TestJTypeDeclaration

public TestJTypeDeclaration(String name)
Method Detail

test_dispatcherWrapMethods_method1

public void test_dispatcherWrapMethods_method1()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test one internal method of local internal generic function using single dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method2

public void test_dispatcherWrapMethods_method2()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test one internal method of non-local internal gf using single dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method3

public void test_dispatcherWrapMethods_method3()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test one external method of local external generic function using single dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method4

public void test_dispatcherWrapMethods_method4()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test one internal method of local external generic function using single dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method5

public void test_dispatcherWrapMethods_method5()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test one internal method of non-local internal gf using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method6

public void test_dispatcherWrapMethods_method6()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test one internal method of local external gf using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method7

public void test_dispatcherWrapMethods_method7()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test two external method of local external gf using single dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method8

public void test_dispatcherWrapMethods_method8()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test two internal method of local internal gf using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method9

public void test_dispatcherWrapMethods_method9()
                                        throws antlr.RecognitionException,
                                               antlr.TokenStreamException
Test two internal method of non-local internal gf using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method10

public void test_dispatcherWrapMethods_method10()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test two external methods of local external generic function using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method11

public void test_dispatcherWrapMethods_method11()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test two internal methods of local external generic function using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method12

public void test_dispatcherWrapMethods_method12()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test three external method of local external generic function using single dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method13

public void test_dispatcherWrapMethods_method13()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test three internal method of local internal generic function using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method14

public void test_dispatcherWrapMethods_method14()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test three internal method of non-local internal generic function using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method15

public void test_dispatcherWrapMethods_method15()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test three external methods of local external generic function using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method16

public void test_dispatcherWrapMethods_method16()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test three internal method of local external generic function using multiple dispatch.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method17

public void test_dispatcherWrapMethods_method17()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test pleomorphic method of internal and external generic function.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

test_dispatcherWrapMethods_method18

public void test_dispatcherWrapMethods_method18()
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException
Test multiple pleomorphic method of internal and external generic function.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

getCheckedAST

private JCompilationUnitType getCheckedAST(String sourceCode)
Returns a typechecked AST for the given source code string.


getTypesMethods

private CMethodSet getTypesMethods(JCompilationUnitType unit)
Returns a set of the methods that will be used for generating the first type declaration in the given compilation unit.

Parameters:
unit - an typechecked and refactored AST for the compilation unit

getGFsMethods

private CMethodSet getGFsMethods(JCompilationUnitType unit)
Returns a set of the methods that will be used for generating the first external generic function in the given compilation unit.

Parameters:
unit - an typechecked and refactored AST for the compilation unit

methodsFromSourceClass

private CMethodSet methodsFromSourceClass(CSourceClass clazz)

warnings

private String warnings()
Returns the warnings generated by the must recent compilation attempt.


setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.