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 |
andrewsbrown | 533c6ef | 2015-03-03 16:08:41 -0800 | [diff] [blame] | 27 | Copyright © 2015, Intel Corporation. |
| 28 | |
| 29 | This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU Lesser General Public License, version 3, as published by the Free Software Foundation. |
| 30 | |
| 31 | This program is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU Lesser General Public License](https://github.com/01org/jndn-mock/blob/master/LICENSE) for more details. |