import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
import org.opendaylight.netconf.sal.streams.listeners.Notificator;
-import org.opendaylight.restconf.Draft16;
+import org.opendaylight.restconf.Draft17;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfStreamsService;
import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeConstants;
import org.opendaylight.restconf.utils.mapping.RestconfMappingStreamConstants;
+import org.opendaylight.yang.gen.v1.urn.sal.restconf.event.subscription.rev140708.NotificationOutputTypeGrouping.NotificationOutputType;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
Notificator.removeAllListeners();
// put test streams
- Notificator.createListener(EMPTY, RestconfStreamsServiceTest.expectedStreams.get(0));
- Notificator.createListener(EMPTY, RestconfStreamsServiceTest.expectedStreams.get(1));
- Notificator.createListener(EMPTY, RestconfStreamsServiceTest.expectedStreams.get(2));
+ Notificator.createListener(EMPTY, RestconfStreamsServiceTest.expectedStreams.get(0),
+ NotificationOutputType.XML);
+ Notificator.createListener(EMPTY, RestconfStreamsServiceTest.expectedStreams.get(1),
+ NotificationOutputType.XML);
+ Notificator.createListener(EMPTY, RestconfStreamsServiceTest.expectedStreams.get(2),
+ NotificationOutputType.XML);
}
@AfterClass
public void getAvailableStreamsTest() throws Exception {
// prepare conditions - get correct Restconf module
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("ietf-restconf"));
// make test
public void getAvailableStreamsMissingRestconfModuleNegativeTest() {
// prepare conditions - get null Restconf module
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null);
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null);
// make test
this.thrown.expect(NullPointerException.class);
public void getAvailableStreamsMissingListStreamNegativeTest() {
// prepare conditions - get Restconf module with missing list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-missing-list-stream"));
// make test and verify
public void getAvailableStreamsMissingContainerStreamsNegativeTest() {
// prepare conditions - get Restconf module with missing container streams
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-missing-container-streams"));
// make test and verify
public void getAvailableStreamsIllegalListStreamNegativeTest() {
// prepare conditions - get Restconf module with illegal list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-list-stream"));
// make test
public void getAvailableStreamsIllegalContainerStreamsNegativeTest() {
// prepare conditions - get Restconf module with illegal container streams
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-container-streams"));
// make test
public void getAvailableStreamsIllegalLeafDescriptionNegativeTest() {
// prepare conditions - get Restconf module with illegal leaf description in list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft16.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft17.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-leaf-description"));
// make test
* @return Restconf module
*/
private Module getTestingRestconfModule(final String s) {
- return this.schemaContext.findModuleByName(s, Draft16.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return this.schemaContext.findModuleByName(s, Draft17.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**