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
super("com.hp.hm.rs");
}
@Override
@Before
public void setUp() throws Exception {
super.setUp();
ResourceTest.setDefaultMediaType(MediaType.APPLICATION_JSON);
switchServiceMock = EasyMock.createMock(SwitchService.class);
sl.register(SwitchService.class, switchServiceMock,
Collections.<String, Object> emptyMap());
jsonServiceMock = EasyMock.createMock(JsonService.class);
sl.register(JsonService.class, jsonServiceMock,
Collections.<String, Object> emptyMap());
}
@Override
@After
public void tearDown() throws Exception {
super.tearDown();
sl.unregister(SwitchService.class, switchServiceMock);
sl.unregister(JsonService.class, jsonServiceMock);
}
@Test
public void testList() {
// Create mocks and define test case data
// Note that the expected switches can be anything
// (it doesn't matter) since the SwitchService has been mocked.
List<Switch> switches = Collections.emptyList();
// Note that the returned JSON does not matter since
// the JSON codec has been mocked.
String switchesJson = "{\"switches\":[]}";
// Recording phase (Define expectations)
EasyMock.expect(switchServiceMock.find(
EasyMock.isNull(SwitchFilter.class),
EasyMock.isNull(SortSpecification.class))).
andReturn(switches);
EasyMock.expect(jsonServiceMock.toJsonList(
EasyMock.same(switches), EasyMock.eq(Switch.class),
EasyMock.eq(true))).andReturn(switchesJson);
188