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);
}
}
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);
}
}
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);
}
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());
}
}
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());
}
}
Aggregations