@@ -37,15 +37,6 @@ describe('connectionConfig tests', function() {
37
37
expect ( connectionConfig . queryURL ( ) ) . to . equal ( queryURL )
38
38
} )
39
39
40
- it ( 'check set class frameUrl' , function ( ) {
41
- const classFrameURL =
42
- 'http://localhost:6363/api/frame/admin/testDB/local/commit/gfhfjkflfgorpyuiioo'
43
-
44
- //console.log(JSON.stringify(connectionConfig.triplesURL(), null, 4));
45
-
46
- expect ( connectionConfig . classFrameURL ( ) ) . to . equal ( classFrameURL )
47
- } )
48
-
49
40
/*
50
41
* get the schema in owl turtle encoding
51
42
*/
@@ -60,31 +51,31 @@ describe('connectionConfig tests', function() {
60
51
61
52
it ( 'check remove the refCommit' , function ( ) {
62
53
const queryUrlBranch01 = 'http://localhost:6363/api/woql/admin/testDB/local/branch/myBranch'
63
- const queryFrameBranch01 = 'http://localhost:6363/api/frame/admin/testDB/local/branch/myBranch'
54
+ // const queryFrameBranch01 = 'http://localhost:6363/api/frame/admin/testDB/local/branch/myBranch'
64
55
const queryTriplesBranch01 =
65
56
'http://localhost:6363/api/triples/admin/testDB/local/branch/myBranch/schema/main'
66
57
/*
67
58
*remove the ref commit it come to the
68
59
*/
69
60
connectionConfig . setRef ( false )
70
61
expect ( connectionConfig . queryURL ( ) ) . to . equal ( queryUrlBranch01 )
71
- expect ( connectionConfig . classFrameURL ( ) ) . to . equal ( queryFrameBranch01 )
62
+ /// expect(connectionConfig.classFrameURL()).to.equal(queryFrameBranch01)
72
63
expect ( connectionConfig . triplesURL ( 'schema' ) ) . to . equal ( queryTriplesBranch01 )
73
64
74
65
//console.log(JSON.stringify(connectionConfig.queryURL(), null, 4));
75
66
} )
76
67
77
68
it ( 'check remove the branch' , function ( ) {
78
69
const queryUrlBranch01 = 'http://localhost:6363/api/woql/admin/testDB/local/branch/main'
79
- const queryFrameBranch01 = 'http://localhost:6363/api/frame/admin/testDB/local/branch/main'
70
+ // const queryFrameBranch01 = 'http://localhost:6363/api/frame/admin/testDB/local/branch/main'
80
71
const queryTriplesBranch01 =
81
72
'http://localhost:6363/api/triples/admin/testDB/local/branch/main/instance/myschemaName'
82
73
/*
83
74
*remove the ref commit it come to the
84
75
*/
85
76
connectionConfig . setBranch ( false )
86
77
expect ( connectionConfig . queryURL ( ) ) . to . equal ( queryUrlBranch01 )
87
- expect ( connectionConfig . classFrameURL ( ) ) . to . equal ( queryFrameBranch01 )
78
+ // expect(connectionConfig.classFrameURL()).to.equal(queryFrameBranch01)
88
79
expect ( connectionConfig . triplesURL ( 'instance' , 'myschemaName' ) ) . to . equal (
89
80
queryTriplesBranch01 ,
90
81
)
@@ -100,10 +91,10 @@ describe('connectionConfig tests', function() {
100
91
expect ( connectionConfig . graphURL ( 'schema' , 'main' ) ) . to . equal ( graphURL )
101
92
} )
102
93
103
- it ( 'check copy' , function ( ) {
94
+ /* it('check copy', function() {
104
95
let copy = connectionConfig.copy()
105
96
expect(connectionConfig).to.eql(copy)
106
- } )
97
+ })*/
107
98
108
99
it ( 'check update' , function ( ) {
109
100
connectionConfig . update ( { key :"hello" } )
@@ -141,7 +132,7 @@ describe('connectionConfig tests', function() {
141
132
expect ( o ) . to . equal ( construct )
142
133
} )
143
134
144
- it ( 'check roles URL' , function ( ) {
135
+ it ( 'check roles URL' , function ( ) {
145
136
let o = connectionConfig . rolesURL ( )
146
137
let construct = `${ startServerUrl } api/role`
147
138
expect ( o ) . to . equal ( construct )
@@ -233,7 +224,7 @@ describe('connectionConfig tests', function() {
233
224
} )
234
225
235
226
it ( 'check local user' , function ( ) {
236
- let o = connectionConfig . local_user ( )
227
+ let o = connectionConfig . localUser ( )
237
228
expect ( o ) . to . equal ( "john" )
238
229
} )
239
230
@@ -243,19 +234,19 @@ describe('connectionConfig tests', function() {
243
234
} )
244
235
245
236
it ( 'check parseServerURL' , function ( ) {
246
- let o = connectionConfig . parseServerURL ( "https:/adf.com/" )
247
- expect ( o ) . to . equal ( false )
237
+ const str = "https:/adf.com/"
238
+ expect ( function ( ) {
239
+ connectionConfig . parseServerURL ( str )
240
+ } ) . to . throw ( `Invalid Server URL: ${ str } ` ) ;
248
241
} )
249
242
250
243
it ( 'check clearCursor' , function ( ) {
251
244
connectionConfig . clearCursor ( )
252
- expect ( connectionConfig . db ( ) ) . to . equal ( false )
245
+ expect ( function ( ) {
246
+ connectionConfig . db ( )
247
+ } ) . to . throw ( 'Invalid database name' ) ;
253
248
} )
254
249
255
- it ( 'check setCursor' , function ( ) {
256
- connectionConfig . setCursor ( false , "abc" , "origin" )
257
- expect ( connectionConfig . db ( ) ) . to . equal ( "abc" )
258
- } )
259
250
260
251
it ( 'check setError' , function ( ) {
261
252
connectionConfig . setError ( "error 123" )
0 commit comments