Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
lucas.parsy
jio
Commits
0b8d4e96
Commit
0b8d4e96
authored
Dec 28, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jiotests tools updated
parent
f19a4f95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
20 deletions
+44
-20
test/jiotests.js
test/jiotests.js
+42
-20
test/jiotests_withoutrequirejs.html
test/jiotests_withoutrequirejs.html
+2
-0
No files found.
test/jiotests.js
View file @
0b8d4e96
...
...
@@ -123,30 +123,44 @@ generateTools = function (sinon) {
o
.
clock
.
tick
(
base_tick
);
o
.
spy
=
basicSpyFunction
;
o
.
tick
=
basicTickFunction
;
// test methods
o
.
testLastJobLabel
=
function
(
label
,
mess
)
{
deepEqual
(
getLastJob
(
o
.
jio
.
getId
()).
command
.
label
,
label
,
mess
);
var
lastjob
=
getLastJob
(
o
.
jio
.
getId
());
if
(
lastjob
)
{
deepEqual
(
lastjob
.
command
.
label
,
label
,
mess
);
}
else
{
deepEqual
(
"
No job on the queue
"
,
"
Job with label:
"
+
label
,
mess
);
}
};
o
.
testLastJobId
=
function
(
id
,
mess
)
{
deepEqual
(
getLastJob
(
o
.
jio
.
getId
()).
id
,
id
,
mess
);
var
lastjob
=
getLastJob
(
o
.
jio
.
getId
());
if
(
lastjob
)
{
deepEqual
(
lastjob
.
id
,
id
,
mess
);
}
else
{
deepEqual
(
"
No job on the queue
"
,
"
Job with id:
"
+
id
,
mess
);
}
};
o
.
testLastJobWaitForTime
=
function
(
mess
)
{
ok
(
getLastJob
(
o
.
jio
.
getId
()).
status
.
waitfortime
>
0
,
mess
);
var
lastjob
=
getLastJob
(
o
.
jio
.
getId
());
if
(
lastjob
)
{
ok
(
lastjob
.
status
.
waitfortime
>
0
,
mess
);
}
else
{
deepEqual
(
"
No job on the queue
"
,
"
Job waiting for time
"
,
mess
);
}
};
o
.
testLastJobWaitForJob
=
function
(
job_id_array
,
mess
)
{
deepEqual
(
getLastJob
(
o
.
jio
.
getId
()).
status
.
waitforjob
,
job_id_array
,
mess
);
var
lastjob
=
getLastJob
(
o
.
jio
.
getId
());
if
(
lastjob
)
{
deepEqual
(
lastjob
.
status
.
waitforjob
,
job_id_array
,
mess
);
}
else
{
deepEqual
(
"
No job on the queue
"
,
"
Job waiting for:
"
+
JSON
.
stringify
(
job_id_array
),
mess
);
}
};
// wait method
o
.
waitUntilAJobExists
=
function
(
timeout
)
{
var
cpt
=
0
while
(
true
)
{
...
...
@@ -154,7 +168,7 @@ generateTools = function (sinon) {
break
;
}
if
(
timeout
>=
cpt
)
{
ok
(
false
,
"
no job
added to the queue
"
);
ok
(
false
,
"
No job were
added to the queue
"
);
break
;
}
o
.
clock
.
tick
(
25
);
...
...
@@ -164,7 +178,7 @@ generateTools = function (sinon) {
o
.
waitUntilLastJobIs
=
function
(
state
)
{
while
(
true
)
{
if
(
getLastJob
(
o
.
jio
.
getId
())
===
undefined
)
{
ok
(
false
,
"
a job is never called
"
);
ok
(
false
,
"
No job have state:
"
+
state
);
break
;
}
if
(
getLastJob
(
o
.
jio
.
getId
()).
status
.
label
===
state
)
{
...
...
@@ -174,10 +188,18 @@ generateTools = function (sinon) {
}
};
return
o
;
}
;
}
,
//// end tools
//// test methods ////
//// test function
isUuid
=
function
(
uuid
)
{
var
x
=
"
[0-9a-fA-F]{4}
"
;
if
(
typeof
uuid
!==
"
string
"
)
{
return
false
;
}
return
uuid
.
match
(
"
^
"
+
x
+
x
+
"
-
"
+
x
+
"
-
"
+
x
+
"
-
"
+
x
+
"
-
"
+
x
+
x
+
x
+
"
$
"
)
===
null
?
false
:
true
;
};
//// QUnit Tests ////
module
(
'
Jio Global tests
'
);
...
...
test/jiotests_withoutrequirejs.html
View file @
0b8d4e96
...
...
@@ -21,6 +21,8 @@
<script
type=
"text/javascript"
src=
"../lib/jsSha2/sha2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.dummystorages.js"
></script>
<script
type=
"text/javascript"
src=
"../jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/revisionstorage.js"
>
</script>
<script
type=
"text/javascript"
src=
"./jiotests.js"
></script>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment