private AssemblyContext assemblyContext = new AssemblyContextImpl(factory, null, null);
public void testModelVisit() throws Exception {
ComponentType componentType;
Service service;
SystemImplementation impl;
Component component;
Module module = factory.createModule();
// create target component
componentType = factory.createComponentType();
service = factory.createService();
service.setName("target");
componentType.getServices().add(service);
impl = factory.createSystemImplementation();
impl.setComponentType(componentType);
component = factory.createSimpleComponent();
component.setName("target");
component.setImplementation(impl);
component.initialize(assemblyContext);
module.getComponents().add(component);
// create source component
componentType = factory.createComponentType();
Reference ref = factory.createReference();
ref.setName("ref");
componentType.getReferences().add(ref);
impl = factory.createSystemImplementation();
impl.setComponentType(componentType);
component = factory.createSimpleComponent();
component.setName("source");
component.setImplementation(impl);
ConfiguredReference cRef = factory.createConfiguredReference("ref", "target");
component.getConfiguredReferences().add(cRef);