platformType = new ResourceType("testplatAB", "p", ResourceCategory.PLATFORM, null);
em.persist(platformType);
for (int m = 0; m < measurementCount; m++) {
MeasurementDefinition def = new MeasurementDefinition(platformType, "testAutoBaselineMeasDef" + m);
def.setDefaultOn(true);
def.setDisplayName("testAutoBaseline Measurement Display Name" + m);
def.setMeasurementType(NumericType.DYNAMIC);
em.persist(def);
allDefs.add(def);
}
em.flush();
em.clear();
System.out.println("Populating test inventory with [" + resourceCount + "] resources.");
agent = new Agent("test-agent", "localhost", 1234, "", "randomToken");
em.persist(agent);
Resource root = null;
for (int r = 0; r < resourceCount; r++) {
Resource resource = new Resource(String.valueOf(r), "testAutoBaselineResource" + r, platformType);
resource.setUuid("" + new Random().nextInt());
if (root == null) {
root = resource;
} else {
root.addChildResource(resource);
}
em.persist(resource);
allResources.add(resource);
resource.setAgent(agent);
for (MeasurementDefinition def : allDefs) {
MeasurementSchedule sched = new MeasurementSchedule(def, resource);
sched.setEnabled(true);
resource.addSchedule(sched);
def.addSchedule(sched);
em.persist(sched);
allScheds.add(sched);
}
if ((r % 50) == 0) {