Reference Guide
Table Of Contents
- 1 Introduction
- 2 Establishing Your Test and Development Environments
- 3 Developing Applications
- Introduction
- Authentication
- REST API
- Audit Logging
- Alert Logging
- Configuration
- High Availability
- OpenFlow
- Metrics Framework
- GUI
- SKI Framework - Overview
- SKI Framework - Navigation Tree
- SKI Framework - Hash Navigation
- SKI Framework - View Life-Cycle
- SKI Framework - Live Reference Application
- UI Extension
- Introduction
- Controller Teaming
- Distributed Coordination Service
- Persistence
- Backup and Restore
- Device Driver Framework
- 4 Application Security
- 5 Including Debian Packages with Applications
- 6 Sample Application
- Application Description
- Creating Application Development Workspace
- Application Generator (Automatic Workspace Creation)
- Creating Eclipse Projects
- Updating Project Dependencies
- Building the Application
- Installing the Application
- Application Code
- 7 Testing Applications
- 8 Built-In Applications
- Appendix A
- Appendix B
- Bibliography
ResourceTest.setDefaultMediaType(MediaType.APPLICATION_JSON);
}
// When using the inherited methods get(...), post(...), put(...) and
// delete(..) if exceptions are thrown by the Resource (REST) or if the
// returned code is different than 200 (OK) the test fail.
@Test
public void testList() {
String response = get(BASE_PATH);
String expectedResponse = "{\”switches\”:[]}";
assertResponseContains(response, expectedResponse);
}
@Test
public void testGet() {
long idMock = 1;
String path = BASE_PATH + "/" + idMock;
String response = get(path);
String expectedResponse = "{\”switch\”:{}}";
assertResponseContains(response, expectedResponse);
}
@Test
public void testAdd() {
String jsonRequest = "{\”switch\”:{}}";
String response = post(BASE_PATH, jsonRequest);
String expectedResponse = "{switch:{}}";
assertResponseContains(response, expectedResponse);
}
@Test
public void testDelete() {
long idMock = 1;
String path = BASE_PATH + "/" + idMock;
String response = delete(path);
Assert.assertTrue(response.isEmpty());
}
}
Resource Test Dependencies:
<dependency>
<groupId>com.hp.sdn</groupId>
<artifactId>sdn-common-misc</artifactId>
<version>${sdn.version}</version>
</dependency>
179