Search in sources :

Example 16 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Packer method unpack.

public String unpack(String packagePath, String destination) {
    try {
        InputStream input = Context.fs().inputStream(packagePath);
        DirectoryZipper zipper = DirectoryZipper.fromZip(input);
        zipper.unzip(destination);
        return zipper.getDirectoryPath();
    } catch (Exception e) {
        throw new LimelightException("Failed to unpack production: " + packagePath, e);
    }
}
Also used : InputStream(java.io.InputStream) LimelightException(limelight.LimelightException) LimelightException(limelight.LimelightException)

Example 17 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class Xml method applyExtensions.

private static void applyExtensions(Object extensionNames, RichStyle style, Map<String, RichStyle> map, Map<String, RichStyle> extensions) {
    if (extensionNames == null)
        return;
    String[] names = extensionNames.toString().split("[ ,]+");
    for (String name : names) {
        RichStyle extension = map.get(name);
        if (extension == null)
            extension = extensions.get(name);
        if (extension == null)
            throw new LimelightException("Can't extend missing style: '" + name + "'");
        style.addExtension(extension);
    }
}
Also used : RichStyle(limelight.styles.RichStyle) LimelightException(limelight.LimelightException)

Example 18 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class PropPanel method illuminateBackstage.

private void illuminateBackstage(Object backstageObject) {
    if (backstageObject == null)
        return;
    if (!(backstageObject instanceof Map))
        throw new LimelightException("backstage must be a map, but is: " + backstageObject.getClass());
    Map backstage = (Map) backstageObject;
    getBackstage().inject(backstage);
}
Also used : LimelightException(limelight.LimelightException)

Example 19 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class ScenePanelTest method duplicateIdsCausesAnError.

@Test
public void duplicateIdsCausesAnError() throws Exception {
    setupIlluminatedScene();
    PropPanel prop1 = new PropPanel(new FakePropProxy(), Util.toMap("id", "some id"));
    PropPanel prop2 = new PropPanel(new FakePropProxy(), Util.toMap("id", "some id"));
    root.add(prop1);
    try {
        root.add(prop2);
        fail("Should have raised error");
    } catch (LimelightException e) {
        assertEquals("Duplicate id: some id", e.getMessage());
    }
}
Also used : FakePropProxy(limelight.model.api.FakePropProxy) LimelightException(limelight.LimelightException) Test(org.junit.Test)

Example 20 with LimelightException

use of limelight.LimelightException in project limelight by slagyr.

the class TheaterTest method doesNotAllowDuplicateNames.

@Test
public void doesNotAllowDuplicateNames() throws Exception {
    MockStage stage2 = new MockStage("default");
    theater.add(defaultStage);
    try {
        theater.add(stage2);
        fail("should throw error");
    } catch (LimelightException e) {
        assertEquals("Duplicate stage name: 'default'", e.getMessage());
    }
}
Also used : MockStage(limelight.ui.model.MockStage) LimelightException(limelight.LimelightException) Test(org.junit.Test)

Aggregations

LimelightException (limelight.LimelightException)20 Test (org.junit.Test)2 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Method (java.lang.reflect.Method)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 ZipOutputStream (java.util.zip.ZipOutputStream)1 FakePropProxy (limelight.model.api.FakePropProxy)1 RichStyle (limelight.styles.RichStyle)1 Style (limelight.styles.Style)1 AutoDimensionValue (limelight.styles.values.AutoDimensionValue)1 GreedyDimensionValue (limelight.styles.values.GreedyDimensionValue)1 MockStage (limelight.ui.model.MockStage)1 Box (limelight.util.Box)1