{"id":1565,"date":"2012-03-19T13:50:29","date_gmt":"2012-03-19T17:50:29","guid":{"rendered":"http:\/\/hstore.cs.brown.edu\/?page_id=1565"},"modified":"2012-05-24T18:59:27","modified_gmt":"2012-05-24T22:59:27","slug":"writing-new-tests","status":"publish","type":"page","link":"https:\/\/hstore.cs.brown.edu\/documentation\/development\/writing-new-tests\/","title":{"rendered":"Writing New Tests"},"content":{"rendered":"
There are two types of test cases in H-Store. The first is a simple unit test<\/a> that checks a small feature of the system’s internals without needing to deploy the entire database. The other type is referred to as a regression test<\/a> which is designed to execute the end-to-end functionality of the entire system. We now describe how to write each of these types of tests.<\/p>\n <\/a><\/p>\n The testing source code files for the main part of the H-Store system are located in tests\/frontend<\/tt><\/a>. This directory mirrors the heirachy of src\/frontend<\/tt><\/a>. For a given class file in src<\/tt>, there will be a corresponding class file in the same directory in tests<\/tt>, except that the class name will have the Test<\/tt> prefix. That is, if the source class file that you want to write a test case for is called MyClass<\/tt>, then the test class file will be called TestMyClass<\/tt>.<\/p>\n There is a special abstract class called BaseTestCase<\/tt><\/a> that extends the default JUnit TestCase class. BaseTestCase<\/tt> provides various helper methods for working with built-in benchmarks<\/a> and their catalogs.<\/p>\n For example, the following test case will automatically create the TPC-C project catalog for each test case. After the setUp()<\/tt> method is complete, the test cases can retrieve various objects from compiled Catalog<\/tt> using theWriting a Unit Test Case<\/h2>\n
\nBaseTestCase<\/tt> API:<\/p>\n\n