blob: a0011f65bc830872f5ba99d9357ca70c0b1508fa [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
andrewsbrown533c6ef2015-03-03 16:08:41 -080027Copyright © 2015, Intel Corporation.
28
29This 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
31This 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.