Search in sources :

Example 1 with Globals

use of com.teradata.jaqy.Globals in project jaqy by Teradata.

the class ExportCommand method getLongDescription.

@Override
public String getLongDescription() {
    Globals globals = getGlobals();
    StringBuffer buffer = new StringBuffer();
    buffer.append("usage: " + getCommand() + " [type] [type options] [path]\ntype:");
    String[] names = globals.getExporterManager().getNames();
    for (String name : names) buffer.append("\n  ").append(name);
    buffer.append("\n");
    for (String name : names) {
        String syntax = globals.getExporterManager().getHandlerFactory(name).getLongDescription();
        if (syntax != null)
            buffer.append('\n').append(syntax);
    }
    return buffer.toString();
}
Also used : Globals(com.teradata.jaqy.Globals)

Example 2 with Globals

use of com.teradata.jaqy.Globals in project jaqy by Teradata.

the class FormatCommand method getLongDescription.

@Override
public String getLongDescription() {
    Globals globals = getGlobals();
    StringBuffer buffer = new StringBuffer();
    buffer.append("usage: " + getCommand() + " [type] [type options]\ntype:");
    String[] names = globals.getPrinterManager().getNames();
    for (String name : names) buffer.append("\n  ").append(name);
    buffer.append("\n");
    for (String name : names) {
        String syntax = globals.getPrinterManager().getHandlerFactory(name).getLongDescription();
        if (syntax != null)
            buffer.append('\n').append(syntax);
    }
    return buffer.toString();
}
Also used : Globals(com.teradata.jaqy.Globals)

Example 3 with Globals

use of com.teradata.jaqy.Globals in project jaqy by Teradata.

the class DebugCommand method execute.

@Override
public void execute(String[] args, boolean silent, JaqyInterpreter interpreter) {
    Globals globals = interpreter.getGlobals();
    if (args.length == 0) {
        interpreter.println(getCurrentOptions(globals, interpreter));
        return;
    }
    if (args.length < 2) {
        interpreter.error("error parsing argument.");
    }
    DebugOptionHandler handler = m_optionMap.get(args[0]);
    if (handler == null) {
        interpreter.error("Unknown debug option: " + args[0]);
    }
    handler.handleOption(globals, interpreter, StringUtils.shiftArgs(args));
}
Also used : Globals(com.teradata.jaqy.Globals)

Example 4 with Globals

use of com.teradata.jaqy.Globals in project jaqy by Teradata.

the class S3PathHandlerTest method test2.

@Test(expected = IllegalArgumentException.class)
public void test2() throws Exception {
    Globals globals = new Globals();
    JaqyInterpreter interpreter = new JaqyInterpreter(globals, null, null);
    S3PathHandler handler = new S3PathHandler();
    handler.getPath("s3", interpreter);
}
Also used : Globals(com.teradata.jaqy.Globals) JaqyInterpreter(com.teradata.jaqy.JaqyInterpreter) Test(org.junit.Test)

Example 5 with Globals

use of com.teradata.jaqy.Globals in project jaqy by Teradata.

the class WhereParserTest method test3.

@Test
public void test3() throws Exception {
    Globals globals = new Globals();
    JaqyInterpreter interpreter = new JaqyInterpreter(globals, null, null);
    VariableManager vm = interpreter.getVariableManager();
    ExpNode exp;
    exp = WhereParser.getExp("1 is NULL");
    exp.bind(null, vm, interpreter);
    Assert.assertFalse((Boolean) exp.get());
    exp = WhereParser.getExp("1 is not NULL");
    exp.bind(null, vm, interpreter);
    Assert.assertTrue((Boolean) exp.get());
}
Also used : Globals(com.teradata.jaqy.Globals) VariableManager(com.teradata.jaqy.VariableManager) JaqyInterpreter(com.teradata.jaqy.JaqyInterpreter) ExpNode(com.teradata.jaqy.utils.exp.ExpNode) Test(org.junit.Test)

Aggregations

Globals (com.teradata.jaqy.Globals)11 JaqyInterpreter (com.teradata.jaqy.JaqyInterpreter)6 Test (org.junit.Test)6 VariableManager (com.teradata.jaqy.VariableManager)4 ExpNode (com.teradata.jaqy.utils.exp.ExpNode)4 ActorSystem (akka.actor.ActorSystem)1 AwsClientBuilder (com.amazonaws.client.builder.AwsClientBuilder)1 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 AmazonS3ClientBuilder (com.amazonaws.services.s3.AmazonS3ClientBuilder)1 S3Mock (io.findify.s3mock.S3Mock)1 InMemoryProvider (io.findify.s3mock.provider.InMemoryProvider)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1