use of com.twosigma.beakerx.kernel.magic.command.functionality.ClassPathAddMvnCellMagicCommand in project beakerx by twosigma.
the class KernelTest method initMagicCommands.
private void initMagicCommands() {
this.magicCommandTypes = new ArrayList<>();
this.magicCommandTypes.addAll(Lists.newArrayList(new MagicCommandType(JavaScriptMagicCommand.JAVASCRIPT, "", new JavaScriptMagicCommand()), new MagicCommandType(JSMagicCommand.JAVASCRIPT, "", new JSMagicCommand()), new MagicCommandType(HtmlMagicCommand.HTML, "", new HtmlMagicCommand()), new MagicCommandType(HtmlAliasMagicCommand.HTML, "", new HtmlAliasMagicCommand()), new MagicCommandType(BashMagicCommand.BASH, "", new BashMagicCommand()), new MagicCommandType(LsMagicCommand.LSMAGIC, "", new LsMagicCommand(this.magicCommandTypes)), new MagicCommandType(ClasspathAddRepoMagicCommand.CLASSPATH_CONFIG_RESOLVER, "repoName repoURL", new ClasspathAddRepoMagicCommand(this)), new MagicCommandType(ClasspathAddJarMagicCommand.CLASSPATH_ADD_JAR, "<jar path>", new ClasspathAddJarMagicCommand(this)), new MagicCommandType(ClasspathAddMvnMagicCommand.CLASSPATH_ADD_MVN, "<group name version>", new ClasspathAddMvnMagicCommand(mavenResolverParam, this)), new MagicCommandType(ClassPathAddMvnCellMagicCommand.CLASSPATH_ADD_MVN_CELL, "<group name version>", new ClassPathAddMvnCellMagicCommand(mavenResolverParam, this)), addClasspathReset(this), addDynamic(this), addMagicCommandWhichThrowsException(), new MagicCommandType(ClasspathShowMagicCommand.CLASSPATH_SHOW, "", new ClasspathShowMagicCommand(this)), new MagicCommandType(AddStaticImportMagicCommand.ADD_STATIC_IMPORT, "<classpath>", new AddStaticImportMagicCommand(this)), new MagicCommandType(AddImportMagicCommand.IMPORT, "<classpath>", new AddImportMagicCommand(this)), new MagicCommandType(UnImportMagicCommand.UNIMPORT, "<classpath>", new UnImportMagicCommand(this)), new MagicCommandType(TimeLineModeMagicCommand.TIME_LINE, "", new TimeLineModeMagicCommand(this)), new MagicCommandType(TimeCellModeMagicCommand.TIME_CELL, "", new TimeCellModeMagicCommand(this)), new MagicCommandType(TimeItLineModeMagicCommand.TIMEIT_LINE, "", new TimeItLineModeMagicCommand(this)), new MagicCommandType(TimeItCellModeMagicCommand.TIMEIT_CELL, "", new TimeItCellModeMagicCommand(this)), new MagicCommandType(LoadMagicMagicCommand.LOAD_MAGIC, "", new LoadMagicMagicCommand(this))));
}
use of com.twosigma.beakerx.kernel.magic.command.functionality.ClassPathAddMvnCellMagicCommand in project beakerx by twosigma.
the class ClasspathAddMvnDepsCellMagicCommandTest method handleUnresolvedDep.
@Test
public void handleUnresolvedDep() throws Exception {
String allCode = "%%classpath add mvn\n" + "com.google.code.XXXX:gson:2.6.2";
// given
MagicCommand command = new MagicCommand(new ClassPathAddMvnCellMagicCommand(kernel.mavenResolverParam, kernel), allCode);
Code code = Code.createCode(allCode, Collections.singletonList(command), NO_ERRORS, new Message());
// when
code.execute(kernel, 1);
// then
List<Message> stderr = EvaluatorResultTestWatcher.getStderr(kernel.getPublishedMessages());
String text = (String) stderr.get(0).getContent().get("text");
Assertions.assertThat(text).contains("Could not resolve dependencies for:");
Assertions.assertThat(text).contains("com.google.code.XXXX : gson : 2.6.2");
}
use of com.twosigma.beakerx.kernel.magic.command.functionality.ClassPathAddMvnCellMagicCommand in project beakerx by twosigma.
the class ClasspathAddMvnDepsCellMagicCommandTest method processMagicCommand.
private void processMagicCommand(String allCode) {
MagicCommand command = new MagicCommand(new ClassPathAddMvnCellMagicCommand(kernel.mavenResolverParam, kernel), allCode);
Code code = Code.createCode(allCode, Collections.singletonList(command), NO_ERRORS, new Message());
code.execute(kernel, 1);
}
Aggregations