use of org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent in project onos by opennetworkinglab.
the class OpenConfigComponentHandlerTest method testGetModelObject.
/**
* UnitTest method for getModelObject.
*/
@Test
public void testGetModelObject() {
// test Handler
OpenConfigComponentHandler component = new OpenConfigComponentHandler("name", parent);
// expected ModelObject
DefaultComponent modelObject = new DefaultComponent();
modelObject.name("name");
assertEquals("[NG]getModelObject:Return is not an expected ModelObject.\n", modelObject, component.getModelObject());
}
use of org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent in project onos by opennetworkinglab.
the class OpenConfigComponentHandlerTest method testAddConfig.
/**
* UnitTest method for addConfig.
*/
@Test
public void testAddConfig() {
// test Handler
OpenConfigComponentHandler component = new OpenConfigComponentHandler("name", parent);
// call addConfig
OpenConfigConfigOfComponentHandler config = new OpenConfigConfigOfComponentHandler(component);
// expected ModelObject
DefaultComponent modelObject = new DefaultComponent();
modelObject.name("name");
DefaultConfig con = new DefaultConfig();
modelObject.config(con);
assertEquals("[NG]addConfig:ModelObject(Config added) is not an expected one.\n", modelObject, component.getModelObject());
}
use of org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent in project onos by opennetworkinglab.
the class OpenConfigComponentHandlerTest method testAddTransceiver.
/**
* UnitTest method for addTransceiver.
*/
@Test
public void testAddTransceiver() {
// test Handler
OpenConfigComponentHandler component = new OpenConfigComponentHandler("name", parent);
// call addTransceiver
OpenConfigTransceiverHandler transceiver = new OpenConfigTransceiverHandler(component);
// expected ModelObject
DefaultComponent modelObject = new DefaultComponent();
modelObject.name("name");
DefaultTransceiver trans = new DefaultTransceiver();
DefaultAugmentedOcPlatformComponent augmentedOcPlatformComponent = new DefaultAugmentedOcPlatformComponent();
augmentedOcPlatformComponent.transceiver(trans);
modelObject.addAugmentation(augmentedOcPlatformComponent);
assertEquals("[NG]addTransceiver:ModelObject(Transceiver added) is not an expected one.\n", modelObject, component.getModelObject());
}
use of org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent in project onos by opennetworkinglab.
the class OpenConfigComponentsHandlerTest method testAddComponent.
/**
* UnitTest method for addComponent.
*/
@Test
public void testAddComponent() {
// test Handler
OpenConfigComponentsHandler components = new OpenConfigComponentsHandler();
// call addComponent
OpenConfigComponentHandler component = new OpenConfigComponentHandler("name", components);
// expected ModelObject
DefaultComponents modelObject = new DefaultComponents();
DefaultComponent comp = new DefaultComponent();
comp.name("name");
modelObject.addToComponent(comp);
assertEquals("[NG]addComponent:ModelObject(Component added) is not an expected one.\n", modelObject, components.getModelObject());
}
use of org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent in project onos by opennetworkinglab.
the class PlainPlatform method componentWithName.
public static Component componentWithName(String componentName) {
checkNotNull(componentName, "componentName cannot be null");
Component component = new DefaultComponent();
component.name(componentName);
Config config = new DefaultConfig();
config.name(componentName);
component.config(config);
return component;
}
Aggregations