@@ -0,0 +1,2045 @@
+package org.apache.storm.flux.multilang;%0A%0A%0Aimport org.junit.Test;%0Aimport static org.junit.Assert.*;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0A%0Apublic class MultilangEnvirontmentTest%7B%0A    private static final Logger LOG = LoggerFactory.getLogger(MultilangEnvirontmentTest.class);%0A%0A    @Test%0A    public void testInvokePython() throws Exception %7B%0A        String%5B%5D command = new String%5B%5D%7B%22python%22, %22--version%22%7D;%0A        int exitVal = invokeCommand(command);%0A        assertEquals(%22Exit value for python is 0.%22, 0, exitVal);%0A    %7D%0A%0A    @Test%0A    public void testInvokeNode() throws Exception %7B%0A        String%5B%5D command = new String%5B%5D%7B%22node%22, %22--version%22%7D;%0A        int exitVal = invokeCommand(command);%0A        assertEquals(%22Exit value for node is 0.%22, 0, exitVal);%0A    %7D%0A%0A%0A    private static class StreamRedirect implements Runnable %7B%0A        private InputStream in;%0A        private OutputStream out;%0A%0A        public StreamRedirect(InputStream in, OutputStream out) %7B%0A            this.in = in;%0A            this.out = out;%0A        %7D%0A%0A        @Override%0A        public void run() %7B%0A            try %7B%0A                int i = -1;%0A                while ((i = this.in.read()) != -1) %7B%0A                    out.write(i);%0A                %7D%0A                this.in.close();%0A                this.out.close();%0A            %7D catch (Exception e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A    %7D%0A%0A%0A    private int invokeCommand(String%5B%5D args) throws Exception %7B%0A        LOG.debug(%22Invoking command: %7B%7D%22, args);%0A%0A        ProcessBuilder pb = new ProcessBuilder(args);%0A        pb.redirectErrorStream(true);%0A        final Process proc = pb.start();%0A%0A        ByteArrayOutputStream out = new ByteArrayOutputStream();%0A        Thread t = new Thread(new StreamRedirect(proc.getInputStream(), out));%0A        t.start();%0A        int exitVal = proc.waitFor();%0A        LOG.debug(%22Command result: %7B%7D%22, out.toString());%0A        return exitVal;%0A    %7D%0A%7D%0A

add basic test to make sure shell commands can be run