Search in sources :

Example 1 with Factory

use of org.kie.workbench.common.stunner.core.factory.Factory in project kie-wb-common by kiegroup.

the class FactoryRegistryImplTest method testRegister.

@Test
public void testRegister() {
    DefinitionFactory definitionFactory = mock(DefinitionFactory.class);
    ElementFactory graphFactory = mock(ElementFactory.class);
    DiagramFactory diagramFactory = mock(DiagramFactory.class);
    Factory randomFactory = mock(Factory.class);
    FactoryRegistryImpl factory = new FactoryRegistryImpl(adapter);
    factory.register(definitionFactory);
    factory.register(graphFactory);
    factory.register(diagramFactory);
    factory.register(randomFactory);
    Collection<?> factories = factory.getAllFactories();
    assertEquals(3, factories.stream().count());
}
Also used : DiagramFactory(org.kie.workbench.common.stunner.core.factory.diagram.DiagramFactory) DiagramFactory(org.kie.workbench.common.stunner.core.factory.diagram.DiagramFactory) Factory(org.kie.workbench.common.stunner.core.factory.Factory) DefinitionFactory(org.kie.workbench.common.stunner.core.factory.definition.DefinitionFactory) GraphFactory(org.kie.workbench.common.stunner.core.factory.graph.GraphFactory) ElementFactory(org.kie.workbench.common.stunner.core.factory.graph.ElementFactory) DefinitionFactory(org.kie.workbench.common.stunner.core.factory.definition.DefinitionFactory) ElementFactory(org.kie.workbench.common.stunner.core.factory.graph.ElementFactory) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Factory (org.kie.workbench.common.stunner.core.factory.Factory)1 DefinitionFactory (org.kie.workbench.common.stunner.core.factory.definition.DefinitionFactory)1 DiagramFactory (org.kie.workbench.common.stunner.core.factory.diagram.DiagramFactory)1 ElementFactory (org.kie.workbench.common.stunner.core.factory.graph.ElementFactory)1 GraphFactory (org.kie.workbench.common.stunner.core.factory.graph.GraphFactory)1