jndn-mock

Tools for testing NDN Java code without using network IO

License

License

Categories

Categories

Data Net
GroupId

GroupId

net.named-data.jndn-extra
ArtifactId

ArtifactId

jndn-mock
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

jndn-mock
Tools for testing NDN Java code without using network IO
Project URL

Project URL

https://github.com/named-data/jndn-mock
Source Code Management

Source Code Management

https://github.com/named-data/jndn-mock

Download jndn-mock

How to add to project

<!-- https://jarcasting.com/artifacts/net.named-data.jndn-extra/jndn-mock/ -->
<dependency>
    <groupId>net.named-data.jndn-extra</groupId>
    <artifactId>jndn-mock</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.named-data.jndn-extra/jndn-mock/
implementation 'net.named-data.jndn-extra:jndn-mock:1.2.0'
// https://jarcasting.com/artifacts/net.named-data.jndn-extra/jndn-mock/
implementation ("net.named-data.jndn-extra:jndn-mock:1.2.0")
'net.named-data.jndn-extra:jndn-mock:jar:1.2.0'
<dependency org="net.named-data.jndn-extra" name="jndn-mock" rev="1.2.0">
  <artifact name="jndn-mock" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.named-data.jndn-extra', module='jndn-mock', version='1.2.0')
)
libraryDependencies += "net.named-data.jndn-extra" % "jndn-mock" % "1.2.0"
[net.named-data.jndn-extra/jndn-mock "1.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
net.named-data : jndn jar 0.24

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.slf4j : slf4j-api jar 1.7.30

Project Modules

There are no modules declared in this project.

jndn-mock

This project consists of tools for testing NDN applications without network IO. It relies on the NDN Protocol and its associated client library.

Install

With Maven, add the following to your POM:

<dependency>
  <groupId>com.intel.jndn.mock</groupId>
  <artifactId>jndn-mock</artifactId>
  <version>RELEASE</version> <!-- or a specific version -->
</dependency>

Use

MockFace is a test tool that can be passed to applications instead of a network IO Face; management of the Face.processEvents() is still the user's responsibility, though this may change in a future release. For example:

Face face = new MockFace();
face.expressInterest(interest, onData, onTimeout);
face.processEvents();

When using the MockFace, retrieve statistics about sent/received Interests and Data packets like:

MockFace face = new MockFace();
assertEquals(0, face.sentDatas.size());
assertEquals(0, face.sentInterests.size());

face.expressInterest(interest, onData, onTimeout);
...
face.processEvents();
...
assertEquals(1, face.sentInterests.size());

License

Copyright © 2015, Intel Corporation.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 3, as published by the Free Software Foundation.

This program is distributed in the hope that 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 for more details.

net.named-data.jndn-extra

Named Data Networking

Versions

Version
1.2.0
1.1.1