yang-maven-plugin now adds revision to the packaged yang file name.
This is introduced in https://git.opendaylight.org/gerrit/#/c/62706/.
Adjust NetconfMappingTest and NetconfMDSalMappingTest to that.
https://git.opendaylight.org/gerrit/#/c/62731/ enforces revisions to be
in valid yyyy-MM-dd format. Adjust Restconf tests to this change.
Change-Id: I00372ee98b15d3194c8a8567a041f24f161d7276
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
}
private List<InputStream> getYangs() {
}
private List<InputStream> getYangs() {
- final List<String> paths = Arrays.asList("/META-INF/yang/config.yang", "/META-INF/yang/rpc-context.yang",
- "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang",
- "/META-INF/yang/test-types.yang", "/META-INF/yang/test-groups.yang",
- "/META-INF/yang/ietf-inet-types@2013-07-15.yang");
+ final List<String> paths = Arrays.asList("/META-INF/yang/config@2013-04-05.yang",
+ "/META-INF/yang/rpc-context@2013-06-17.yang", "/META-INF/yang/config-test@2013-06-13.yang",
+ "/META-INF/yang/config-test-impl@2013-04-03.yang", "/META-INF/yang/test-types@2013-11-27.yang",
+ "/META-INF/yang/test-groups@2014-12-08.yang", "/META-INF/yang/ietf-inet-types@2013-07-15.yang");
final Collection<InputStream> yangDependencies = new ArrayList<>();
for (final String path : paths) {
final InputStream is = Preconditions
final Collection<InputStream> yangDependencies = new ArrayList<>();
for (final String path : paths) {
final InputStream is = Preconditions
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doAnswer;
+import com.google.common.base.Preconditions;
import com.google.common.io.ByteSource;
import com.google.common.util.concurrent.Futures;
import java.io.InputStream;
import com.google.common.io.ByteSource;
import com.google.common.util.concurrent.Futures;
import java.io.InputStream;
}
private List<InputStream> getYangSchemas() {
}
private List<InputStream> getYangSchemas() {
- final List<String> schemaPaths = Arrays.asList("/META-INF/yang/config.yang",
+ final List<String> schemaPaths = Arrays.asList("/META-INF/yang/config@2013-04-05.yang",
"/yang/mdsal-netconf-mapping-test.yang");
final List<InputStream> schemas = new ArrayList<>();
for (final String schemaPath : schemaPaths) {
"/yang/mdsal-netconf-mapping-test.yang");
final List<InputStream> schemas = new ArrayList<>();
for (final String schemaPath : schemaPaths) {
- final InputStream resourceAsStream = getClass().getResourceAsStream(schemaPath);
+ final InputStream resourceAsStream =
+ Preconditions.checkNotNull(
+ getClass().getResourceAsStream(schemaPath), "Resource " + schemaPath + " not found.");
schemas.add(resourceAsStream);
}
schemas.add(resourceAsStream);
}
}
}
final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
}
}
final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
- final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-14-12", "localName"));
+ final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-12-14", "localName"));
Mockito.when(path.getLastPathArgument()).thenReturn(pathValue);
final ListenerAdapter listener = Notificator.createListener(path, "streamName", NotificationOutputType.JSON);
listener.setQueryParams(Instant.now(), Optional.empty(), Optional.ofNullable(filter), false);
Mockito.when(path.getLastPathArgument()).thenReturn(pathValue);
final ListenerAdapter listener = Notificator.createListener(path, "streamName", NotificationOutputType.JSON);
listener.setQueryParams(Instant.now(), Optional.empty(), Optional.ofNullable(filter), false);
.setGlobalSchema(YangParserTestUtils.parseYangSources(TestRestconfUtils.loadFiles("/notifications")));
final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
.setGlobalSchema(YangParserTestUtils.parseYangSources(TestRestconfUtils.loadFiles("/notifications")));
final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
- final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-14-12", "localName"));
+ final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-12-14", "localName"));
Mockito.when(path.getLastPathArgument()).thenReturn(pathValue);
Notificator.createListener(path, this.identifier, NotificationOutputType.XML);
}
Mockito.when(path.getLastPathArgument()).thenReturn(pathValue);
Notificator.createListener(path, this.identifier, NotificationOutputType.XML);
}
@Test
public void onNotifiTest() throws Exception {
final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
@Test
public void onNotifiTest() throws Exception {
final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
- final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-14-12", "localName"));
+ final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-12-14", "localName"));
Mockito.when(path.getLastPathArgument()).thenReturn(pathValue);
final ListenerAdapter listener = Notificator.createListener(path, this.identifier, NotificationOutputType.XML);
Mockito.when(path.getLastPathArgument()).thenReturn(pathValue);
final ListenerAdapter listener = Notificator.createListener(path, this.identifier, NotificationOutputType.XML);
private void binaryKeyTest(final List<Byte> al, final List<Byte> al2) {
private void binaryKeyTest(final List<Byte> al, final List<Byte> al2) {
- final QName keyDef = QName.create("test:key:binary", "2017-14-08", "b1");
+ final QName keyDef = QName.create("test:key:binary", "2017-08-14", "b1");
final Map<QName, Object> uriKeyValues = new HashMap<>();
uriKeyValues.put(keyDef, al.toArray());
final Map<QName, Object> uriKeyValues = new HashMap<>();
uriKeyValues.put(keyDef, al.toArray());