Skip to content
Permalink
Browse files
fixed test suite and small refactor
  • Loading branch information
hufeng committed Jul 3, 2018
1 parent 2f548c2 commit 3c8daaa55a87d9b1e1ae3cc4f385816f8b391126
Showing 3 changed files with 9 additions and 11 deletions.
@@ -23,6 +23,7 @@ import {ErrorProvider} from './providers/com/alibaba/dubbo/demo/ErrorProvider';
import {TypeRequest} from './providers/com/alibaba/dubbo/demo/TypeRequest';
import {UserRequest} from './providers/com/alibaba/dubbo/demo/UserRequest';

//==============init dubbo==============
const service = {
BasicTypeProvider,
DemoProvider,
@@ -66,11 +67,9 @@ dubbo.subscribe({
},
});

//=====demoservice==========
describe('demoService', () => {
it('test sayHello', async () => {
await dubbo.ready();

// @ts-ignore
const {res, err} = await dubbo.service.DemoProvider.sayHello(
java.String('node'),
);
@@ -121,11 +120,9 @@ describe('typeBasicServer', () => {
});
});

const errorService = ErrorProvider(dubbo);

describe('error test', () => {
it('test errorTest', async () => {
const {res, err} = await errorService.errorTest();
const {res, err} = await dubbo.service.ErrorProvider.errorTest();
expect(err != null).toEqual(true);
expect(res == null).toEqual(true);
});
@@ -41,5 +41,6 @@ export const toBytes8 = (num: number) => {
export const fromBytes8 = (buf: Buffer) => {
const high = buf.readUInt32BE(0);
const low = buf.readUInt32BE(4);
return high * Math.pow(2, 32) + low;
//Math.pow(2, 32) = 4294967296
return high * 4294967296 + low;
};
@@ -21,10 +21,10 @@ import zookeeper from 'node-zookeeper-client';
import qs from 'querystring';
import Context from './context';
import DubboUrl from './dubbo-url';
import { ZookeeperDisconnectedError, ZookeeperTimeoutError } from './err';
import { to } from './to';
import { IObservable, IZkClientProps, IZookeeperSubscriber } from './types';
import { isDevEnv, msg, noop, traceErr, traceInfo } from './util';
import {ZookeeperDisconnectedError, ZookeeperTimeoutError} from './err';
import {to} from './to';
import {IObservable, IZkClientProps, IZookeeperSubscriber} from './types';
import {isDevEnv, msg, noop, traceErr, traceInfo} from './util';

const log = debug('dubbo:zookeeper');
const ipAddress = ip.address();

0 comments on commit 3c8daaa

Please sign in to comment.