assemblits / eru

The open JavaFX SCADA
GNU General Public License v3.0
14 stars 9 forks source link

ComponentsIdsGeneratorTest have hard dependence of Gauge #83

Closed marl0rd closed 7 years ago

marl0rd commented 7 years ago

Why:

    def 'should assign id to eru components without ids'() {
        given:
        def eruComponent = Mock(FXOMInstance)
        def eruComponent1 = Mock(FXOMInstance)
        def eruComponent2 = Mock(FXOMInstance)
        when:
        fxomDocument.getFxomRoot() >> eruComponent
        jfxClassUtil.isNotJavaFxComponent(_) >> true
        eruComponent.getDeclaredClass() >> EruGauge
        eruComponent.getChildObjects() >> [eruComponent1, eruComponent2]
        eruComponent1.getDeclaredClass() >> EruGauge
        eruComponent1.getChildObjects() >> []
        eruComponent2.getDeclaredClass() >> EruGauge
        eruComponent2.getChildObjects() >> []
        componentsIdsGenerator.generateComponentsId(fxomDocument)
        then:
        1 * eruComponent.setFxId(_)
        1 * eruComponent1.setFxId(_)
        1 * eruComponent2.setFxId(_)
    }

Do not understand why the components have to have an ID....

gilbertojrequena commented 7 years ago

Because before I created tags for all the component properties and I assigned the component id to each tag, with this id I was able to have a relation display - tag

marl0rd commented 7 years ago

I think, the relation display tag is not needed due to the new implementation of the ProjectDynamicBehavior

marl0rd commented 7 years ago

Let me try something...

marl0rd commented 7 years ago

Confirmed. Is not needed...