Skip to content

Commit

Permalink
feat: inital es6 import/export support
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluctuationqt authored and vmutafov committed Nov 2, 2021
1 parent cea00ec commit dcc989c
Show file tree
Hide file tree
Showing 8 changed files with 913 additions and 9 deletions.
Expand Up @@ -433,4 +433,34 @@ protected void runTest(IJavascriptEngineExecutor executor, IRepository repositor
System.out.println(String.format("API test [%s] on engine [%s] passed for: %d ms", testModule,
executor.getType(), time));
}

protected void runEcmaScriptTest(IJavascriptEngineExecutor executor, IRepository repository, String testModule) throws IOException, ScriptingException {

try {
InputStream in = AbstractApiSuiteTest.class.getResourceAsStream("/META-INF/dirigible/" + testModule);
try {
if (in == null) {
throw new IOException(IRepositoryStructure.SEPARATOR + testModule + " does not exist");
}
repository.createResource(
IRepositoryStructure.PATH_REGISTRY_PUBLIC + IRepositoryStructure.SEPARATOR + testModule,
IOUtils.readBytesFromStream(in));
} finally {
if (in != null) {
in.close();
}
}
} catch (RepositoryWriteException e) {
throw new IOException(IRepositoryStructure.SEPARATOR + testModule, e);
}
Object result = null;
long start = System.currentTimeMillis();
Object error = executor.executeServiceModule(testModule, null);
if (error != null && error.toString() != null) {
throw new ScriptingException(error.toString());
}
long time = System.currentTimeMillis() - start;
System.out.println(String.format("API test [%s] on engine [%s] passed for: %d ms", testModule,
executor.getType(), time));
}
}

0 comments on commit dcc989c

Please sign in to comment.