Commit 7e9f3378 authored by Kumquat Orange's avatar Kumquat Orange Committed by calocedre TAC
Browse files

gestion decode java

parent e0b4af07
......@@ -55,6 +55,7 @@ testjs:
- cd CLEA-lib/js
- pwd || true
- cp ../java/target/clea-crypto-0.0.1-SNAPSHOT-jar-with-dependencies.jar ./clea-crypto.jar
- java -cp ./clea-crypto.jar fr.inria.clea.lsp.LspEncoderDecoder decode || true
- export CHROME_BIN=chromium
- export FIREFOX_BIN=firefox-esr
- npm install
......
......@@ -10,6 +10,7 @@ csv({noheader: true,
cryptoList = jsonObj;
})
setTimeout(function() {
describe('test suite for crypto', function () {
......@@ -18,25 +19,26 @@ setTimeout(function() {
it('test on [' + cryptoItem.browser + '] with ' + cryptoItem.staff + ' ' + cryptoItem.CRIexp + ' ' + cryptoItem.venueType + ' ' + cryptoItem.venueCategory1
+ ' ' + cryptoItem.venueCategory2 + ' ' + cryptoItem.countryCode + ' ' + cryptoItem.periodDuration , async () => {
await new Promise((resolve) => {
let result;
console.log(process.cwd());
const javaproc = spawn('java', ['-cp',
'./clea-crypto.jar ',
let result = '';
let javadir = process.cwd();
console.log(javadir);
const javaproc = spawn('java', ['-cp', javadir+'/clea-crypto.jar',
'fr.inria.clea.lsp.LspEncoderDecoder', 'decode',
cryptoItem.result,
cryptoItem.sk_l,
cryptoItem.pk_sa],
{cwd: process.cwd()});
cryptoItem.pk_sa]);
javaproc.stdout.on('data', (data) => {
console.log(data.toString());
result = data.toString().trim().split(' ');
//assert.isTrue(true);
let str = data.toString().replace(/(\r\n|\n|\r)/gm, "").trim();
if (str && str.length > 0 ) {
result = str.split(' ');
}
});
javaproc.stderr.on('data', (data) => {
console.error(data.toString());
//assert.isTrue(false);
});
javaproc.on('exit', (code) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment