Search in sources :

Example 1 with KarafParser

use of org.apache.karaf.shell.impl.console.parsing.KarafParser in project karaf by apache.

the class ActionMaskingCallbackTest method setUp.

@Before
public void setUp() {
    ThreadIO tio = new ThreadIOImpl();
    CommandProcessor cp = new CommandProcessorImpl(tio);
    SessionFactory sf = new SessionFactoryImpl(tio);
    InputStream is = new ByteArrayInputStream(new byte[0]);
    PrintStream os = new PrintStream(new ByteArrayOutputStream());
    Session session = new HeadlessSessionImpl(sf, cp, is, os, os);
    parser = new KarafParser(session);
    ActionCommand cmd = new ActionCommand(null, UserAddCommand.class);
    cb = ActionMaskingCallback.build(cmd);
}
Also used : ThreadIO(org.apache.felix.service.threadio.ThreadIO) SessionFactory(org.apache.karaf.shell.api.console.SessionFactory) PrintStream(java.io.PrintStream) HeadlessSessionImpl(org.apache.karaf.shell.impl.console.HeadlessSessionImpl) ThreadIOImpl(org.apache.felix.gogo.runtime.threadio.ThreadIOImpl) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) CommandProcessorImpl(org.apache.felix.gogo.runtime.CommandProcessorImpl) ByteArrayOutputStream(java.io.ByteArrayOutputStream) KarafParser(org.apache.karaf.shell.impl.console.parsing.KarafParser) ByteArrayInputStream(java.io.ByteArrayInputStream) CommandProcessor(org.apache.felix.service.command.CommandProcessor) SessionFactoryImpl(org.apache.karaf.shell.impl.console.SessionFactoryImpl) Session(org.apache.karaf.shell.api.console.Session) Before(org.junit.Before)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 PrintStream (java.io.PrintStream)1 CommandProcessorImpl (org.apache.felix.gogo.runtime.CommandProcessorImpl)1 ThreadIOImpl (org.apache.felix.gogo.runtime.threadio.ThreadIOImpl)1 CommandProcessor (org.apache.felix.service.command.CommandProcessor)1 ThreadIO (org.apache.felix.service.threadio.ThreadIO)1 Session (org.apache.karaf.shell.api.console.Session)1 SessionFactory (org.apache.karaf.shell.api.console.SessionFactory)1 HeadlessSessionImpl (org.apache.karaf.shell.impl.console.HeadlessSessionImpl)1 SessionFactoryImpl (org.apache.karaf.shell.impl.console.SessionFactoryImpl)1 KarafParser (org.apache.karaf.shell.impl.console.parsing.KarafParser)1 Before (org.junit.Before)1