Andrew Brown | a5a0773 | 2015-02-21 13:11:56 -0800 | [diff] [blame] | 1 | # jndn-mock |
| 2 | |
| 3 | This project consists of tools for testing NDN applications without network IO. It relies on the [NDN Protocol](https://named-data.net) and its associated [client library](https://github.com/named-data/jndn). |
| 4 | |
| 5 | ## Install |
| 6 | With Maven, add the following to your POM: |
| 7 | ``` |
| 8 | <dependency> |
| 9 | <groupId>com.intel.jndn.mock</groupId> |
| 10 | <artifactId>jndn-mock</artifactId> |
| 11 | <version>RELEASE</version> <!-- or a specific version --> |
| 12 | </dependency> |
| 13 | ``` |
| 14 | |
| 15 | ## Use |
| 16 | `MockFace` and `MockTransport` are test tools that can be passed to applications instead of the typical `Face` and `Transport`. For example: |
| 17 | ``` |
| 18 | MockTransport transport = new MockTransport(); |
| 19 | MockFace face = new MockFace(transport, null); |
| 20 | |
| 21 | application.doSomethingOn(face); |
| 22 | assertEquals(0, transport.getSentDataPackets().size()); |
| 23 | assertEquals(1, transport.getSentInterestPackets().size()); |
| 24 | ``` |
| 25 | |
| 26 | ## License |
| 27 | © Copyright Intel Corporation. Licensed under LGPLv3, see [LICENSE](https://github.com/01org/jndn-mock/blob/master/LICENSE). |