@@ -0,0 +1,2422 @@
+/*%0A * Copyright 2015 MovingBlocks%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22)%7B %7D%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *  http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.terasology.worldviewer.core;%0A%0Aimport java.awt.Graphics2D;%0Aimport java.io.IOException;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0Aimport org.terasology.engine.SimpleUri;%0Aimport org.terasology.engine.module.ModuleManager;%0Aimport org.terasology.registry.CoreRegistry;%0Aimport org.terasology.world.generation.WorldFacet;%0Aimport org.terasology.world.generator.UnresolvedWorldGeneratorException;%0Aimport org.terasology.world.generator.WorldGenerator;%0Aimport org.terasology.world.generator.internal.WorldGeneratorManager;%0Aimport org.terasology.world.viewer.layers.FacetLayer;%0Aimport org.terasology.world.viewer.layers.FacetLayers;%0Aimport org.terasology.worldviewer.config.ViewConfig;%0Aimport org.terasology.worldviewer.env.TinyEnvironment;%0A%0Apublic class ViewerTest %7B%0A    @Before%0A    public void setup() throws IOException %7B%0A        TinyEnvironment.setup();%0A    %7D%0A%0A    @Test%0A    public void testViewer() throws UnresolvedWorldGeneratorException %7B%0A        WorldGeneratorManager worldGeneratorManager = CoreRegistry.get(WorldGeneratorManager.class);%0A        WorldGenerator worldGen = worldGeneratorManager.createGenerator(new SimpleUri(%22core:facetedperlin%22));%0A        String worldSeed = %22asdf%22;%0A        worldGen.setWorldSeed(worldSeed);%0A        worldGen.initialize();%0A%0A        ModuleManager moduleManager = CoreRegistry.get(ModuleManager.class);%0A%0A        Set%3CClass%3C? extends WorldFacet%3E%3E facets = worldGen.getWorld().getAllFacets();%0A        List%3CFacetLayer%3E loadedLayers = FacetLayers.createLayersFor(facets, moduleManager.getEnvironment());%0A%0A        Viewer viewer = new Viewer(worldGen, loadedLayers, new ViewConfig(), 100);%0A        viewer.setSize(300, 300);%0A        Graphics2D g = Mockito.mock(Graphics2D.class);%0A        viewer.paint(g);%0A    %7D%0A%7D%0A

Add unit test for Viewer