Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
fixed tests for cloud wallet addition and assed options field to a Pl…
Browse files Browse the repository at this point in the history
…aceOrderEvent (#150)

Signed-off-by: awjh-ibm <[email protected]>
  • Loading branch information
awjh-ibm authored and cazfletch committed Mar 1, 2018
1 parent 20b334b commit 96fd131
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
],
"author": "Hyperledger Composer",
"license": "Apache-2.0"
}
}
4 changes: 2 additions & 2 deletions packages/animaltracking-network/test/mozart.cto.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');
const Util = require('./util');

Expand All @@ -26,7 +26,7 @@ require('chai').should();

describe('Animal Tracking Network', function() {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );

let adminConnection;
let businessNetworkConnection;
Expand Down
4 changes: 2 additions & 2 deletions packages/basic-sample-network/test/sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

const chai = require('chai');
Expand All @@ -25,7 +25,7 @@ chai.use(require('chai-as-promised'));

describe('Sample', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );

// Embedded connection used for local testing
const connectionProfile = {
Expand Down
4 changes: 2 additions & 2 deletions packages/bond-network/test/Bond.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();
Expand All @@ -25,7 +25,7 @@ const namespace = 'org.acme.bond';

describe('Publish Bond', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;

Expand Down
4 changes: 2 additions & 2 deletions packages/carauction-network/test/CarAuction.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();
Expand All @@ -25,7 +25,7 @@ const NS = 'org.acme.vehicle.auction';

describe('CarAuction', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;

Expand Down
4 changes: 2 additions & 2 deletions packages/digitalproperty-network/test/DigitalLandTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();

describe('DigitalLandTitle', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;

Expand Down
4 changes: 2 additions & 2 deletions packages/marbles-network/test/MarblesTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();
Expand All @@ -25,7 +25,7 @@ const namespace = 'org.hyperledger_composer.marbles';

describe('Marbles', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;

Expand Down
4 changes: 2 additions & 2 deletions packages/perishable-network/test/perishable.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();
Expand All @@ -28,7 +28,7 @@ let importer_id = '[email protected]';

describe('Perishable Shipping Network', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;
let factory;
Expand Down
4 changes: 2 additions & 2 deletions packages/pii-network/test/pii.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();
Expand All @@ -25,7 +25,7 @@ const namespace = 'org.acme.pii';

describe('Acl checking', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );

// Embedded connection used for local testing
const connectionProfile = {
Expand Down
4 changes: 2 additions & 2 deletions packages/trade-network/test/trading.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

require('chai').should();
Expand All @@ -25,7 +25,7 @@ const namespace = 'org.acme.trading';

describe('Commodity Trading', () => {
// In-memory card store for testing so cards are not persisted to the file system
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;

Expand Down
4 changes: 2 additions & 2 deletions packages/vehicle-lifecycle-network/test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

const NS = 'org.acme.vehicle.lifecycle';
const NS_M = 'org.acme.vehicle.lifecycle.manufacturer';
const NS_D = 'org.vda';

const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
const adminCardName = 'admin';

let adminConnection;
Expand Down
1 change: 1 addition & 0 deletions packages/vehicle-manufacture-network/lib/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async function placeOrder(orderRequest) { // eslint-disable-line no-unused-vars
const placeOrderEvent = factory.newEvent(namespace, 'PlaceOrderEvent');
placeOrderEvent.orderId = order.orderId;
placeOrderEvent.vehicleDetails = order.vehicleDetails;
placeOrderEvent.options = order.options;
placeOrderEvent.orderer = order.orderer;
emit(placeOrderEvent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ transaction PlaceOrder {
event PlaceOrderEvent {
o String orderId
o VehicleDetails vehicleDetails
o Options options
--> Person orderer
}

Expand Down
4 changes: 2 additions & 2 deletions packages/vehicle-manufacture-network/test/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const AdminConnection = require('composer-admin').AdminConnection;
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
const { BusinessNetworkDefinition, CertificateUtil, IdCard, MemoryCardStore } = require('composer-common');
const { BusinessNetworkDefinition, CertificateUtil, IdCard } = require('composer-common');
const path = require('path');

const chai = require('chai');
Expand All @@ -28,7 +28,7 @@ const orderId = '1000-1000-1000-1000';
const vin = '1a2b3c4d5e6f7g8h9';

describe('Manufacture network', () => {
const cardStore = new MemoryCardStore();
const cardStore = require('composer-common').NetworkCardStoreManager.getCardStore( { type: 'composer-wallet-inmemory' } );
let adminConnection;
let businessNetworkConnection;
let factory;
Expand Down

0 comments on commit 96fd131

Please sign in to comment.