import org.junit.Before;
import org.junit.Test;
+
import static org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper.*;
+
import org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator;
import org.opendaylight.controller.sal.binding.test.mock.FooService;
import org.opendaylight.controller.sal.binding.test.mock.ReferencableObject;
import org.opendaylight.controller.sal.binding.test.mock.SimpleInput;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
}
private void verifyRouting(FooService product) {
- Map<InstanceIdentifier,FooService> routingTable = new HashMap<>();
+ Map<InstanceIdentifier<? extends Object>,FooService> routingTable = new HashMap<>();
setRoutingTable(product, BaseIdentity.class, routingTable);
assertSame("Returned routing table should be same instance",routingTable,getRoutingTable(product, BaseIdentity.class));
int servicesCount = 2;
int instancesPerService = 3;
- InstanceIdentifier[][] identifiers = identifiers(servicesCount,instancesPerService);
+ InstanceIdentifier<?>[][] identifiers = identifiers(servicesCount,instancesPerService);
FooService service[] = new FooService[] {
mock(FooService.class, "Instance 0"),
mock(FooService.class,"Instance 1")
};
for(int i = 0;i<service.length;i++) {
- for (InstanceIdentifier instance : identifiers[i]) {
+ for (InstanceIdentifier<?> instance : identifiers[i]) {
routingTable.put(instance, service[i]);
}
}
verify(service[1]).simple(instance_1_input[0]);
}
- private InstanceIdentifier[][] identifiers(int serviceSize, int instancesPerService) {
- InstanceIdentifier[][] ret = new InstanceIdentifier[serviceSize][];
+ private InstanceIdentifier<?>[][] identifiers(int serviceSize, int instancesPerService) {
+ InstanceIdentifier<?>[][] ret = new InstanceIdentifier[serviceSize][];
int service = 0;
for (int i = 0;i<serviceSize;i++) {
- InstanceIdentifier[] instanceIdentifiers = new InstanceIdentifier[instancesPerService];
+ InstanceIdentifier<?>[] instanceIdentifiers = new InstanceIdentifier[instancesPerService];
ret[i] = instanceIdentifiers;
for(int id = 0;id<instancesPerService;id++) {
instanceIdentifiers[id] = referencableIdentifier(service*instancesPerService+id);
return ret;
}
- private InstanceIdentifier referencableIdentifier(int i) {
+ private InstanceIdentifier<?> referencableIdentifier(int i) {
ReferencableObjectKey key = new ReferencableObjectKey(i);
IdentifiableItem<ReferencableObject,ReferencableObjectKey> pathArg = new IdentifiableItem<>(ReferencableObject.class,key);
- return new InstanceIdentifier(Arrays.<PathArgument>asList(pathArg), ReferencableObject.class);
+ return new InstanceIdentifier<ReferencableObject>(Arrays.<PathArgument>asList(pathArg), ReferencableObject.class);
}
private static class SimpleInputImpl implements SimpleInput {
- private final InstanceIdentifier identifier;
+ private final InstanceIdentifier<?> identifier;
- public SimpleInputImpl(InstanceIdentifier _identifier) {
+ public SimpleInputImpl(InstanceIdentifier<?> _identifier) {
this.identifier = _identifier;
}
}
@Override
- public InstanceIdentifier getIdentifier() {
+ public InstanceIdentifier<?> getIdentifier() {
return this.identifier;
}
}