// Speed up propagation of events by adjusting delay/period to 1 second
PluginContainerConfiguration pcc = new PluginContainerConfiguration();
pcc.setEventSenderInitialDelay(1);
pcc.setEventSenderPeriod(1);
PluginContainer pluginContainer = PluginContainer.getInstance();
pluginContainer.setConfiguration(pcc);
pluginContainer.initialize();
eventManager = pluginContainer.getEventManager();
Resource resource = new Resource();
resource.setResourceType(resourceType);
resource.setUuid(UUID.randomUUID().toString());
resource.setPluginConfiguration(configuration);
ResourceComponent parentResourceComponent = null;
ResourceContext<?> parentResourceContext = null;
ResourceDiscoveryComponent resourceDiscoveryComponent = new NothingDiscoveringDiscoveryComponent();
SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
File temporaryDirectory = temp;
File dataDirectory = temp;
String pluginContainerName = "rhq";
EventContext eventContext = new EventContextImpl(resource, eventManager);
OperationContext operationContext = new OperationContextImpl(0);
ContentContext contentContext = new ContentContextImpl(0);
PluginContainerDeployment pluginContainerDeployment = null;
AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
ResourceContext context = new ResourceContext(resource, parentResourceComponent, parentResourceContext,
resourceDiscoveryComponent, systemInfo, temporaryDirectory, dataDirectory, pluginContainerName,
eventContext, operationContext, contentContext, availContext, inventoryContext, pluginContainerDeployment);
Assert.assertNotNull(context.getEventContext());
component.start(context);