Search in sources :

Example 1 with DisplayString

use of org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.DisplayString in project controller by opendaylight.

the class OpenDaylightToasterTest method testToasterInitOnStartUp.

@Test
public void testToasterInitOnStartUp() throws Exception {
    DataBroker broker = getDataBroker();
    ReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
    Optional<Toaster> optional = readTx.read(LogicalDatastoreType.OPERATIONAL, TOASTER_IID).get();
    assertNotNull(optional);
    assertTrue("Operational toaster not present", optional.isPresent());
    Toaster toasterData = optional.get();
    assertEquals(Toaster.ToasterStatus.Up, toasterData.getToasterStatus());
    assertEquals(new DisplayString("Opendaylight"), toasterData.getToasterManufacturer());
    assertEquals(new DisplayString("Model 1 - Binding Aware"), toasterData.getToasterModelNumber());
    Optional<Toaster> configToaster = readTx.read(LogicalDatastoreType.CONFIGURATION, TOASTER_IID).get();
    assertFalse("Didn't expect config data for toaster.", configToaster.isPresent());
}
Also used : Toaster(org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.Toaster) DisplayString(org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.DisplayString) ReadOnlyTransaction(org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) AbstractConcurrentDataBrokerTest(org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 ReadOnlyTransaction (org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction)1 AbstractConcurrentDataBrokerTest (org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest)1 DisplayString (org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.DisplayString)1 Toaster (org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.Toaster)1