p-unitp-unit is an open source framework for performance benchmark and unit test | |
Download |
p-unit Ranking & Summary
Advertisement
- License:
- GPL
- Publisher Name:
- Andrew Zhang
- Operating Systems:
- Windows All / Unix
- File Size:
- 2.6 MB
p-unit Tags
- tracker unit Convert Unit Measurement Unit XSLT unit test unit test benchmark test framework unit test framework Organization Unit importer database unit test unit test management distortion unit effect unit control BrightEye unit BrightEye unit asm to pascal unit Unit Convertor unit of measure unit transformer scout unit management scout unit system scout unit Unit Calculation make unit unit hider unit modifier generate unit test unit test generator VLC Unit Extension VLC Unit write unit test Declarative Test Framework test framework add-on engineering unit oscilator unit parse unit test unit free interface unit performance benchmark Benchmark Test memory consumption tracker benchmark framework p-unit Unit Structure unit tester media conference unit volume unit unit test development Unit Test Extension unit class Unit Testing Framework Cooling unit Heating unit imperial unit unit computation physical unit Behaviour to Unit unit test code unit test tool UIMA unit test create unit test Unit test automation persistence unit parser persistence unit time unit Organizational Unit metric unit Engine Control Unit editor unit calcultation generate unit test case execute unit test case .NET assembly unit test Clarion unit test unit test analyzer Unit Test runner QTestLib unit test GoogleTest unit test unit of measurement performance test framework thread test framework chorus unit Learning Design unit unit test library implement unit tests unit test builder unit test creator Delphi Unit Java unit test automated unit test Distance Unit Speed Unit Acceleration Unit NET Unit define unit test execute unit test graphics processing unit MKS Unit Unit Fund Profitability Unit Fund test map source check data unit Silverlight Unit Test Automate Unit Test Audio Unit universal unit con unit aware
p-unit Description
p-unit is an open source framework for performance benchmark and unit test, which supports to run the same tests solo or concurrently, generates the result in the form of plain text, image or pdf file and tracks memory and time consumption. Test Suite and Test Class Test suite and test class are two important concepts in p-unit. p-unit does not require any special type for a test class, so every class can be a test class. Of course, it includes junit test cases. There is one special interface for special p-unit only test class - p-unitTest. p-unit executes a normal test as following procedure: · invoke setUp if there is. · invoke the test method. · invoke tearDown method. Noticed that setUp and tearDown will also be regarded as a part of performance test. If you don't want to count them into performance data, you need to implement p-unitTest interface, which will be executed as: · invoke setUpBeforeWatchers. · invoke setAfterWatchers. · invoke the test method. · invoke tearDownBeforeWatchers. · invoke tearDownAfterWatchers. As the name suggests, you can put the setUp and tearDown code into the setUpBeforeWatchers and tearDownAfterWatchers. Time/Memory Record p-unit records the memory and time consumption of running a test method. There is a "watcher" concept in p-unit, which supervises the status during running the test method. By default, memory watcher and time watcher are installed. p-unit supports user-defined watcher too. The user only needs to implement the Watcher interface and register it to p-unit method runner. By default, time watcher is enabled. If you want to watch memory consumption, you need to add one line code: runner.methodRunner().addWatcher(new MemoryWatcher()); Concurrent p-unit supports to run the test concurrently. How to write it? You DON'T need to write anything about concurrent in your test - just the same as a normal test. You only need to use p-unitConcurrentRunner to run your test concurrently. For more detail, please refer to Runner. Runner Runner is the core concept of p-unit. You need a runner to run your test. By default, there are two different runners - solo runner and concurrent runner, so that one test can be executed solo and concurrently. Is it complex to launch a runner? ONE line code: new SoloRunner().run(MyTest.class); or new ConcurrentRunner().run(MyTest.class); By default, p-unitConcurrentRunner starts up 10 threads to execute the test method. You can configure it in the constructor of p-unitConcurrentRunner(int threadCount), and you can even do fine control in your test class. If you need to execute different test class with different thread count, you only need to implement Concurrent interface for your test, which requires to return concurrentCount.
p-unit Related Software