edu.vub.at.objects.mirrors
Class MirrorTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byedu.vub.at.AmbientTalkTest
              extended byedu.vub.at.objects.mirrors.MirrorTest
All Implemented Interfaces:
junit.framework.Test

public class MirrorTest
extends AmbientTalkTest


Nested Class Summary
 
Nested classes inherited from class edu.vub.at.AmbientTalkTest
AmbientTalkTest.Actorscript
 
Field Summary
 
Fields inherited from class edu.vub.at.AmbientTalkTest
ctx_
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
MirrorTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void notestAGMirrorInterface()
          This test goes over all abstract grammar elements and tests their accessors for fields.
protected  void setUp()
           
 void testJavaMirrorBaseRelation()
          Tests the correctness of the up-down relation in Java : - down(up(o)) == o
 void testJavaMirrorInvocation()
           
 void testListMethods()
           
 void testMirrorBaseRelation()
          Tests the correctness of the up-down relation in AmbientTalk : - down(up(o)) == o
 void testMirrorCreation()
          Following a bug report by Stijn.
 void testMirrorFieldAccess()
           
 void testMirrorInvocation()
           
 void testStratification()
          This test creates a mirror and attempts to use it in a non-stratified way.
 
Methods inherited from class edu.vub.at.AmbientTalkTest
actorTest, evalActor, evalAndCompareTo, evalAndCompareTo, evalAndReturn, evalAndTestException, evalInActor, evalSnippet, printedEquals
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, 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
 

Constructor Detail

MirrorTest

public MirrorTest()
Method Detail

main

public static void main(java.lang.String[] args)

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

testMirrorCreation

public void testMirrorCreation()
Following a bug report by Stijn. Intercessive mirror creation and extension do not always behave properly (e.g. they return mirages or superfluous introspective mirrors wrapping the desired result)


notestAGMirrorInterface

public void notestAGMirrorInterface()
This test goes over all abstract grammar elements and tests their accessors for fields. If all works well, the test transforms one abstract syntax tree into another one. The former does not care for stratified access whereas the latter one does.


testStratification

public void testStratification()
This test creates a mirror and attempts to use it in a non-stratified way. The test assumes failure if these attempts succeed, and continues if they result in the proper exception. The following tests are performed : - Invoking base-level reflectee behaviour on a mirror - Return values of meta_operations are mirrors - Field selection from a mirror results in a mirror - TODO Field assignment on a mirror with a non-mirror value


testJavaMirrorBaseRelation

public void testJavaMirrorBaseRelation()
Tests the correctness of the up-down relation in Java : - down(up(o)) == o


testMirrorBaseRelation

public void testMirrorBaseRelation()
Tests the correctness of the up-down relation in AmbientTalk : - down(up(o)) == o


testJavaMirrorInvocation

public void testJavaMirrorInvocation()

testMirrorInvocation

public void testMirrorInvocation()

testMirrorFieldAccess

public void testMirrorFieldAccess()

testListMethods

public void testListMethods()