stub-data-generation

Examples for creating stub data structures with dynamic JVM Languages ?

Over the years, I think I have seen and tried every conceivable way of generating stub data structures (fake data) for complex object graphs. It always gets hairy in java. * * * * A---B----C----D----E (Pardon cheap UML) The key issue is that there are certain relationships between the values, so a certain instance of C m...

Save object in debug and than use it as stub in tests.

My application connects to db and gets tree of categories from here. In debug regime I can see this big tree object and I just thought of ability to save this object somewhere on disk to use in test stubs. Like this: mockedDao = mock(MyDao.class); when(mockedDao.getCategoryTree()).thenReturn(mySavedObject); Assuming mySavedObject - is...

Unit testing - How to set up test data when stubbing database data

Hi, In our unit testing, I've got a stub object that is creating a set of data in memory to be used during unit testing so that the live database is not used. I have unit tests that check the number of rows returned from this set using the query under test and the values supplied to the query in the test. My first issue is that because...

using lazy C++ for stub generation

Hi all Have you ever used lazy C++? I am trying to create .CPP files out of .H files. In forum I read that it is possible with your tool but I tried touse it and I didn't succeed. Can you help me? I used the option -c with a Test.h file with exactly the following declaration. class TEST_A { public: TEST_A(); ~TEST_A(); void foo...