use of org.apache.qpid.server.model.testmodels.hierarchy.TestCar in project qpid-broker-j by apache.
the class ConfiguredObjectToMapConverterTest method createEngineWithContext.
private TestEngine createEngineWithContext() {
setTestSystemProperty(TEST_SYSTEM_PROPERTY1_NAME, TEST_SYSTEM_PROPERTY1_ACTUAL_VALUE);
setTestSystemProperty(TEST_SYSTEM_PROPERTY2_NAME, TEST_SYSTEM_PROPERTY2_ACTUAL_VALUE);
Model model = org.apache.qpid.server.model.testmodels.hierarchy.TestModel.getInstance();
final Map<String, Object> carAttributes = new HashMap<>();
carAttributes.put(ConfiguredObject.NAME, "myCar");
Map<String, String> carContext = new HashMap<>();
carContext.put(PARENT_CONTEXT_PROPERTY1_NAME, PARENT_CONTEXT_PROPERTY1_ACTUAL_VALUE);
carContext.put(PARENT_CONTEXT_PROPERTY2_NAME, PARENT_CONTEXT_PROPERTY2_ACTUAL_VALUE);
carAttributes.put(ConfiguredObject.CONTEXT, carContext);
TestCar car = model.getObjectFactory().create(TestCar.class, carAttributes, null);
final Map<String, Object> engineAttributes = new HashMap<>();
engineAttributes.put(ConfiguredObject.NAME, "myEngine");
engineAttributes.put(ConfiguredObject.TYPE, TestElecEngineImpl.TEST_ELEC_ENGINE_TYPE);
Map<String, String> engineContext = new HashMap<>();
engineContext.put(CHILD_CONTEXT_PROPERTY_NAME, CHILD_CONTEXT_PROPERTY_ACTUAL_VALUE);
engineAttributes.put(ConfiguredObject.CONTEXT, engineContext);
return (TestEngine) car.createChild(TestEngine.class, engineAttributes);
}
Aggregations