Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/mkws
authorMike Taylor <mike@indexdata.com>
Wed, 5 Nov 2014 15:42:42 +0000 (15:42 +0000)
committerMike Taylor <mike@indexdata.com>
Wed, 5 Nov 2014 15:42:42 +0000 (15:42 +0000)
test/Makefile
test/bin/bomb.pl
test/spec-dev/async.spec.js [new file with mode: 0644]
test/spec/async.spec.js [deleted file]
test/spec/mkws-pazpar2.js

index 1f6060c..e3fa61a 100644 (file)
@@ -128,7 +128,7 @@ help:
        @echo "Examples: "
        @echo ""
        @echo "make phantomjs PHANTOMJS_PATH=${PHANTOMJS_PATH}"
-       @echo "DEBUG=0 APACHE_PORT=5050 make -s phantomjs PHANTOMJS_TIMEOUT=12 PHANTOMJS_PATH=${PHANTOMJS_PATH}"
+       @echo "DEBUG=0 APACHE_PORT=5050 make -s phantomjs PHANTOMJS_TIMEOUT=16 PHANTOMJS_PATH=${PHANTOMJS_PATH}"
        @echo "DEBUG=2 make phantomjs PHANTOMJS_TIMEOUT=12 PHANTOMJS_URL=${PHANTOMJS_URL}"
        @echo ""
        @echo "make APACHE_PORT=5050 apache-start"
index 6e1ae1e..94f5c8d 100755 (executable)
@@ -56,6 +56,9 @@ if ($@) {
 $SIG{ALRM} = sub {
     my $pgid = getpgrp();
 
+    warn "Alarm handler got called after $timeout seconds\n";
+    warn "Kill now the process group...\n\n";
+
     # kill process group
     kill "INT", -$pgid;
 };
diff --git a/test/spec-dev/async.spec.js b/test/spec-dev/async.spec.js
new file mode 100644 (file)
index 0000000..6de372d
--- /dev/null
@@ -0,0 +1,85 @@
+/* Copyright (c) 2013 Index Data ApS. http://indexdata.com
+ *
+ * async check
+ *
+ */
+describe("Asynchronous check", function () {
+    it("contains spec with an expectation", function () {
+        expect(true).toBe(true);
+    });
+
+    // Asynchronous part
+    it("simple check", function () {
+        var max_time = 1;
+        var timer = 0;
+
+        function found(time, none) {
+            setTimeout(function () {
+                timer = time;
+            }, time * 1000);
+            expect(time >= 0).toBeTruthy();
+        }
+
+        runs(function () {
+            // check hit counter after N seconds
+            found(0, true);
+            found(0.2);
+            found(0.4);
+            found(0.5);
+            found(0.7);
+            found(max_time);
+        });
+
+        waitsFor(function () {
+            // console.log("waits for ... " + timer);
+            return timer == max_time ? true : false;
+        }, "The Value should be N seconds", max_time * 1000);
+
+        runs(function () {
+            expect(timer).toEqual(max_time);
+        });
+    });
+
+
+    it("double async check", function () {
+        var max_time = 0.5;
+        var timer = 0;
+
+        function found(time, none) {
+            setTimeout(function () {
+                timer = time;
+            }, time * 1000);
+            expect(time >= 0).toBeTruthy();
+        }
+
+        runs(function () {
+            found(0);
+            found(0.2);
+            found(max_time - 0.1);
+        });
+
+        waitsFor(function () {
+            return timer == max_time - 0.1 ? true : false;
+        }, "The Value should be N seconds", max_time * 1000);
+
+        runs(function () {
+            expect(timer <= max_time).toBeTruthy();
+        });
+
+        timer = 0;
+        runs(function () {
+            found(0.1);
+            found(max_time);
+        });
+
+        waitsFor(function () {
+            // console.log("waits for ... " + timer);
+            return timer == max_time ? true : false;
+        }, "The Value should be N seconds", max_time * 1000);
+
+        runs(function () {
+            expect(timer <= max_time).toBeTruthy();
+        });
+    });
+
+});
diff --git a/test/spec/async.spec.js b/test/spec/async.spec.js
deleted file mode 100644 (file)
index 6de372d..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Copyright (c) 2013 Index Data ApS. http://indexdata.com
- *
- * async check
- *
- */
-describe("Asynchronous check", function () {
-    it("contains spec with an expectation", function () {
-        expect(true).toBe(true);
-    });
-
-    // Asynchronous part
-    it("simple check", function () {
-        var max_time = 1;
-        var timer = 0;
-
-        function found(time, none) {
-            setTimeout(function () {
-                timer = time;
-            }, time * 1000);
-            expect(time >= 0).toBeTruthy();
-        }
-
-        runs(function () {
-            // check hit counter after N seconds
-            found(0, true);
-            found(0.2);
-            found(0.4);
-            found(0.5);
-            found(0.7);
-            found(max_time);
-        });
-
-        waitsFor(function () {
-            // console.log("waits for ... " + timer);
-            return timer == max_time ? true : false;
-        }, "The Value should be N seconds", max_time * 1000);
-
-        runs(function () {
-            expect(timer).toEqual(max_time);
-        });
-    });
-
-
-    it("double async check", function () {
-        var max_time = 0.5;
-        var timer = 0;
-
-        function found(time, none) {
-            setTimeout(function () {
-                timer = time;
-            }, time * 1000);
-            expect(time >= 0).toBeTruthy();
-        }
-
-        runs(function () {
-            found(0);
-            found(0.2);
-            found(max_time - 0.1);
-        });
-
-        waitsFor(function () {
-            return timer == max_time - 0.1 ? true : false;
-        }, "The Value should be N seconds", max_time * 1000);
-
-        runs(function () {
-            expect(timer <= max_time).toBeTruthy();
-        });
-
-        timer = 0;
-        runs(function () {
-            found(0.1);
-            found(max_time);
-        });
-
-        waitsFor(function () {
-            // console.log("waits for ... " + timer);
-            return timer == max_time ? true : false;
-        }, "The Value should be N seconds", max_time * 1000);
-
-        runs(function () {
-            expect(timer <= max_time).toBeTruthy();
-        });
-    });
-
-});
index c295b32..eca9da5 100644 (file)
@@ -670,11 +670,13 @@ describe("Check SortBy options", function () {
         var waitcount = 0;
         var sort_value = 'title:1';
         var per_page_number = 20;
+
+       // keep current title list
         var title_list_old = title_list("xxx ");
 
         function title_list(prefix) {
             var list = [];
-            var terms = $("div.mkws-records > div.mkws-summary");
+            var terms = $("div.mkws-records > div.mkws-summary > div.mkws-field-data span.mkws-field-title");
             for (var i = 0; i < terms.length; i++) {
                 var term = $(terms[i]).text().trim();
                 list.push(term);