Example #1
0
  @Before
  public void setUp() throws Exception {
    catalog = mock(Catalog.class);
    layer = mockLayer("testLayer", new String[] {"style1", "style2"}, PublishedType.RASTER);
    layerGroup = mockGroup("testGroup", layer);
    mockCatalog();

    defaults = GWCConfig.getOldDefaults();

    gwcConfigPersister = mock(GWCConfigPersister.class);
    when(gwcConfigPersister.getConfig()).thenReturn(defaults);

    storageBroker = mock(StorageBroker.class);
    gridSetBroker = new GridSetBroker(true, true);

    tileLayerInfo = TileLayerInfoUtil.loadOrCreate(layer, defaults);
    tileLayerGroupInfo = TileLayerInfoUtil.loadOrCreate(layerGroup, defaults);

    tileLayer = new GeoServerTileLayer(layer, gridSetBroker, tileLayerInfo);
    tileLayerGroup = new GeoServerTileLayer(layerGroup, gridSetBroker, tileLayerGroupInfo);

    tld = mock(TileLayerDispatcher.class);
    mockTileLayerDispatcher();

    config = mock(Configuration.class);
    tileBreeder = mock(TileBreeder.class);
    quotaStore = mock(QuotaStore.class);
    diskQuotaMonitor = mock(DiskQuotaMonitor.class);
    when(diskQuotaMonitor.getQuotaStore()).thenReturn(quotaStore);
    owsDispatcher = mock(Dispatcher.class);

    storageFinder = mock(DefaultStorageFinder.class);
    jdbcStorage = mock(JDBCConfigurationStorage.class);

    mediator =
        new GWC(
            gwcConfigPersister,
            storageBroker,
            tld,
            gridSetBroker,
            tileBreeder,
            diskQuotaMonitor,
            owsDispatcher,
            catalog,
            storageFinder,
            jdbcStorage);

    GWC.set(mediator);
  }
Example #2
0
 @After
 public void tearDown() {
   GWC.set(null);
 }