}
@Test
public void testGetBoundsVisibleArea() throws Exception {
CoordinateReferenceSystem crs = beanLayer.getCrs();
Envelope envelope;
login("luc");
recorder.clear();
envelope = layerService.getBounds(LAYER_ID, crs, null);
Assert.assertEquals(0, envelope.getMinX(), ALLOWANCE);
Assert.assertEquals(0, envelope.getMinY(), ALLOWANCE);
Assert.assertEquals(7, envelope.getMaxX(), ALLOWANCE);
Assert.assertEquals(3, envelope.getMaxY(), ALLOWANCE);
org.junit.Assert.assertEquals("", recorder.matches(CacheCategory.BOUNDS,
"Put item in cache"));
login("marino");
recorder.clear();
envelope = layerService.getBounds(LAYER_ID, crs, null);
Assert.assertEquals(2, envelope.getMinX(), ALLOWANCE);
Assert.assertEquals(0, envelope.getMinY(), ALLOWANCE);
Assert.assertEquals(7, envelope.getMaxX(), ALLOWANCE);
Assert.assertEquals(3, envelope.getMaxY(), ALLOWANCE);
org.junit.Assert.assertEquals("", recorder.matches(CacheCategory.BOUNDS,
"Put item in cache"));
login("luc");
recorder.clear();
envelope = layerService.getBounds(LAYER_ID, crs, null);
Assert.assertEquals(0, envelope.getMinX(), ALLOWANCE);
Assert.assertEquals(0, envelope.getMinY(), ALLOWANCE);
Assert.assertEquals(7, envelope.getMaxX(), ALLOWANCE);
Assert.assertEquals(3, envelope.getMaxY(), ALLOWANCE);
org.junit.Assert.assertEquals("", recorder.matches(CacheCategory.BOUNDS,
"Got item from cache"));
login("marino");
recorder.clear();
envelope = layerService.getBounds(LAYER_ID, crs, null);
Assert.assertEquals(2, envelope.getMinX(), ALLOWANCE);
Assert.assertEquals(0, envelope.getMinY(), ALLOWANCE);
Assert.assertEquals(7, envelope.getMaxX(), ALLOWANCE);
Assert.assertEquals(3, envelope.getMaxY(), ALLOWANCE);
org.junit.Assert.assertEquals("", recorder.matches(CacheCategory.BOUNDS,
"Got item from cache"));
}