Search in sources :

Example 1 with DefaultComponent

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());
}
Also used : DefaultComponent(org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent) Test(org.junit.Test)

Example 2 with DefaultComponent

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());
}
Also used : DefaultComponent(org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent) DefaultConfig(org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.component.DefaultConfig) Test(org.junit.Test)

Example 3 with DefaultComponent

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());
}
Also used : DefaultComponent(org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent) DefaultTransceiver(org.onosproject.yang.gen.v1.openconfigplatformtransceiver.rev20180515.openconfigplatformtransceiver.porttransceivertop.DefaultTransceiver) DefaultAugmentedOcPlatformComponent(org.onosproject.yang.gen.v1.openconfigplatformtransceiver.rev20180515.openconfigplatformtransceiver.components.component.DefaultAugmentedOcPlatformComponent) Test(org.junit.Test)

Example 4 with DefaultComponent

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());
}
Also used : DefaultComponent(org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent) DefaultComponents(org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.DefaultComponents) Test(org.junit.Test)

Example 5 with DefaultComponent

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;
}
Also used : DefaultComponent(org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.DefaultComponent) DefaultConfig(org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.component.DefaultConfig) Config(org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.component.Config) DefaultConfig(org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.component.DefaultConfig) Component(org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.Component) DefaultComponent(org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.DefaultComponent)

Aggregations

Test (org.junit.Test)4 DefaultComponent (org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.DefaultComponent)4 Component (org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.Component)1 DefaultComponent (org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.DefaultComponent)1 Config (org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.component.Config)1 DefaultConfig (org.onosproject.yang.gen.v1.openconfigplatform.rev20161222.openconfigplatform.platformcomponenttop.components.component.DefaultConfig)1 DefaultComponents (org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.DefaultComponents)1 DefaultConfig (org.onosproject.yang.gen.v1.openconfigplatform.rev20180603.openconfigplatform.platformcomponenttop.components.component.DefaultConfig)1 DefaultAugmentedOcPlatformComponent (org.onosproject.yang.gen.v1.openconfigplatformtransceiver.rev20180515.openconfigplatformtransceiver.components.component.DefaultAugmentedOcPlatformComponent)1 DefaultTransceiver (org.onosproject.yang.gen.v1.openconfigplatformtransceiver.rev20180515.openconfigplatformtransceiver.porttransceivertop.DefaultTransceiver)1