@Test
public void testGetSystemCpuLoad() {

	double load = CPUDataProvider.getSystemCpuLoad();
	int timeout = 3000;
	long startTime = System.currentTimeMillis();
	// may get -1 returned before MXBeans are initialized, allow time for a
	// real value to be returned
	while (System.currentTimeMillis() - timeout < startTime && load == -1d) {
		load = CPUDataProvider.getSystemCpuLoad();
	}
	double process = CPUDataProvider.getProcessCpuLoad();
	startTime = System.currentTimeMillis();
	// may get -1 returned before MXBeans are initialized, allow time for a
	// real value to be returned
	while (System.currentTimeMillis() - timeout < startTime && process == -1d) {
		process = CPUDataProvider.getProcessCpuLoad();
	}
	assertTrue("CPU load should be greater than 0, was " + load, load >= 0.0d);
	assertTrue("CPU load should be less than 1 (i.e. less than 100%), was " + load, load <= 1d);
}