mockmaker.tests
Class MockMakerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by mockmaker.tests.MockMakerTest
All Implemented Interfaces:
junit.framework.Test

public class MockMakerTest
extends junit.framework.TestCase


Field Summary
private  MockCodeWriter myMockCodeWriter
           
private static Configuration TEST_CONFIGURATION
           
 
Constructor Summary
MockMakerTest(java.lang.String name)
           
 
Method Summary
private  java.lang.String addExpectedValuesString(java.lang.String methodName)
           
private  ClassStructure createSourceClassStructure(java.lang.String in)
           
static void main(java.lang.String[] args)
           
private  MockMaker newMockMaker(java.lang.String interfaceName)
           
private  java.lang.String setActualReturnExceptionString(java.lang.String methodName)
           
private  java.lang.String setActualReturnValueString(java.lang.String methodName)
           
private  java.lang.String setExpectedCallsString(java.lang.String methodName)
           
 void setUp()
           
static junit.framework.Test suite()
           
 void testMakeMockForClass()
           
 void testMakeMockForInterfaceWithExceptionThrowingMethod()
           
 void testMakeMockForInterfaceWithInheritedMethod()
           
 void testMakeMockForInterfaceWithNoMethods()
           
 void testMakeMockForInterfaceWithOneArrayParameterMethod()
           
 void testMakeMockForInterfaceWithOnePrimitiveReturningMethod()
           
 void testMakeMockForInterfaceWithOneStringParameterMethod()
           
 void testMakeMockForInterfaceWithOneStringReturningMethod()
           
 void testMakeMockForInterfaceWithOneVoidMethod()
           
 void testMakeMockForInterfaceWithOverloadedMethod()
           
 void testMakeMockForInterfaceWithOverloadedMethodWithArrayParameter()
           
 void testMakeMockForInterfaceWithPrimitiveTypes()
           
 void testMakeMockForNonExistantClass()
           
 void testMakeMockForSubclass()
           
 void testMakeMockFromSource()
           
 void testMakeMockFromSourceWithCorrectNamedParameters()
           
 void testMakeMockWithPackage()
           
private  void verify()
           
 
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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myMockCodeWriter

private MockCodeWriter myMockCodeWriter

TEST_CONFIGURATION

private static final Configuration TEST_CONFIGURATION
Constructor Detail

MockMakerTest

public MockMakerTest(java.lang.String name)
Method Detail

main

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

newMockMaker

private MockMaker newMockMaker(java.lang.String interfaceName)

setUp

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

suite

public static junit.framework.Test suite()

testMakeMockForClass

public void testMakeMockForClass()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithInheritedMethod

public void testMakeMockForInterfaceWithInheritedMethod()
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithNoMethods

public void testMakeMockForInterfaceWithNoMethods()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOneArrayParameterMethod

public void testMakeMockForInterfaceWithOneArrayParameterMethod()
                                                         throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOneStringParameterMethod

public void testMakeMockForInterfaceWithOneStringParameterMethod()
                                                          throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOneStringReturningMethod

public void testMakeMockForInterfaceWithOneStringReturningMethod()
                                                          throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOneVoidMethod

public void testMakeMockForInterfaceWithOneVoidMethod()
                                               throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForNonExistantClass

public void testMakeMockForNonExistantClass()

verify

private void verify()

addExpectedValuesString

private java.lang.String addExpectedValuesString(java.lang.String methodName)

setActualReturnValueString

private java.lang.String setActualReturnValueString(java.lang.String methodName)

setActualReturnExceptionString

private java.lang.String setActualReturnExceptionString(java.lang.String methodName)

setExpectedCallsString

private java.lang.String setExpectedCallsString(java.lang.String methodName)

testMakeMockForInterfaceWithExceptionThrowingMethod

public void testMakeMockForInterfaceWithExceptionThrowingMethod()
                                                         throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOnePrimitiveReturningMethod

public void testMakeMockForInterfaceWithOnePrimitiveReturningMethod()
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOverloadedMethod

public void testMakeMockForInterfaceWithOverloadedMethod()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithOverloadedMethodWithArrayParameter

public void testMakeMockForInterfaceWithOverloadedMethodWithArrayParameter()
                                                                    throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForInterfaceWithPrimitiveTypes

public void testMakeMockForInterfaceWithPrimitiveTypes()
                                                throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockForSubclass

public void testMakeMockForSubclass()
                             throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockFromSource

public void testMakeMockFromSource()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockWithPackage

public void testMakeMockWithPackage()
                             throws java.lang.Exception
Throws:
java.lang.Exception

testMakeMockFromSourceWithCorrectNamedParameters

public void testMakeMockFromSourceWithCorrectNamedParameters()
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

createSourceClassStructure

private ClassStructure createSourceClassStructure(java.lang.String in)