text:
/* 'use strict'; */

var MYTIMEOUT = 12000;

var DEFAULT_SIZE = 5000000; // max to avoid popup in safari/ios

// FUTURE TODO replace in test(s):
function ok(test, desc) { expect(test).toBe(true); }
function equal(a, b, desc) { expect(a).toEqual(b); } // '=='

// XXX TODO REFACTOR OUT OF OLD TESTS:
var wait = 0;
var test_it_done = null;
function xtest_it(desc, fun) { xit(desc, fun); }
function test_it(desc, fun) {
  wait = 0;
  it(desc, function(done) {
    test_it_done = done;
    fun();
  }, MYTIMEOUT);
}
function stop(n) {
  if (!!n) wait += n
  else ++wait;
}
function start(n) {
  if (!!n) wait -= n;
  else --wait;
  if (wait == 0) test_it_done();
}

var isWP8 = /IEMobile/.test(navigator.userAgent); // Matches WP(7/8/8.1)
var isWindows = /Windows /.test(navigator.userAgent); // Windows
var isAndroid = !isWindows && /Android/.test(navigator.userAgent);
var isMac = /Macintosh/.test(navigator.userAgent);
var isWKWebView = !isWindows && !isAndroid && !isWP8 && !isMac && !!window.webkit && !!window.webkit.messageHandlers;

// NOTE: In the common storage-master branch there is no difference between the
// default implementation and implementation #2. But the test will also apply
// the androidLockWorkaround: 1 option in the case of implementation #2.
var scenarioList = [
  isAndroid ? 'Plugin-implementation-default' : 'Plugin',
  'HTML5',
  'Plugin-implementation-2'
];

var scenarioCount = (!!window.hasWebKitBrowser) ? (isAndroid ? 3 : 2) : 1;

