You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Vassil Zorev (Jira)" <ji...@apache.org> on 2021/05/18 19:46:00 UTC
[jira] [Issue Comment Deleted] (KARAF-6877) Itest doesn't see alias
command
[ https://issues.apache.org/jira/browse/KARAF-6877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vassil Zorev updated KARAF-6877:
--------------------------------
Comment: was deleted
(was: Sorry, didn't get it :(
{{That's what i got so far:}}
{{KarafTestSupport#private void executeInitScript(Session session) {}}
{{ // possibly all scripts in karaf.shell.init.script}}
{{ final Path initScript = Paths.get(System.getProperty("karaf.etc") + "/shell.init.script");}}
{{ try {}}
{{ String script = String.join("\n",}}
{{ Files.readAllLines(initScript));}}
{{ session.execute(script);}}
{{ } catch (Exception e) {}}
{{ System.err.println("Error in initialization script: " + e.getMessage());}}
{{ e.printStackTrace();}}
}
}
{{KarafTestSupport#public String executeAlias(String alias, final Long timeout, final Boolean silent, final Principal ... principals) (or adjust the executeCommand() method itself...)}}
{
{{ String response;}}
{{ final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();}}
{{ final PrintStream printStream = new PrintStream(byteArrayOutputStream);}}
{{ final SessionFactory sessionFactory = getOsgiService(SessionFactory.class);}}
{{ final Session session = sessionFactory.create(System.in, printStream, System.err);}}
{{ executeInitScript(session);}}
{{ String targetCommand = alias => cmd; // that's the part i don't get, how can this happen ?}}
{{ waitForCommandService(targetCommand); // is this needed here at all ? otherwise there's no need to try to get the target command above}}
{{ final Callable<String> commandCallable = () -> {}}
{{ ...}}
{{}}}
please ignore the correctness or style of this code for now..
Regards,
Vassil)
> Itest doesn't see alias command
> -------------------------------
>
> Key: KARAF-6877
> URL: https://issues.apache.org/jira/browse/KARAF-6877
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Reporter: Jean-Baptiste Onofré
> Priority: Major
>
> When executing an alias (defined in {{etc/shell.init.script}}) in an itest (using {{executeCommand()}} for instance), the command is not found.
> The alias should be loaded.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)