package org.opendaylight.yangtools.it.yang.runtime.tests;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import com.google.common.base.Optional;
+
import java.util.AbstractMap.SimpleEntry;
import java.util.Map.Entry;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import com.google.common.base.Optional;
-
public class RuntimeCodecAugmentationWithGroupingsAndCasesTest {
private static final InstanceIdentifier<ExtWithGroupingAugmentations> GROUPING_AUGMENTATIONS_PATH = InstanceIdentifier
assertNotNull(schemaContext);
assertTrue(schemaContext.isPresent());
- mappingService = new RuntimeGeneratedMappingServiceImpl(moduleInfoContext);
- mappingService.setPool(ClassPool.getDefault());
- mappingService.init();
+ mappingService = new RuntimeGeneratedMappingServiceImpl(ClassPool.getDefault(), moduleInfoContext);
mappingService.onGlobalContextUpdated(schemaContext.get());
}
public void testSerialization() {
ExtWithGroupingAugmentations caseData = new ExtWithGroupingAugmentationsBuilder() //
- .setGroupingData(new GroupingDataBuilder() //
- .addAugmentation(InUsesAugment.class, new InUsesAugmentBuilder() //
- .setExtAumentation("InUses") //
- .build()) //
- .build()) //
- .build();
-
- Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode> result = mappingService
+ .setGroupingData(new GroupingDataBuilder() //
+ .addAugmentation(InUsesAugment.class, new InUsesAugmentBuilder() //
+ .setExtAumentation("InUses") //
+ .build()) //
+ .build()) //
+ .build();
+
+ Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, CompositeNode> result = mappingService
.toDataDom(new SimpleEntry(GROUPING_AUGMENTATIONS_PATH, caseData));
assertNotNull(result);
}