var mytests = function() {

  describe('Plugin: plugin-specific sql test(s)', function() {

    var pluginScenarioList = [
      isAndroid ? 'Plugin-implementation-default' : 'Plugin',
      'Plugin-implementation-2'
    ];

    var pluginScenarioCount = isAndroid ? 2 : 1;

    for (var i=0; i<pluginScenarioCount; ++i) {

      describe(pluginScenarioList[i] + ': db.executeSql test(s)', function() {
        var scenarioName = pluginScenarioList[i];
        var suiteName = scenarioName + ': ';
        var isImpl2 = (i === 1);

        // NOTE: MUST be defined in function scope, NOT outer scope:
        var openDatabase = function(first, second, third, fourth, fifth, sixth) {
          //if (!isImpl2) {
          //  return window.sqlitePlugin.openDatabase(first, second, third, fourth, fifth, sixth);
          //}

          var dbname, okcb, errorcb;

          if (first.constructor === String ) {
            dbname = first;
            okcb = fifth;
            errorcb = sixth;
          } else {
            dbname = first.name;
            okcb = second;
            errorcb = third;
          }

          if (!isImpl2) {
            return window.sqlitePlugin.openDatabase({name: dbname, location: 0}, okcb, errorcb);
          }

          var dbopts = {
            name: 'i2-'+dbname,
            androidDatabaseImplementation: 2,
            androidLockWorkaround: 1,
            location: 1
          };

          return window.sqlitePlugin.openDatabase(dbopts, okcb, errorcb);
        }

        it(suiteName + 'db.executeSql string result test with null for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-String-result-test-with-null-parameter-arg-array.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql("SELECT UPPER('first') AS uppertext", null, function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'Inline db.executeSql US-ASCII String manipulation test with empty ([]) parameter list', function(done) {
          var db = openDatabase("Inline-db-sql-US-ASCII-string-test-with-empty-parameter-list.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql("SELECT UPPER('Some US-ASCII text') AS uppertext", [], function(res) {
            expect(res.rows.item(0).uppertext).toBe("SOME US-ASCII TEXT");

            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql string result test with undefined for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-String-result-test-with-undefined-for-parameter-arg-array.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql("SELECT UPPER('first') AS uppertext", undefined, function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [101] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-101.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [101], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isMac || isWKWebView)
              expect(rs.rows.item(0).myresult).toBe('real');
            else if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('integer');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [101] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-101.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [101], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('101');
            else
              expect(rs.rows.item(0).myresult).toBe(101);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [-101] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-minus-101.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [-101], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isMac || isWKWebView)
              expect(rs.rows.item(0).myresult).toBe('real');
            else if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('integer');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [-101] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-minus-101.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [-101], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('-101');
            else
              expect(rs.rows.item(0).myresult).toBe(-101);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [123.456] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-123.456.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [123.456], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('real');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [123.456] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-123.456.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [123.456], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('123.456');
            else
              expect(rs.rows.item(0).myresult).toBe(123.456);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [-123.456] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-minus-123.456.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [-123.456], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('real');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [-123.456] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-minus-123.456.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [-123.456], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('-123.456');
            else
              expect(rs.rows.item(0).myresult).toBe(-123.456);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [0] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-0.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [0], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isMac || isWKWebView)
              expect(rs.rows.item(0).myresult).toBe('real');
            else if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('integer');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [0] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-0.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [0], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('0');
            else
              expect(rs.rows.item(0).myresult).toBe(0);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [null] for parameter argument array', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-null.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [null], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('null');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [undefined] for parameter argument array [BROKEN on Windows]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now

          var db = openDatabase("DB-sql-SELECT-TYPEOF-undefined.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [undefined], function(rs) {
            if (isWindows) expect('Windows plugin version FIXED please update this test').toBe('--');
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('null');
            db.close(done, done);
          }, function(error) {
            // ERROR in case of Windows:
            if (isWindows) {
              expect(error).toBeDefined();
              expect(error.code).toBeDefined();
              expect(error.message).toBeDefined();
              expect(error.code).toBe(0);
              expect(error.message).toMatch(/Unsupported argument type: undefined/);
              return done();
            }

            // OTHERWISE
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [Infinity] for parameter argument array [TBD Android/iOS/macOS plugin result]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now

          var db = openDatabase("DB-sql-SELECT-TYPEOF-infinity.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [Infinity], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else if (!isWindows && !isMac)
              expect(rs.rows.item(0).myresult).toBe('null');
            else
              expect(rs.rows.item(0).myresult).toBe('real');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [Infinity] for parameter argument array [TBD Android/iOS/macOS plugin result]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now
          if (isMac) pending('SKIP for macOS [CRASH]'); // FUTURE TBD

          var db = openDatabase("DB-sql-SELECT-infinity.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [Infinity], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isWindows)
              expect(rs.rows.item(0).myresult).toBe(Infinity);
            else if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('');
            else
              expect(rs.rows.item(0).myresult).toBe(null);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [-Infinity] for parameter argument array [TBD Android/iOS/macOS plugin result]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now

          var db = openDatabase("DB-sql-SELECT-TYPEOF-minus-infinity.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [-Infinity], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else if (!isWindows && !isMac)
              expect(rs.rows.item(0).myresult).toBe('null');
            else
              expect(rs.rows.item(0).myresult).toBe('real');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT ? with [-Infinity] for parameter argument array [TBD Android/iOS/macOS plugin result]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now
          if (isMac) pending('SKIP for macOS [CRASH]'); // FUTURE TBD

          var db = openDatabase("DB-sql-SELECT-minus-infinity.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT ? AS myresult', [-Infinity], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isWindows)
              expect(rs.rows.item(0).myresult).toBe(-Infinity);
            else if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('');
            else
              expect(rs.rows.item(0).myresult).toBe(null);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql check SELECT TYPEOF(?) with [NaN] for parameter argument array [TBD Android/iOS/macOS plugin result]', function(done) {
          var db = openDatabase("DB-sql-SELECT-TYPEOF-nan.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SELECT TYPEOF(?) AS myresult', [NaN], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            if (isAndroid && isImpl2)
              expect(rs.rows.item(0).myresult).toBe('text');
            else
              expect(rs.rows.item(0).myresult).toBe('null');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql store numeric values and check', function(done) {
          var db = openDatabase("DB-sql-store-numeric-values-and-check.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();
          db.executeSql('DROP TABLE IF EXISTS MyTable');
          db.executeSql('CREATE TABLE MyTable (data)');
          db.executeSql('INSERT INTO MyTable VALUES (?)', [101]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [-101]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [123.456]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [-123.456]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [1234567890123]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [-1234567890123]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [1234567890123.4]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [-1234567890123.4]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [0]);

          db.executeSql('SELECT data AS d1, TYPEOF(data) AS t1, ABS(data) AS a1, UPPER(data) as u1 FROM MyTable', [], function (rs) {
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(9);
            expect(rs.rows.item(0).d1).toBe(101);
            if (isMac || isWKWebView)
              expect(rs.rows.item(0).t1).toBe('real');
            else
              expect(rs.rows.item(0).t1).toBe('integer');
            expect(rs.rows.item(0).a1).toBe(101);
            if (isMac || isWKWebView)
              expect(rs.rows.item(0).u1).toBe('101.0');
            else
              expect(rs.rows.item(0).u1).toBe('101');
            expect(rs.rows.item(1).d1).toBe(-101);
            if (isMac || isWKWebView)
              expect(rs.rows.item(1).t1).toBe('real');
            else
              expect(rs.rows.item(1).t1).toBe('integer');
            expect(rs.rows.item(1).a1).toBe(101);
            if (isMac || isWKWebView)
              expect(rs.rows.item(1).u1).toBe('-101.0');
            else
              expect(rs.rows.item(1).u1).toBe('-101');
            expect(rs.rows.item(2).d1).toBe(123.456);
            expect(rs.rows.item(2).t1).toBe('real');
            expect(rs.rows.item(2).a1).toBe(123.456);
            expect(rs.rows.item(2).u1).toBe('123.456');
            expect(rs.rows.item(3).d1).toBe(-123.456);
            expect(rs.rows.item(3).t1).toBe('real');
            expect(rs.rows.item(3).a1).toBe(123.456);
            expect(rs.rows.item(3).u1).toBe('-123.456');
            expect(rs.rows.item(4).d1).toBe(1234567890123);
            if (isMac || isWKWebView)
              expect(rs.rows.item(4).t1).toBe('real');
            else
              expect(rs.rows.item(4).t1).toBe('integer');
            expect(rs.rows.item(4).a1).toBe(1234567890123);
            if (isMac || isWKWebView)
              expect(rs.rows.item(4).u1).toBe('1234567890123.0');
            else
              expect(rs.rows.item(4).u1).toBe('1234567890123');
            expect(rs.rows.item(5).d1).toBe(-1234567890123);
            if (isMac || isWKWebView)
              expect(rs.rows.item(5).t1).toBe('real');
            else
              expect(rs.rows.item(5).t1).toBe('integer');
            expect(rs.rows.item(5).a1).toBe(1234567890123);
            if (isMac || isWKWebView)
              expect(rs.rows.item(5).u1).toBe('-1234567890123.0');
            else
              expect(rs.rows.item(5).u1).toBe('-1234567890123');
            expect(rs.rows.item(6).d1).toBe(1234567890123.4);
            expect(rs.rows.item(6).t1).toBe('real');
            expect(rs.rows.item(6).a1).toBe(1234567890123.4);
            expect(rs.rows.item(6).u1).toBe('1234567890123.4');
            expect(rs.rows.item(7).d1).toBe(-1234567890123.4);
            expect(rs.rows.item(7).t1).toBe('real');
            expect(rs.rows.item(7).a1).toBe(1234567890123.4);
            expect(rs.rows.item(7).u1).toBe('-1234567890123.4');
            expect(rs.rows.item(8).d1).toBe(0);
            if (isMac || isWKWebView)
              expect(rs.rows.item(8).t1).toBe('real');
            else
              expect(rs.rows.item(8).t1).toBe('integer');
            expect(rs.rows.item(8).a1).toBe(0);
            if (isMac || isWKWebView)
              expect(rs.rows.item(8).u1).toBe('0.0');
            else
              expect(rs.rows.item(8).u1).toBe('0');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql store null/undefined values and check [store undefined value BROKEN on Windows]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now

          var db = openDatabase("DB-sql-store-null-undefined-values-and-check.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('DROP TABLE IF EXISTS MyTable');
          db.executeSql('CREATE TABLE MyTable (data)');
          db.executeSql('INSERT INTO MyTable VALUES (?)', [null]);
          // NOTE: THIS WILL FAIL on Windows:
          db.executeSql('INSERT INTO MyTable VALUES (?)', [undefined]);

          db.executeSql('SELECT data AS d1, TYPEOF(data) AS t1, ABS(data) AS a1, UPPER(data) as u1 FROM MyTable', [], function (rs) {
            expect(rs.rows).toBeDefined();
            if (isWindows) // [FUTURE TBD]
              expect(rs.rows.length).toBe(1);
            else
              expect(rs.rows.length).toBe(2);
            expect(rs.rows.item(0).d1).toBe(null);
            expect(rs.rows.item(0).t1).toBe('null');
            expect(rs.rows.item(0).a1).toBe(null);
            expect(rs.rows.item(0).u1).toBe(null);
            if (isWindows) return done(); // [FUTURE TBD]
            expect(rs.rows.item(1).d1).toBe(null);
            expect(rs.rows.item(1).t1).toBe('null');
            expect(rs.rows.item(1).a1).toBe(null);
            expect(rs.rows.item(1).u1).toBe(null);
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql store Infinity/NaN values and check [TBD Android/iOS plugin result]', function(done) {
          if (isWP8) pending('SKIP for WP8'); // SKIP for now
          if (isMac) pending('SKIP for macOS [CRASH]'); // FUTURE TBD

          var db = openDatabase("DB-sql-store-infinity-nan-values-and-check.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();
          db.executeSql('DROP TABLE IF EXISTS MyTable');
          db.executeSql('CREATE TABLE MyTable (data)');
          db.executeSql('INSERT INTO MyTable VALUES (?)', [Infinity]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [-Infinity]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [NaN]);

          db.executeSql('SELECT data AS d1, TYPEOF(data) AS t1, ABS(data) AS a1, UPPER(data) as u1 FROM MyTable', [], function (rs) {
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(3);
            if (isWindows) {
              expect(rs.rows.item(0).d1).toBe(Infinity);
              expect(rs.rows.item(0).t1).toBe('real');
              expect(rs.rows.item(0).a1).toBe(Infinity);
              expect(rs.rows.item(0).u1).toBe('INF');
              expect(rs.rows.item(1).d1).toBe(-Infinity);
              expect(rs.rows.item(1).t1).toBe('real');
              expect(rs.rows.item(1).a1).toBe(Infinity);
              expect(rs.rows.item(1).u1).toBe('-INF');
            } else {
              expect(rs.rows.item(0).d1).toBe(null);
              expect(rs.rows.item(0).t1).toBe('null');
              expect(rs.rows.item(0).a1).toBe(null);
              expect(rs.rows.item(0).u1).toBe(null);
              expect(rs.rows.item(1).d1).toBe(null);
              expect(rs.rows.item(1).t1).toBe('null');
              expect(rs.rows.item(1).a1).toBe(null);
              expect(rs.rows.item(1).u1).toBe(null);
            }
            expect(rs.rows.item(2).d1).toBe(null);
            expect(rs.rows.item(2).t1).toBe('null');
            expect(rs.rows.item(2).a1).toBe(null);
            expect(rs.rows.item(2).u1).toBe(null);
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql store true/false values and check [stored as strings]', function(done) {
          var db = openDatabase("DB-sql-store-true-false-values-and-check.db", "1.0", "Demo", DEFAULT_SIZE);

          db.executeSql('DROP TABLE IF EXISTS MyTable');
          db.executeSql('CREATE TABLE MyTable (data)');
          db.executeSql('INSERT INTO MyTable VALUES (?)', [true]);
          db.executeSql('INSERT INTO MyTable VALUES (?)', [false]);

          db.executeSql('SELECT data AS d1, TYPEOF(data) AS t1, ABS(data) AS a1, UPPER(data) as u1 FROM MyTable', [], function (rs) {
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(2);
            expect(rs.rows.item(0).d1).toBe('true');
            expect(rs.rows.item(0).t1).toBe('text');
            expect(rs.rows.item(0).a1).toBe(0);
            expect(rs.rows.item(0).u1).toBe('TRUE');
            expect(rs.rows.item(1).d1).toBe('false');
            expect(rs.rows.item(1).t1).toBe('text');
            expect(rs.rows.item(1).a1).toBe(0);
            expect(rs.rows.item(1).u1).toBe('FALSE');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql string result test with new String for SQL', function(done) {
          var db = openDatabase("DB-sql-new-String-test.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql(new String("SELECT UPPER('first') AS uppertext"), null, function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'SELECT UPPER(?) AS upper1, UPPER(?) AS upper2 with "naive" Array subclass (constructor NOT explicitly set to subclasss) as value arguments array', function(done) {
          var db = openDatabase('DB-SQL-SELECT-multi-upper-on-array-subclass.db');
          expect(db).toBeDefined();

          // Variation on the "naive approach" described in
          // http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/
          function F() {}
          F.prototype = Array.prototype;
          function MyArraySubclass() {}
          MyArraySubclass.prototype = new F();
          myObject = new MyArraySubclass();
          myObject.push('s1', 's2');

          expect(myObject.length).toBe(2);
          expect(myObject[0]).toBe('s1');
          expect(myObject[1]).toBe('s2');

          expect(myObject.constructor).toBe(Array);

          db.executeSql('SELECT UPPER(?) AS upper1, UPPER(?) AS upper2', myObject, function(rs) {
            // EXPECTED RESULT:
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).upper1).toBe('S1');
            expect(rs.rows.item(0).upper2).toBe('S2');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'SELECT UPPER(?) AS upper1, UPPER(?) AS upper2 with "naive" Array subclass (constructor explicitly set to subclasss) as value arguments array', function(done) {
          var db = openDatabase('DB-SQL-SELECT-multi-upper-on-array-subclass-explicit-constructor.db');
          expect(db).toBeDefined();

          // Variation on the "naive approach" described in
          // http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/
          function F() {}
          F.prototype = Array.prototype;
          function MyArraySubclass() {}
          MyArraySubclass.prototype = new F();
          myObject = new MyArraySubclass();
          myObject.push('s1', 's2');

          expect(myObject.length).toBe(2);
          expect(myObject[0]).toBe('s1');
          expect(myObject[1]).toBe('s2');

          expect(myObject.constructor).toBe(Array);
          myObject.constructor = MyArraySubclass;
          expect(myObject.constructor).toBe(MyArraySubclass);

          db.executeSql('SELECT UPPER(?) AS upper1, UPPER(?) AS upper2', myObject, function(rs) {
            // EXPECTED RESULT:
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).upper1).toBeNull();
            expect(rs.rows.item(0).upper2).toBeNull();
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql string result test with dynamic object for SQL [INCONSISTENT BEHAVIOR]', function(done) {
          // MyDynamicObject "class":
          function MyDynamicObject() { this.name = 'Alice'; };
          MyDynamicObject.prototype.toString = function() {return "SELECT UPPER('" + this.name + "') as uppertext";}

          var myObject = new MyDynamicObject();
          // Check myObject:
          expect(myObject.toString()).toBe("SELECT UPPER('Alice') as uppertext");

          // NOTE: this test checks that for db.executeSql(), the result callback is
          // called exactly once, with the proper result:
          var db = openDatabase("DB-sql-string-result-test-with-dynamic-object-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          myObject.name = 'Betty';
          db.executeSql(myObject, null, function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            // CORRECT [CONSISTENT with normal Web SQL API]:
            //expect(rs.rows.item(0).uppertext).toBe('BETTY');
            // ACTUAL:
            expect(rs.rows.item(0).uppertext).toBe('CAROL');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
          myObject.name = 'Carol';
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql string result test with dynamic object for parameter arg [INCONSISTENT BEHAVIOR]', function(done) {
          // MyDynamicParameterObject "class":
          function MyDynamicParameterObject() {this.name='Alice';};
          MyDynamicParameterObject.prototype.toString = function() {return this.name;};

          var myObject = new MyDynamicParameterObject();
          // Check myObject:
          expect(myObject.toString()).toBe('Alice');

          // NOTE: this test checks that for db.executeSql(), the result callback is
          // called exactly once, with the proper result:
          var db = openDatabase("DB-sql-string-result-test-with-dynamic-object-for-parameter-arg.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          myObject.name = 'Betty';
          db.executeSql("SELECT UPPER(?) as uppertext", [myObject], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            // CORRECT [CONSISTENT with normal Web SQL API]:
            //expect(rs.rows.item(0).uppertext).toBe('BETTY');
            // ACTUAL:
            expect(rs.rows.item(0).uppertext).toBe('CAROL');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
          myObject.name = 'Carol';
        }, MYTIMEOUT);

        it(suiteName + 'Multi-row INSERT with parameters in db.executeSql test', function(done) {
          if (isWP8) pending('SKIP: NOT SUPPORTED for WP8');

          var db = openDatabase('Multi-row-INSERT-with-parameters-in-db-sql-test.db');

          db.executeSql('DROP TABLE IF EXISTS TestTable;');
          db.executeSql('CREATE TABLE TestTable (x,y)');

          var check1 = false;
          db.executeSql('INSERT INTO TestTable VALUES (?,?),(?,?)', ['a',1,'b',2], function(rs) {
            expect(rs).toBeDefined();
            expect(rs.insertId).toBeDefined();
            expect(rs.insertId).toBe(2);
            if (!(isAndroid && isImpl2))
              expect(rs.rowsAffected).toBe(2);

            check1 = true;
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            // NOTE: let the next db.executeSql call determine when to finish this test.
          });

          db.executeSql('SELECT * FROM TestTable', [], function(rs2) {
            // EXPECTED SELECT RESULT:
            expect(rs2).toBeDefined();
            expect(rs2.rows.length).toBe(2);
            expect(rs2.rows.item(0).x).toBe('a');
            expect(rs2.rows.item(0).y).toBe(1);
            expect(rs2.rows.item(1).x).toBe('b');
            expect(rs2.rows.item(1).y).toBe(2);
            expect(check1).toBe(true);
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED (SELECT):
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        test_it(suiteName + "Multiple db.executeSql string result test", function() {
          // NOTE: this test checks that for db.executeSql(), the result callback is
          // called exactly once, with the proper result:
          var db = openDatabase("Multiple-DB-sql-String-result-test.db", "1.0", "Demo", DEFAULT_SIZE);

          var expected = [ 'FIRST', 'SECOND' ];
          var i=0;

          ok(!!db, 'valid db object');

          stop(2);

          var okcb = function(result) {
            if (i > 1) {
              ok(false, "unexpected result: " + JSON.stringify(result));
              console.log("discarding unexpected result: " + JSON.stringify(result))
              return;
            }

            ok(!!result, "valid result object");

            // ignore cb (and do not count) if result is undefined:
            if (!!result) {
              console.log("result.rows.item(0).uppertext: " + result.rows.item(0).uppertext);
              equal(result.rows.item(0).uppertext, expected[i], "Check result " + i);
              i++;
              start(1);
            }
          };

          db.executeSql("select upper('first') as uppertext", [], okcb);
          db.executeSql("select upper('second') as uppertext", [], okcb);
        }, MYTIMEOUT);

      });
    }

  });

  describe('Plugin: plugin-specific error test(s)', function() {

    var pluginScenarioList = [
      isAndroid ? 'Plugin-implementation-default' : 'Plugin',
      'Plugin-implementation-2'
    ];

    var pluginScenarioCount = isAndroid ? 2 : 1;

    for (var i=0; i<pluginScenarioCount; ++i) {

      describe(pluginScenarioList[i] + ': db.executeSql error test(s)', function() {
        var scenarioName = pluginScenarioList[i];
        var suiteName = scenarioName + ': ';
        var isImpl2 = (i === 1);

        // NOTE: MUST be defined in function scope, NOT outer scope:
        var openDatabase = function(first, second, third, fourth, fifth, sixth) {
          //if (!isImpl2) {
          //  return window.sqlitePlugin.openDatabase(first, second, third, fourth, fifth, sixth);
          //}

          var dbname, okcb, errorcb;

          if (first.constructor === String ) {
            dbname = first;
            okcb = fifth;
            errorcb = sixth;
          } else {
            dbname = first.name;
            okcb = second;
            errorcb = third;
          }

          if (!isImpl2) {
            return window.sqlitePlugin.openDatabase({name: dbname, location: 0}, okcb, errorcb);
          }

          var dbopts = {
            name: 'i2-'+dbname,
            androidDatabaseImplementation: 2,
            androidLockWorkaround: 1,
            location: 1
          };

          return window.sqlitePlugin.openDatabase(dbopts, okcb, errorcb);
        }

        it(suiteName + 'db.executeSql() with no arguments and then inline string test', function(done) {
          var db = openDatabase("DB-execute-sql-with-no-arguments.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = true;
          try {
            // DOES NOT THROW:
            db.executeSql();

            check1 = true;
          } catch (ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
          }

          db.executeSql("SELECT UPPER('first') AS uppertext", null, function(rs) {
            expect(check1).toBe(true);
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with null for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-null-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = false;
          db.executeSql(null, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            expect('Behavior changed please update this test').toBe('--');
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();
            check1 = true;

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"SLCT\": syntax error/);
          });

          db.executeSql('SELECT 1', null, function(rs) {
            //expect(check1).toBe(true);
            expect(rs).toBeDefined();
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with undefined for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-undefined-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = false;
          db.executeSql(undefined, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            expect('Behavior changed please update this test').toBe('--');
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();
            check1 = true;

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"SLCT\": syntax error/);
          });

          db.executeSql('SELECT 1', null, function(rs) {
            //expect(check1).toBe(true);
            expect(rs).toBeDefined();
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with true for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-true-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql(true, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT:
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"true\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with false for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-false-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql(false, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT:
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"false\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with Infinity for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-infinity-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql(Infinity, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT:
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"Infinity\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with -Infinity for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-infinity-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql(-Infinity, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT:
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"-\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with NaN for SQL statement', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-nan-for-sql.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql(NaN, null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT:
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"NaN\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with null for parameter argument array', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-null-for-parameter-arg-array.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SLCT 1', null, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"SLCT\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with undefined for parameter argument array', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-undefined-for-parameter-arg-array.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          db.executeSql('SLCT 1', undefined, function(ignored) {
            // NOT EXPECTED
            expect(false).toBe(null);
            db.close(done, done);
          }, function(error) {
            // EXPECTED RESULT
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"SLCT\": syntax error/);

            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with "string-value" for parameter argument array', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-string-value-for-parameter-arg-array.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          try {
            db.executeSql('SLCT 1', "string-value", function(ignored) {
              // NOT EXPECTED
              expect(false).toBe(true);
              db.close(done, done);
            }, function(error) {
              // EXPECTED RESULT
              expect(error).toBeDefined();
              expect(error.code).toBeDefined();
              expect(error.message).toBeDefined();
              db.close(done, done);
            });
          } catch(ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            db.close(done, done);
          }
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql error test with false for parameter argument array', function(done) {
          var db = openDatabase("DB-execute-sql-error-test-with-false-for-parameter-arg-array.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          try {
            db.executeSql('SLCT 1', false, function(ignored) {
              // NOT EXPECTED
              expect(false).toBe(true);
              db.close(done, done);
            }, function(error) {
              // EXPECTED RESULT
              expect(error).toBeDefined();
              expect(error.code).toBeDefined();
              expect(error.message).toBeDefined();
              db.close(done, done);
            });
          } catch(ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            db.close(done, done);
          }
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql() with valid SQL, null arguments, false for success cb then inline string test', function(done) {
          var db = openDatabase("DB-execute-sql-with-false-for-success-cb.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = false;
          try {
            // DOES NOT THROW:
            db.executeSql('SELECT 1', null, false, function(error) {
              // NOT EXPECTED:
              expect(false).toBe(true);
              expect(error.message).toBe('--');
            });
            check1 = true;
          } catch (ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
          }

          db.executeSql("SELECT UPPER('first') AS uppertext", null, function(rs) {
            expect(check1).toBe(true);
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql() with valid SQL, null arguments, "string-value" for success cb then inline string test', function(done) {
          var db = openDatabase("DB-execute-sql-with-string-value-for-success-cb.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = false;
          try {
            // DOES NOT THROW:
            db.executeSql('SELECT 1', null, 'string-value', function(error) {
              // NOT EXPECTED:
              expect(false).toBe(true);
              expect(error.message).toBe('--');
            });
            check1 = true;
          } catch (ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
          }

          db.executeSql("SELECT UPPER('first') AS uppertext", null, function(rs) {
            expect(check1).toBe(true);
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql() error test with false for success callback', function(done) {
          var db = openDatabase("DB-execute-sql-error-with-false-for-success-cb.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          try {
            // DOES NOT THROW:
            db.executeSql('SLCT 1', null, false, function(error) {
              expect(error).toBeDefined();
              db.close(done, done);
            });
          } catch(ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
            db.close(done, done);
          }
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql() error test with "string-value" for success callback', function(done) {
          var db = openDatabase("DB-execute-sql-error-with-string-value-for-success-cb.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = true;
          try {
            // DOES NOT THROW:
            db.executeSql('SLCT 1', null, 'string-value', function(error) {
              expect(error).toBeDefined();
              db.close(done, done);
            });
          } catch(ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
            db.close(done, done);
          }
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql() error test with false for error callback and then inline string test', function(done) {
          var db = openDatabase("DB-execute-sql-with-false-for-error-cb.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = true;
          try {
            // DOES NOT THROW:
            db.executeSql('SLCT 1', null, null, false);

            check1 = true;
          } catch(ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
          }

          db.executeSql("SELECT UPPER('first') AS uppertext", null, function(rs) {
            expect(check1).toBe(true);
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + 'db.executeSql() error test with "string-value" for error callback and then inline string test', function(done) {
          var db = openDatabase("DB-execute-sql-with-string-value-for-error-cb.db", "1.0", "Demo", DEFAULT_SIZE);
          expect(db).toBeDefined();

          var check1 = true;
          try {
            // DOES NOT THROW:
            db.executeSql('SLCT 1', null, null, 'string-value');

            check1 = true;
          } catch(ex) {
            expect('Plugin behavior changed please update this test').toBe('--');
            expect(ex).toBeDefined();
            expect(ex.code).toBeDefined();
            expect(ex.message).toBeDefined();
          }

          db.executeSql("SELECT UPPER('first') AS uppertext", null, function(rs) {
            expect(check1).toBe(true);
            expect(rs).toBeDefined();
            expect(rs.rows).toBeDefined();
            expect(rs.rows.length).toBe(1);
            expect(rs.rows.item(0).uppertext).toBe('FIRST');
            db.close(done, done);
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('--');
            db.close(done, done);
          });
        }, MYTIMEOUT);

        it(suiteName + "Multiple db.executeSql error result test", function(done) {
          // NOTE: this test checks that for db.executeSql(), the error result
          // callback is called exactly once, with the proper result:
          var db = openDatabase("Multiple-DB-sql-error-result-test.db", "1.0", "Demo", DEFAULT_SIZE);

          var error_result_count = 0;

          // First: syntax error
          db.executeSql("SELCT upper('first') AS uppertext", [], function() {
            // NOT EXPECTED:
            expect(false).toBe(true);
          }, function(error) {
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/near \"SELCT\": syntax error/);

            // CHECK that this was not called before
            expect(error_result_count).toBe(0);
            ++error_result_count;
          });

          // Second: SELECT misspelled function name
          db.executeSql("SELECT uper('second') as uppertext", [], function() {
            // NOT EXPECTED:
            expect(false).toBe(true);
          }, function(error) {
            expect(error).toBeDefined();
            expect(error.code).toBeDefined();
            expect(error.message).toBeDefined();

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows || (isAndroid && isImpl2))
              expect(error.code).toBe(0);
            else
              expect(error.code).toBe(5);

            if (isWP8)
              expect(true).toBe(true); // SKIP for now
            else if (isWindows)
              expect(error.message).toMatch(/Error preparing an SQLite statement/);
            else
              expect(error.message).toMatch(/no such function: uper/);

            expect(error_result_count).toBe(1);
            ++error_result_count;

            // and finish this test:
            db.close(done, done);
          });
        });

      });
    }

  });

  describe('Plugin: more plugin-specific test(s)', function() {

    var pluginScenarioList = [
      isAndroid ? 'Plugin-implementation-default' : 'Plugin',
      'Plugin-implementation-2'
    ];

    var pluginScenarioCount = isAndroid ? 2 : 1;

    for (var i=0; i<pluginScenarioCount; ++i) {

      describe(pluginScenarioList[i] + ': more db.executeSql test(s)', function() {
        var scenarioName = pluginScenarioList[i];
        var suiteName = scenarioName + ': ';
        var isImpl2 = (i === 1);

        // NOTE: MUST be defined in function scope, NOT outer scope:
        var openDatabase = function(first, second, third, fourth, fifth, sixth) {
          //if (!isImpl2) {
          //  return window.sqlitePlugin.openDatabase(first, second, third, fourth, fifth, sixth);
          //}

          var dbname, okcb, errorcb;

          if (first.constructor === String ) {
            dbname = first;
            okcb = fifth;
            errorcb = sixth;
          } else {
            dbname = first.name;
            okcb = second;
            errorcb = third;
          }

          if (!isImpl2) {
            return window.sqlitePlugin.openDatabase({name: dbname, location: 0}, okcb, errorcb);
          }

          var dbopts = {
            name: 'i2-'+dbname,
            androidDatabaseImplementation: 2,
            androidLockWorkaround: 1,
            location: 1
          };

          return window.sqlitePlugin.openDatabase(dbopts, okcb, errorcb);
        }

        test_it(suiteName + "PRAGMAs & multiple database transactions mixed together", function() {
          var db = openDatabase("DB1", "1.0", "Demo", DEFAULT_SIZE);

          var db2 = openDatabase("DB2", "1.0", "Demo", DEFAULT_SIZE);

          stop(2);

          db.transaction(function(tx) {
            tx.executeSql('DROP TABLE IF EXISTS test_table');
            tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)', [], function() {
              console.log("test_table created");
            });

            stop();
            db.executeSql("pragma table_info (test_table);", [], function(res) {
              start();
              console.log("PRAGMA res: " + JSON.stringify(res));
              equal(res.rows.item(2).name, "data_num", "DB1 table number field name");
            });
          });

          db2.transaction(function(tx) {
            tx.executeSql('DROP TABLE IF EXISTS tt2');
            tx.executeSql('CREATE TABLE IF NOT EXISTS tt2 (id2 integer primary key, data2 text, data_num2 integer)', [], function() {
              console.log("tt2 created");
            });

            db.executeSql("pragma table_info (test_table);", [], function(res) {
              console.log("PRAGMA (db) res: " + JSON.stringify(res));
              equal(res.rows.item(0).name, "id", "DB1 table key field name");
              equal(res.rows.item(1).name, "data", "DB1 table text field name");
              equal(res.rows.item(2).name, "data_num", "DB1 table number field name");

              start();
            });

            db2.executeSql("pragma table_info (tt2);", [], function(res) {
              console.log("PRAGMA (tt2) res: " + JSON.stringify(res));
              equal(res.rows.item(0).name, "id2", "DB2 table key field name");
              equal(res.rows.item(1).name, "data2", "DB2 table text field name");
              equal(res.rows.item(2).name, "data_num2", "DB2 table number field name");

              start();
            });
          });
        });

      });
    }

  });

}

if (window.hasBrowser) mytests();
else exports.defineAutoTests = mytests;

/* vim: set expandtab : */

redpajama_set_name: RedPajamaGithub


With just one hour left to pass legislation over to the House of Representatives for consideration, the Washington State Senate today approved a measure that would expand foster-care availability for children who have turned 18 but are actively involved in a program to help them with future employment.
State Sen. Joe Fain, R-Auburn, the Senate's majority floor leader, worked with the proposal's sponsors and stakeholders to bring the measure before the full Senate for a vote before the 5 p.m. deadline.
"Washington has great options extending foster-care services to those who are 18-years-old and are enrolled in academic programs," said Fain, who serves the 47th Legislative District in South King County. "But the policy missed young people who – for a variety of reasons – aren't quite ready to move into postsecondary education and are stuck in a difficult middle ground because of their age."
"I've discussed this issue a great deal in the past with Auburn Youth Resources, an organization in my home community that does great work to provide youth and their families with emergency support services. By moving this legislation forward we could truly target those who would have been bypassed by having more comprehensive options," Fain explained.
The proposed expansion passed the Senate with unanimous support; a matching companion bill in the House of Representatives was approved overwhelmingly, increasing the likelihood that the change will become law this year.
"This is a great step toward providing opportunities for young people as they are faced with major life decisions. With this support they would have a better chance at a successful transition into adult life," said Sen. Jim Hargrove, D-Hoquiam, who serves on the Senate Ways and Means and Human Services and Corrections committees, both of which approved the proposal. "I appreciate Senator Ed Murray, who sponsored the measure, and Sen. Joe Fain's dedication to getting this before the full Senate so we could show our support and move it forward."


text:
Quiz: How Much Do You Know About Invasive Species in the US?
How Much Do You Know About Invasive Species in the US?
By: Monica Lee
Sometimes it starts with good intentions, like trying to rid a sugar cane plantation of rats, and ends with mongooses eating everything else on the island -- except rats. Most times, it's due to our shrinking world with insects, plants and microscopic organisms hitching rides on freighters, supplies, and introduced in the ballast water of ships. If you're into ecosystems, or just keep up with the news, you'll know many of these invasive species. But can you name them all? Try your best and see if you can match the invasive species to the clues given. Don't wait, start the quiz now.
Broadly speaking, an invasive species is non-native and whose introduction causes environmental harm, pushing out the native species. Have you heard of Red Fire Ants? How about the Sea Lamprey? Then there's the Asian Citrus Psyllid that does damage to the trees that produce your favorite breakfast juice. In most cases, these invasive species have common features: high rates of reproduction, no known predators, and easy prey. Has your mind been invaded with the correct answers? Then it's time to take this quiz and see how much you really know about the world around you. Start now by clicking the button below.
Which one is originally from Myanmar and is wreaking havoc in the Florida Everglades?
No one knows how Burmese pythons were originally introduced into the Florida Everglades, but it only takes two of them to make babies. These pythons give birth to about four dozen babies every year. The growth of their population may be why the populations of raccoons, opossums, bobcats, marsh and cottontail rabbits, as well as foxes, are down.
Which of these, although small, is deadly to the Ash tree?
Moth Larvae
Inch Worms
Although they call Russia, China and Japan home, the Emerald Ash Borer arrived in southeastern Michigan in 2002 and has spread from there, killing tens of millions of ash trees in its growing path. Adult beetles lay eggs on the bark of ash trees and their larvae feed on the nutrition transportation tissues that the tree needs to survive.
Which of these were imported for their fur but now dig up river banks and destroy the ecosystem?
Nutria or Swamp Rats
Imported from South America for their fur in the 1930s, their population skyrocketed once demand stopped for their fur. Worse yet, female nutria or swamp rats give birth to litters of up to 14 then are ready to mate within two days.
Which of these birds move in flocks that resemble small black clouds?
Goldfinches
Shakespeare enthusiasts in the 1890s introduced these birds to the U.S. Today, with a a population of about 200 million, they travel in flocks and use their numbers to bother large animals (cows, horses, etc.) until the animals move off so they can take their food.
Which fish is reducing the Lake Trout population in the Great Lakes?
Alewives are a small herring that eat Lake Trout eggs and compete with juveniles for zooplankton. If a trout or landlocked salmon eats alewives, they get a vitamin deficiency that can kill their larval.
Which fish devours nearly every bite-size fish in its path but has no known predator?
Wide-Mouth Bass
The Northern Snakehead hails from China and Korea but was found in the Chesapeake Bay watershed and is spreading to Delaware and Virginia. It looks like a cross between a python and an electric eel. With no predator and the female's ability to produce up to 100,000 eggs, it is a huge challenge to keep the population under control.
Which of these insects destroy fruits and vegetables?
Brown Marmorated Stink Bugs were found in 1998 in Allentown, Pennsylvania. It was thought the stink bugs came from a cargo ship that probably stopped or came from China where these bugs call home. Stink bugs destroy fruits and vegetables and were recently detected in South Carolina, Georgia and Florida.
Which of these were brought to the U.S. by hunters who wanted to enjoy the sport year round?
Wild Boars
Wild Boars are known to eat the eggs of any ground nesting bird as well as devour acorns and chestnuts. Already established in 47 states, there are huge numbers in Texas, Florida, Georgia and North Carolina. Because of their destructive nature, in most areas, hunters are allowed to shoot them on sight.
Which one of these sea creatures eats most everything on the coral reef?
Originally admired for their beauty, the Lionfish is a swimming pig, consuming most every living thing in a coral reef. Although originally found in the Pacific, they are now found most everywhere from the Gulf of Mexico, to the Atlantic and the Caribbean Sea.
Which of these animals are like city rats but live in the country?
Norway Pigeons
Spotted Mice
Giant Cockroaches
Running from ground to tree branch, Norway Rats (also known as Brown Rats and Sewer Rats) will eat everything from eggs in nests to young chickens, garbage and even wood! Introduced in 1775, they now live everywhere in the country.
Which one is an invasive species that eat eggs, is fast, muscular, invades homes, and harasses pets?
Tegus
Tegus look like little brown anolis lizards. Unfortunately, when pet stores released the Tegus into the wild in the Florida Keys, they did similar damage in Florida as the Pythons. They are on the verge of reaching into southern Georgia with no known predators in sight.
What is the name of the insect that creates a disease in orange trees and acts like a cancer?
Cabbage Maggot
Asian citrus psyllid
Cutworms
The bacteria that the Asian citrus psyllid carries has many names: "huanglongbing", "yellow dragon disease" and "citrus greening" but they all cause the same destruction. From deformed roots to fruits dropping prematurely, the tree slowly dies. Discovered outside Miami in 2005, it spread to 31 other counties within two years.
Which of these snakes were accidentally introduced in a U.S. territory in the 1950s?
Banded Water Snake
Brown Tree Snake
Native to Australia and Indonesia, the brown tree snake was accidentally introduced in Guam in the 1950s. Today, there are no longer any birds left. And the brown tree snake in now finding lizards as a tasty substitute.
What is the name of the grass that is destroying the habitat of native grasses such as sage brush?
Cheatgrass
Centipedegrass,
Cheatgrass is an invasive grass that has established itself through the western U.S. It competes with native grasses and fuels intense fires. It pushes out sage-grouse and other sage-dependent species.
What invasive species was brought to the Great Lakes on the ballast water of ships?
Mayflys
Stoneflys
Although native to Eastern Europe and Western Russia, zebra mussels were found in the Great Lakes region in the 1980s, and had spread through all of the lakes by the 1990s. They compete with fish for plankton and clog pipes with their colonies.
Which fly was discovered in Pennsylvania and eats over 70 species of plants?
Laternfly
The laternfly was discovered in Berks County in 2014, and has spread to neighboring counties. It is so destructive because it has an abundance of food it can eat, feeding on more than 70 species, including grapes, apples, stone fruits, and pines.
The Zika virus is transmitted by which one of these?
Gnats
African Bees
Although the Zika virus was limited to the equatorial belt, it is now in the U.S, transmitted by mosquitoes. According to the Centers for Disease Control*, in 2017, 418 symptomatic Zika virus disease cases were reported in the U.S. So far, there have been no reports in 2018. *https://www.cdc.gov/zika/reporting/2017-case-counts.html
What type of invasive crab was found in the San Francisco Bay in 1992 and has been spreading since then?
Mitten Crab
Hat Crab
Fiddler Crab
Known for eating the eggs of spawning salmon, trout and sturgeon, the Mitten Crab is a serious threat to the freshwater, estuarine and%0Dmarine ecosystems One mitten crab was found in the Columbia River in 1997.
What kind of crayfish is aggressively competing against the native crayfish in the Pacific Northwest?
Red Swamp Crayfish
Signal Crayfish
Northern Clearwater Crayfish
Virile Crayfish
The Red Swamp Crayfish eat the plants, snails, fish, and amphibians, as well as take up residence in the native crayfish habitat. To identify them from native crayfish, you'll note the red swamp crayfish claws are covered with red, white or black bumps (tubercules).
What is native to Asia and Australia and is now shading out vegetation in Florida?
Old World Climbing Fern
New World Ivy
Old World climbing ferns sprout on trees and don't allow native vegetation to bask in the sun all over east-central Florida. One of the reasons why it is so hard to eradicate is because the fern has the ability to "resprout" along each climbing leaf. That means if you leave a SINGLE leaf to thrive, a new fern will sprout.
Cattle are not feeding properly due to which invasive plant on their pasture?
Tropical Soda Apple (TSA)
Foliage and stems from the Tropical Soda Apple (TSA) are hard for the cattle to digest which makes it a big problem since Tropical Soda Apple is known to grow in pastures. The current hypothesis is that cattle carrying undigested TSA seeds that were imported from Brazil may have accidentally introduced it in the U.S.
What floating, flowering perennial can cover a lake surface from shore to shore because it grows in links?
Water Hyacinths
Grass Pink Orchard
Milk Weed
You may be surprised to learn that an acre of water hyacinths can weigh up to 200 tons! That means it can easily jam rivers and lakes with tons of floating plant matter. This invasive species takes over the body of water completely, pushing out any native plants.
What is the name of the invasive species known as the "vine that ate the south"?
Although the Kudzu was introduced at the Japanese pavilion in the 1876 Centennial Exposition in Philadelphia, the vine didn't take hold here until nearly 55 years later when it was reintroduced as a way to stop soil erosion on farms. Workers were paid $8 per acre to sow topsoil with the invasive vine that grows quickly and shades out the native species.
What is the media name for Africanized Bees?
Tornado bees
Meany bees
Killer bees
Killer Hornets
Due to the violent attacks of this hybrid of African and European honeybees, the name "Killer Bees" became the popular way to reference this invasive species. This hybrid comes from Brazil and while its sting is no more poisonous than one of a honeybee, the large numbers of killer bees that attack together can prove fatal to animals and people.
What is the name of the invasive species that is pushing out the native fish in the Mississippi and Illinois Rivers?
Asian carp eat plankton which includes algae and other microscopic organisms that native fish and mussels need to survive. The fish were brought from Southeast Asia because they can help in many areas, including keeping retention ponds clean. They entered the Mississippi River as a result of flooding.
What is the name of the tiny brown insect that is known to destroy hemlock and spruce trees?
Spruce Sap Sucker
Hemlock Woolly Adelgid
Longhorn Bettle
Leaf Bettle
The Hemlock Woolly Adelgid (HWA) sucks sap from hemlock and spruce trees, weakening and eventually killing the tree. They also lay their egg sack on the underside of hemlock branches, which look woolly or like small tufts of cotton. They were accidentally introduced here from Japan nearly 70 years ago.
What invasive species might you give to your date on Valentine's Day?
Rosa Multiflora
Scabioius
False Goat's Beard
Rosa multiflora is considered an invasive species In eastern North America due to its faster growth and ability to push out native roses from their habitat. It was introduced from Asia to help in soil conservation along with creating natural hedges to contain grazing pastures.
What type of invasive species competes with native fish for prey?
Crustacean
Chigoe Flea
Picnic Flea
The Spiny Waterflea entered the Great Lakes in ballast water released from ocean-going ships. It is able to multiply so quickly because its unappetizing spiny tail keeps it from becoming dinner for the fish.
There is yet another fish that has invaded the freshwater lakes in the Midwest. Which one is it?
Mahi, Mahi
From eating the larva of other fish, to competition for zooplankton, the Rainbow Smelt have expanded their impact throughout North American freshwater lakes for more than 100 years. The infestation resulted from rainbow smelt having been stocked into Crystal Lake, Michigan, in 1912.
With sharp spiny fins, which of these fish are also disrupting the ecosystem of the Great Lakes?
Atlantic Cod
Atlantic Bluefin Tuna
Ruffe
Appearing in the Great Lakes (Lake Superior to be exact) the Ruffe came in the ballast water of an ocean-going vessel. High growth rates along with high reproductive rates and the ability to adapt to a myriad of environments, has made this small fish a serious threat to other species.
Which of the following parasites sucks the life out of a fish?
Flukes
Sea lampreys use their sharp teeth to cut through scales and skin and then use their sucking disk to digest a fish's body fluids until it dies. Each sea lamprey can kill 40 or more pounds of fish.
What type of insect stings repeatedly and is found in many areas of Texas?
Red Fire Ants
Milkweed Bug
When disturbed, red fire ants emerge aggressively, crawl up vertical surfaces, then bite and sting non-stop. They have displaced other species of fire ants native to Texas and continue to populate in other areas.
What invasive species are Virginia officials trying to convince the public to eat?
Cownose Ray
Virginia officials hope the public will agree that the Cownose Ray, rebranded as "Chesapeake Rays," are a tasty substitute for veal. They hope the thinning of Cownose Rays will protect the Chesapeake Bay's oyster industry.
A pine tree's natural defenses don't work with which one of these invasive species?
Tree Killer Ants
Mountain Pine Beetles
When insects bore into pine trees, the trees fight back by increasing their flow of sap, a defense that forces the invaders out of the holes in the bark. Unfortunately, pine beetles produce a fungus that disables this defense. Eventually, unable to absorb water, the pine tree withers and dies.
In Hawaii, which invasive species is known for its taste for the state bird?
Asian Mongoose
Originally brought to Hawaii to help control an overwhelming rat population, the Asian Mongoose chose not to eat rats and instead eat something easier: eggs and baby birds, specifically enjoying Hawaii's state bird, the Nene or Hawaiian goose.
Can You Identify These Highly Intelligent Animals?
Can You Identify These Animals That Are Native to the UK?
Can You Identify This Animal in Its Natural Habitat?
Do You Know Where to Find These Animal Predators?
Can You Identify These New Zealand Fish Species?
Can You Spell These Animal Species Correctly?
The A to Z Snake Quiz
Are You a Unicorn, Pegasus or Hippogriff?
Can You Identify These North American Predators From an Image?
Equestrian Trivia Quiz!

redpajama_set_name: RedPajamaCommonCrawl


Prozac is an antidepressant in a group of drugs called selective serotonin reuptake inhibitors (SSRIs). Prozac affects chemicals in the brain that may become unbalanced and cause depression, panic, anxiety, or obsessive-compulsive symptoms.
Prozac is used in the treament of symptoms of depressive illness. It is also used for obsessive-compulsive symptoms with or without concomitant depression. Other conditions that are indicated for prozac are bulimia nervosa and premenstrual dysphoric disorder.
Adult dosage for depression is 20-80mg per day. Although there may be an increased potential for side effect at higher doses, a dose increase may be considered after several weeks if there is no response. Prozac may be administered with or without food. When dosing is stopped, active drug substances will persist in the body for weeks. This should be born in mind when starting or stopping treatment. Dosage tapering is unnecessary in most patients.
As with other antidepressants, Prozac should be introduced cautiously in patients who have a history of seizures. Prozac should be avoided in patients with unstable epilepsy; patients with controlled epilepsy should be carefully monitored. Prozac is known to be excreted in breastmilk. Its effects on the nursing infant have not been established. If treatment with Prozac is considered necessary, discontinuation of breastfeeding should be considered.


See many rates from renowned Quincy, Michigan car insurance companies for the best value.
Description : Moore Insurance Services was established in 1894 as the W. D. Taylor Agency. The State of Michigan commemorated the agency in 1994 as a centennial business and it continues today as one of the oldest in Michigan. Moore Insurance Services is now part of a family owned insurance agency group that includes four offices throughout Michigan.
Safe driving information from Travelers.
Interesting information from ConstructionRisk.com and J Kent Holland, JD.
Eric Moore will be a speaker at this event in Golden Colorado.
Thoughts and prayers to the victims in Boston.
Good luck to the Coldwater baseball team today in the state semis.. Denbrock Insurance Agency is rooting for you.
About : Independent Agency for Home Auto and Life Insurance.
Description : Mission Statement Summit Financial Group is committed to maintaining a long-term quality client relationship through various lines of insurance products and financial services. By providing access to experienced and knowledgeable professionals in a single location, Summit Financial Group supports the clients efforts in saving, insurance, and financial strength.
Anyone can paint a bike, but not everyone can handle this kind of artistry! http:\/\/bit.ly\/1phmZa0.
If you've made fitness goals for yourself, the last thing you need is an injury \u2014 slow down a bit and stay safe so you can crush those goals for years to come. http:\/\/bit.ly\/1HS5KVj.
Date When Celebrated : March 15th The Ides of March is the first day of the Roman New Year.It also marks the first day of spring in the Roman calendar. On this day in history, Julius Caesar was warned by soothsayers to "beware of the Ides of March".
About : Michigan Agency Partners was formed to help independent agents remain independent and to help create, retain and grow the local independent agency system.
Its Time to also Change the Batteries in the Smoke Detector... Why Do It? Electronic devices are not infallible. Batteries die, and other parts of the smoke detector can wear out over time. Regular testing can help ensure that your family will be safe in the event of a fire in your home.
Tips for Surviving Severe Cold Weather. Lets be prepared!.
Make it a Great Day!.
Merry Christmas from your friends at Hayes Insurance Agency! Our office will be closed on Thursday and Friday this week.
It's going to feel like spring this weekend! Enjoy!.
A birthday shout out to Linda Marlatt!! Have a great day and awesome year ahead!.


text:
community safe
Concern over state's 'whipping boys'
Annastacia Palaszczuk's proposal to move hotel quarantine to the state's mining camps has been called into question over possible health risks. Queensland's 'voice of the bush' Robbie Katter says the regions are willing to chip in and help solve the state's quarantine drama, but fears...
Senior politicians say Qld quarantine move a health risk
Queensland's 'voice of the bush' Robbie Katter says the regions are willing to chip in and help solve the state's quarantine drama, but fears moving returning travellers to mining camps greatly risks vulnerable communities. The Katter Australian Party leader said towns such as Cloncurry in...
Grand Chancellor guests 'distressed' after quarantine news
Distressed Australians quarantining at Brisbane's Hotel Grand Chancellor have been left in the lurch after they were told by a "vague" letter in their breakfast pack that they face another 14 days locked up. The impersonal measure, slammed as "disgraceful", "distressing" and "anxiety inducing" by...