blob: 019b8cfce9664d3ac35f6c669f4dfb5ecf71ba63 [file] [log] [blame] [view]
Andrew Browna5a07732015-02-21 13:11:56 -08001# jndn-mock
2
3This 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
6With 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```
18MockTransport transport = new MockTransport();
19MockFace face = new MockFace(transport, null);
20
21application.doSomethingOn(face);
22assertEquals(0, transport.getSentDataPackets().size());
23assertEquals(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).