@@ -2,15 +2,15 @@ const { expect } = require('chai');
22const ConnectionConfig = require ( '../lib/connectionConfig' ) ;
33
44describe ( 'connectionConfig tests' , ( ) => {
5- const startServerUrl = 'http://localhost :6363/' ;
5+ const startServerUrl = 'http://127.0.0.1 :6363/' ;
66 const startDBid = 'testDB' ;
77 const organization = 'admin' ;
88 const params = {
99 db : startDBid , organization, user : organization , key : 'myKey' ,
1010 } ;
1111 const connectionConfig = new ConnectionConfig ( startServerUrl , params ) ;
1212
13- const dbURL = 'http://localhost :6363/api/db/admin/testDB' ;
13+ const dbURL = 'http://127.0.0.1 :6363/api/db/admin/testDB' ;
1414
1515 it ( 'check get server URL' , ( ) => {
1616 expect ( connectionConfig . serverURL ( ) ) . to . equal ( startServerUrl ) ;
@@ -22,7 +22,7 @@ describe('connectionConfig tests', () => {
2222
2323 it ( 'check set branch' , ( ) => {
2424 connectionConfig . setBranch ( 'myBranch' ) ;
25- const queryURLBranch = 'http://localhost:6363/ api/woql/admin/testDB/local/branch/myBranch' ;
25+ const queryURLBranch = ` ${ startServerUrl } api/woql/admin/testDB/local/branch/myBranch` ;
2626 /*
2727 * the dbURL dosen't change
2828 */
@@ -33,7 +33,7 @@ describe('connectionConfig tests', () => {
3333 it ( 'check set refId' , ( ) => {
3434 connectionConfig . setRef ( 'gfhfjkflfgorpyuiioo' ) ;
3535
36- const queryURL = 'http://localhost:6363/ api/woql/admin/testDB/local/commit/gfhfjkflfgorpyuiioo' ;
36+ const queryURL = ` ${ startServerUrl } api/woql/admin/testDB/local/commit/gfhfjkflfgorpyuiioo` ;
3737
3838 expect ( connectionConfig . queryURL ( ) ) . to . equal ( queryURL ) ;
3939 } ) ;
@@ -42,17 +42,17 @@ describe('connectionConfig tests', () => {
4242 * get the schema in owl turtle encoding
4343 */
4444 it ( 'check set class tripleUrl' , ( ) => {
45- const classTripleURL = 'http://localhost:6363/ api/triples/admin/testDB/local/commit/gfhfjkflfgorpyuiioo/schema/main' ;
45+ const classTripleURL = ` ${ startServerUrl } api/triples/admin/testDB/local/commit/gfhfjkflfgorpyuiioo/schema/main` ;
4646
4747 // console.log(JSON.stringify(connectionConfig.triplesURL(), null, 4));
4848
4949 expect ( connectionConfig . triplesURL ( 'schema' ) ) . to . equal ( classTripleURL ) ;
5050 } ) ;
5151
5252 it ( 'check remove the refCommit' , ( ) => {
53- const queryUrlBranch01 = 'http://localhost:6363/ api/woql/admin/testDB/local/branch/myBranch' ;
54- // const queryFrameBranch01 = 'http://localhost:6363/ api/frame/admin/testDB/local/branch/myBranch'
55- const queryTriplesBranch01 = 'http://localhost:6363/ api/triples/admin/testDB/local/branch/myBranch/schema/main' ;
53+ const queryUrlBranch01 = ` ${ startServerUrl } api/woql/admin/testDB/local/branch/myBranch` ;
54+ // const queryFrameBranch01 = `${startServerUrl} api/frame/admin/testDB/local/branch/myBranch`
55+ const queryTriplesBranch01 = ` ${ startServerUrl } api/triples/admin/testDB/local/branch/myBranch/schema/main` ;
5656 /*
5757 *remove the ref commit it come to the
5858 */
@@ -65,17 +65,17 @@ describe('connectionConfig tests', () => {
6565 } ) ;
6666
6767 it ( 'check set branch' , ( ) => {
68- const optimizeUrl = 'http://localhost:6363/ api/optimize/admin/testDB/local/branch/%23%23branch01' ;
68+ const optimizeUrl = ` ${ startServerUrl } api/optimize/admin/testDB/local/branch/%23%23branch01` ;
6969 /*
7070 * the dbURL dosen't change
7171 */
7272 expect ( connectionConfig . optimizeBranchUrl ( '##branch01' ) ) . to . equal ( optimizeUrl ) ;
7373 } ) ;
7474
7575 it ( 'check remove the branch' , ( ) => {
76- const queryUrlBranch01 = 'http://localhost:6363/ api/woql/admin/testDB/local/branch/main' ;
77- // const queryFrameBranch01 = 'http://localhost:6363/ api/frame/admin/testDB/local/branch/main'
78- const queryTriplesBranch01 = 'http://localhost:6363/ api/triples/admin/testDB/local/branch/main/instance/main' ;
76+ const queryUrlBranch01 = ` ${ startServerUrl } api/woql/admin/testDB/local/branch/main` ;
77+ // const queryFrameBranch01 = `${startServerUrl} api/frame/admin/testDB/local/branch/main`
78+ const queryTriplesBranch01 = ` ${ startServerUrl } api/triples/admin/testDB/local/branch/main/instance/main` ;
7979 /*
8080 *remove the ref commit it come to the
8181 */
@@ -269,7 +269,7 @@ describe('connectionConfig tests', () => {
269269 it ( 'check baseUrlEncode' , function ( ) {
270270 const db = "%6277&ˆˆˆ@ˆˆWˆTWTET#Y@&&GHHSHHS"
271271 connectionConfig . setDB ( db )
272- const dbBase = 'http://localhost:6363/ api/woql/123/%256277%26%CB%86%CB%86%CB%86@%CB%86%CB%86W%CB%86TWTET%23Y@%26%26GHHSHHS'
272+ const dbBase = ` ${ startServerUrl } api/woql/123/%256277%26%CB%86%CB%86%CB%86@%CB%86%CB%86W%CB%86TWTET%23Y@%26%26GHHSHHS` ;
273273 expect ( connectionConfig . dbBase ( 'woql' ) ) . to . equal ( dbBase )
274274 expect ( connectionConfig . db ( ) ) . to . equal ( db )
275275
@@ -296,7 +296,7 @@ describe('connectionConfig tests', () => {
296296
297297 //serverUrlEncoding
298298
299- //const startServerUrl = 'http://localhost :6363/'
299+ //const startServerUrl = 'http://127.0.0.1 :6363/'
300300 //const startDBid = 'testDB'
301301 //const organization = 'admin'
302302
0 commit comments