[Ils-source] r1376 - in trunk/webapp/testsuite: . api api/user classes/UserProfile css
asmith at crosswire.org
asmith at crosswire.org
Tue Jan 12 12:55:40 MST 2016
Author: asmith
Date: 2016-01-12 12:55:40 -0700 (Tue, 12 Jan 2016)
New Revision: 1376
Added:
trunk/webapp/testsuite/api/init.jsp
trunk/webapp/testsuite/api/terminate.jsp
trunk/webapp/testsuite/api/user/terminate.jsp
trunk/webapp/testsuite/api/user/test.jsp
trunk/webapp/testsuite/css/qunit-theme-ninja.css
trunk/webapp/testsuite/index.jsp
Removed:
trunk/webapp/testsuite/test.html
Modified:
trunk/webapp/testsuite/api/user/init.jsp
trunk/webapp/testsuite/api/user/test.js
trunk/webapp/testsuite/classes/UserProfile/test.js
Log:
Added testing for User API calls
Fixed a unit test for the UserProfile class
Added a new theme
Replaced test.html with index.jsp which looks for a session before starting testing
Added: trunk/webapp/testsuite/api/init.jsp
===================================================================
--- trunk/webapp/testsuite/api/init.jsp (rev 0)
+++ trunk/webapp/testsuite/api/init.jsp 2016-01-12 19:55:40 UTC (rev 1376)
@@ -0,0 +1,45 @@
+<%@ page language="java" contentType="text/xml;charset=utf-8" %>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ page import="com.resolutions.ils.ILSSession" %>
+<%@ page import="com.resolutions.ils.data.UserProfile" %>
+<%
+ ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
+ if (ilsSession == null) {
+%>
+ <error message="not logged in" />
+<%
+ return;
+ }
+
+ // clear test user
+ UserProfile up = UserProfile.getUserProfile(ilsSession, "ts_APIUser");
+ if (up != null) {
+ UserProfile.deleteUserProfile(ilsSession, up.getUserProfileID());
+ up = UserProfile.getUserProfile(ilsSession, "ts_APIUser");
+ }
+ if (up != null) {
+%>
+ <error message="couldn't delete USERPRNUM ts_APIUser" />
+<%
+ return;
+ }
+
+ // create test api admin user we will use to run our api tests as
+ up = new UserProfile();
+ up.defaultAll();
+ up.setUserProfileNum("ts_APIUser");
+ up.setUserProfilePasswd("ts_APIUserPasswd");
+ up.setUserProfileAccessLevel(3);
+ up.saveNew(ilsSession);
+ up = UserProfile.getUserProfile(ilsSession, "ts_APIUser");
+ if (up == null) {
+%>
+ <error message="couldn't create USERPRNUM ts_APIUser" />
+<%
+ }
+ else {
+%>
+ <success message="successfully initialized for test" />
+<%
+ }
+%>
Added: trunk/webapp/testsuite/api/terminate.jsp
===================================================================
--- trunk/webapp/testsuite/api/terminate.jsp (rev 0)
+++ trunk/webapp/testsuite/api/terminate.jsp 2016-01-12 19:55:40 UTC (rev 1376)
@@ -0,0 +1,31 @@
+<%@ page language="java" contentType="text/xml;charset=utf-8" %>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ page import="com.resolutions.ils.ILSSession" %>
+<%@ page import="com.resolutions.ils.data.UserProfile" %>
+<%
+ ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
+ if (ilsSession == null) {
+%>
+ <error message="not logged in" />
+<%
+ return;
+ }
+
+ // clear test user
+ UserProfile up = UserProfile.getUserProfile(ilsSession, "ts_APIUser");
+ if (up != null) {
+ UserProfile.deleteUserProfile(ilsSession, up.getUserProfileID());
+ up = UserProfile.getUserProfile(ilsSession, "ts_APIUser");
+ }
+ if (up != null) {
+%>
+ <error message="couldn't delete USERPRNUM ts_APIUser" />
+<%
+ return;
+ }
+ else {
+%>
+ <success message="successfully terminated" />
+<%
+ }
+%>
\ No newline at end of file
Modified: trunk/webapp/testsuite/api/user/init.jsp
===================================================================
--- trunk/webapp/testsuite/api/user/init.jsp 2016-01-06 21:14:04 UTC (rev 1375)
+++ trunk/webapp/testsuite/api/user/init.jsp 2016-01-12 19:55:40 UTC (rev 1376)
@@ -12,44 +12,17 @@
}
// clear test user
- UserProfile up = UserProfile.getUserProfile(ilsSession, "apiUserTestUser");
+ UserProfile up = UserProfile.getUserProfile(ilsSession, "ts_UserTest");
if (up != null) {
UserProfile.deleteUserProfile(ilsSession, up.getUserProfileID());
- up = UserProfile.getUserProfile(ilsSession, "apiUserTestUser");
+ up = UserProfile.getUserProfile(ilsSession, "ts_UserTest");
}
if (up != null) {
%>
- <error message="couldn't delete apiUserTestUser" />
+ <error message="couldn't delete ts_UserTest" />
<%
return;
- }
-
- // clear test api admin user
- up = UserProfile.getUserProfile(ilsSession, "apiUserAdmin");
- if (up != null) {
- UserProfile.deleteUserProfile(ilsSession, up.getUserProfileID());
- up = UserProfile.getUserProfile(ilsSession, "apiUserAdmin");
- }
- if (up != null) {
-%>
- <error message="couldn't delete apiUserAdmin" />
-<%
- return;
- }
-
- // create test api admin user we will use to run our api tests as
- up = new UserProfile();
- up.defaultAll();
- up.setUserProfileNum("apiUserAdmin");
- up.setUserProfilePasswd("apiUserAdminPasswd");
- up.setUserProfileAccessLevel(3);
- up.saveNew(ilsSession);
- up = UserProfile.getUserProfile(ilsSession, "apiUserAdmin");
- if (up == null) {
-%>
- <error message="couldn't create apiUserAdmin" />
-<%
- }
+ }
else {
%>
<success message="successfully initialized for test" />
Added: trunk/webapp/testsuite/api/user/terminate.jsp
===================================================================
--- trunk/webapp/testsuite/api/user/terminate.jsp (rev 0)
+++ trunk/webapp/testsuite/api/user/terminate.jsp 2016-01-12 19:55:40 UTC (rev 1376)
@@ -0,0 +1,31 @@
+<%@ page language="java" contentType="text/xml;charset=utf-8" %>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ page import="com.resolutions.ils.ILSSession" %>
+<%@ page import="com.resolutions.ils.data.UserProfile" %>
+<%
+ ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
+ if (ilsSession == null) {
+%>
+ <error message="not logged in" />
+<%
+ return;
+ }
+
+ // clear test user
+ UserProfile up = UserProfile.getUserProfile(ilsSession, "ts_UserTest");
+ if (up != null) {
+ UserProfile.deleteUserProfile(ilsSession, up.getUserProfileID());
+ up = UserProfile.getUserProfile(ilsSession, "ts_UserTest");
+ }
+ if (up != null) {
+%>
+ <error message="couldn't delete USERPRNUM ts_UserTest" />
+<%
+ return;
+ }
+ else {
+%>
+ <success message="successfully terminated" />
+<%
+ }
+%>
\ No newline at end of file
Modified: trunk/webapp/testsuite/api/user/test.js
===================================================================
--- trunk/webapp/testsuite/api/user/test.js 2016-01-06 21:14:04 UTC (rev 1375)
+++ trunk/webapp/testsuite/api/user/test.js 2016-01-12 19:55:40 UTC (rev 1376)
@@ -1,85 +1,121 @@
-QUnit.asyncTest("API user object", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- $.post('api/user/init.jsp', {}, function(result) {
- assert.ok($(result).find('success'), $(result).find('success').attr('message'));
- var postData = {
- ILSUSER : 'apiUserAdmin',
- ILSPASSWD : 'apiUserAdminPasswd',
- USERPRNUM : 'apiUserTestUser',
- USERDATA : 'userData',
- USERPRPASSWD : 'apiUserTestPassword',
- USERPRSTATUSID : '0',
- USERPRFNAME : 'firstName',
- USERPRLNAME : 'middleName',
- empTitle : 'lastName',
- addr1 : 'addr1',
- addr2 : 'addr2',
- city : 'city',
- state : 'ST',
- zip : '98765',
- country : 'US',
- USERPREMAIL : 'test at user.com',
- phone : '(480)456-7890',
-/* we should add these to a test too
- USERPRHIREDATE : '',
- USERPRTERMDATE : '',
- CREATEGROUPONDEMAND : '',
- ILSGROUPROLE : '',
- ILSGROUPLOCATION : '',
-*/
- }
- $.post('../api/user/add/', postData, function(result) {
- assert.ok(result.trim(), 'OK');
+QUnit.asyncTest("User", function(assert) {
- $.post('../api/user/get/', postData, function(result) {
- /* check our create user test */
- var testUser = $(complete).find('createdUserTest', 'DataObject');
- assert.ok(testUser, 'found testUser');
- assert.equal($(testUser).find('USERPRNUM').text(), 'userProfileTestUser', 'userProfileNum ok');
- assert.equal($(testUser).find('USERPRPASSWD').text(), 'testPassword', 'userProfilePasswd ok');
- assert.equal($(testUser).find('USERPRFNAME').text(), 'firstName', 'userProfileFirstName ok');
- assert.equal($(testUser).find('USERPRMNAME').text(), 'middleName', 'userProfileMiddleName ok');
- assert.equal($(testUser).find('USERPRLNAME').text(), 'lastName', 'userProfileLastName ok');
- assert.equal($(testUser).find('USERPRSNAME').text(), 'suffixName', 'userProfileSuffixName ok');
- assert.equal($(testUser).find('USERPRSTATUSID').text(), '0', 'userProfileFirstName ok');
- assert.equal($(testUser).find('USERPRACCESSLEVEL').text(), '1', 'userProfileAccessLevel ok');
- assert.equal($(testUser).find('USERPREMPTITLEID').text(), '2', 'userProfileEmployeeTitleID ok');
- assert.equal($(testUser).find('USERPRACCESSMOD').text(), '3', 'userProfileAccessMode ok');
- assert.equal($(testUser).find('USERPRADDR1').text(), 'addr1', 'userProfileAddress1 ok');
- assert.equal($(testUser).find('USERPRADDR2').text(), 'addr2', 'userProfileAddress2 ok');
- assert.equal($(testUser).find('USERPRCITY').text(), 'city', 'userProfileCity ok');
- assert.equal($(testUser).find('USERPRSTATE').text(), 'ST', 'userProfileState ok');
- assert.equal($(testUser).find('USERPRZIP').text(), '98765', 'userProfileZip ok');
- assert.equal($(testUser).find('USERPRCOUNTRY').text(), 'US', 'userProfileCountry ok');
- assert.equal($(testUser).find('USERPREMAIL').text(), 'test at user.com', 'userProfileEMail ok');
- assert.equal($(testUser).find('USERPRPHONE').text(), '(480)456-7890', 'userProfilePhone ok');
+ // Clean up after we finish our test
+ function terminate() {
+ $.post("api/terminate.jsp", {}, function(result) {
+ assert.equal($(result).find('success').attr('message'), 'successfully terminated', 'succesfully terminated (general)');
- /* check our modify user test */
- var modUser = $(complete).find('modifiedUserTest', 'DataObject');
- assert.ok(modUser, 'found modUser');
- assert.equal($(modUser).find('USERPRNUM').text(), 'userProfileTestUser', 'modifiedUserProfileNum ok');
- assert.equal($(modUser).find('USERPRPASSWD').text(), 'testPasswor2', 'modifiedUserProfilePasswd ok');
- assert.equal($(modUser).find('USERPRFNAME').text(), 'firstNam2', 'modifiedUserProfileFirstName ok');
- assert.equal($(modUser).find('USERPRMNAME').text(), 'middleNam2', 'modifiedUserProfileMiddleName ok');
- assert.equal($(modUser).find('USERPRLNAME').text(), 'lastNam2', 'modifiedUserProfileLastName ok');
- assert.equal($(modUser).find('USERPRSNAME').text(), 'suffixNam2', 'modifiedUserProfileSuffixName ok');
- assert.equal($(modUser).find('USERPRSTATUSID').text(), '1', 'modifiedUserProfileFirstName ok');
- assert.equal($(modUser).find('USERPRACCESSLEVEL').text(), '2', 'modifiedUserProfileAccessLevel ok');
- assert.equal($(modUser).find('USERPREMPTITLEID').text(), '3', 'modifiedUserProfileEmployeeTitleID ok');
- assert.equal($(modUser).find('USERPRACCESSMOD').text(), '4', 'modifiedUserProfileAccessMode ok');
- assert.equal($(modUser).find('USERPRADDR1').text(), 'addr1-2', 'modifiedUserProfileAddress1 ok');
- assert.equal($(modUser).find('USERPRADDR2').text(), 'addr2-2', 'modifiedUserProfileAddress2 ok');
- assert.equal($(modUser).find('USERPRCITY').text(), 'cit2', 'modifiedUserProfileCity ok');
- assert.equal($(modUser).find('USERPRSTATE').text(), 'S2', 'modifiedUserProfileState ok');
- assert.equal($(modUser).find('USERPRZIP').text(), '98762', 'modifiedUserProfileZip ok');
- assert.equal($(modUser).find('USERPRCOUNTRY').text(), 'U2', 'modifiedUserProfileCountry ok');
- assert.equal($(modUser).find('USERPREMAIL').text(), 'test2 at user.com', 'modifiedUserProfileEMail ok');
- assert.equal($(modUser).find('USERPRPHONE').text(), '(480)456-7892', 'modifiedUserProfilePhone ok');
- QUnit.start();
+ $.post("api/user/terminate.jsp", {}, function(result) {
+ assert.equal($(result).find('success').attr('message'), 'successfully terminated', 'successfully terminated (user)');
+ }).fail(function() {
+ assert.ok(0, "failed to post to user/terminate");
});
+ }).fail(function() {
+ assert.ok(0, "failed to post to terminate")
+ }).always(function() {
+ QUnit.start();
});
+ }
+
+ $.post('api/init.jsp', {}, function(result) {
+ assert.equal($(result).find('success').attr('message'), 'successfully initialized for test', 'succesfully initialized (general)');
+
+
+ $.post('api/user/init.jsp', {}, function(result) {
+ assert.equal($(result).find("success").attr('message'), 'successfully initialized for test', 'succesfully initialized (user)');
+ var postData = {
+ ILSUSER : 'ts_APIUser',
+ ILSPASSWD : 'ts_APIUserPasswd',
+ loginID : 'ts_UserTest',
+ passwd : 'ts_UserTestPasswd',
+ firstName : 'firstName',
+ middleName : 'middleName',
+ lastName : 'lastName',
+ employeeTitle : '2',
+ addr1 : 'addr1',
+ addr2 : 'addr2',
+ city : 'city',
+ state : 'ST',
+ zip : '98765',
+ country : 'US',
+ email : 'test at user.com',
+ phone : '(480)456-7890',
+ hireDate : '12/12/2012',
+ termDate : '12/21/2012',
+ acessLevel : '1',
+ accessMode : '2',
+ action : 'create'
+ }
+
+ $.post('../api/user/put/', postData, function(result) {
+ assert.ok(1, 'posted to /api/user/put/ successfully');
+ assert.equal( $(result).find('success').length > 0 ? true : false, true, "user put returned successfully");
+
+
+ $.post('api/user/test.jsp', {}, function(result) {
+ var testUser = $(result).find('testUser', 'DataObject');
+ console.log(testUser);
+ assert.equal($(testUser).find('USERPRNUM').text(), 'ts_UserTest', 'userProfileNum ok');
+ assert.equal($(testUser).find('USERPRPASSWD').text(), 'ts_UserTestPasswd', 'userProfilePasswd ok');
+ assert.equal($(testUser).find('USERPRFNAME').text(), 'firstName', 'userProfileFirstName ok');
+ assert.equal($(testUser).find('USERPRLNAME').text(), 'lastName', 'userProfileLastName ok');
+ assert.equal($(testUser).find('USERPRSTATUSID').text(), '1', 'userProfileStatusID ok');
+ assert.equal($(testUser).find('USERPRACCESSLEVEL').text(), '1', 'userProfileAccessLevel ok');
+ assert.equal($(testUser).find('USERPREMPTITLEID').text(), '2', 'userProfileEmployeeTitleID ok');
+ assert.equal($(testUser).find('USERPRADDR1').text(), 'addr1', 'userProfileAddress1 ok');
+ assert.equal($(testUser).find('USERPRADDR2').text(), 'addr2', 'userProfileAddress2 ok');
+ assert.equal($(testUser).find('USERPRCITY').text(), 'city', 'userProfileCity ok');
+ assert.equal($(testUser).find('USERPRSTATE').text(), 'ST', 'userProfileState ok');
+ assert.equal($(testUser).find('USERPRZIP').text(), '98765', 'userProfileZip ok');
+ assert.equal($(testUser).find('USERPRCOUNTRY').text(), 'US', 'userProfileCountry ok');
+ assert.equal($(testUser).find('USERPREMAIL').text(), 'test at user.com', 'userProfileEmail ok');
+ assert.equal($(testUser).find('USERPRPHONE').text(), '(480)456-7890', 'userProfilePhone ok');
+
+ });
+
+
+ // Get the test user
+ var getUserPostData = {
+ ILSUSER : 'ts_APIUser',
+ ILSPASSWD : 'ts_APIUserPasswd',
+ loginID : 'ts_UserTest'
+ }
+
+ $.post('../api/user/get/', getUserPostData, function(result) {
+ assert.ok(1, 'posted to /api/user/get/ successfully');
+ console.log(result);
+ assert.equal( $(result).find('userProfiles').length > 0 ? true : false, true, "user get returned successfully");
+
+ assert.equal($(result).find('firstName').text(), 'firstName', 'get firstName ok');
+ assert.equal($(result).find('middleName').text(), 'middleName', 'get middleName ok');
+ assert.equal($(result).find('lastName').text(), 'lastName', 'get lastName ok');
+ assert.equal($(result).find('employeeTitle').text(), '2', 'get employeeTitle ok');
+ assert.equal($(result).find('addr1').text(), 'addr1', 'get addr1 ok');
+ assert.equal($(result).find('addr2').text(), 'addr2', 'get addr2 ok');
+ assert.equal($(result).find('city').text(), 'city', 'get city ok');
+ assert.equal($(result).find('state').text(), 'ST', 'get state ok');
+ assert.equal($(result).find('zip').text(), '98765', 'get zip ok');
+ assert.equal($(result).find('country').text(), 'US', 'get country ok');
+ assert.equal($(result).find('email').text(), 'test at user.com', 'get email ok');
+ assert.equal($(result).find('phone').text(), '(480)456-7890', 'get phone ok');
+ assert.equal($(result).find('hireDate').text(), 'Wed Dec 12 00:00:00 MST 2012', 'get hireDate ok');
+ assert.equal($(result).find('termDate').text(), 'Fri Dec 21 00:00:00 MST 2012', 'get termDate ok');
+ assert.equal($(result).find('access').attr('level'), 1, 'get accessLevel ok');
+ assert.equal($(result).find('access').attr('mode'), 2, 'get accessMode ok');
+
+
+ terminate();
+
+ }).fail(function() {
+ assert.ok(0, 'posting to /api/user/get/ failed');
+ terminate();
+ });
+
+ }).fail(function() {
+ assert.ok(0, "posting to /api/user/put/ failed");
+ });
+ });
+
});
});
Added: trunk/webapp/testsuite/api/user/test.jsp
===================================================================
--- trunk/webapp/testsuite/api/user/test.jsp (rev 0)
+++ trunk/webapp/testsuite/api/user/test.jsp 2016-01-12 19:55:40 UTC (rev 1376)
@@ -0,0 +1,27 @@
+<%@ page language="java" contentType="text/xml;charset=utf-8" %>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ page import="com.resolutions.ils.ILSSession" %>
+<%@ page import="com.resolutions.ils.data.UserProfile" %>
+<%
+ ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
+ if (ilsSession == null) {
+%>
+ <error message="not logged in" />
+<%
+ return;
+ }
+
+ UserProfile testUser = UserProfile.getUserProfile(ilsSession, "ts_UserTest");
+ if (testUser == null) {
+%>
+ <error message="testUser is null" />
+<%
+ return;
+ }
+
+%>
+<complete>
+ <testUser>
+ <%= testUser %>
+ </testUser>
+</complete>
\ No newline at end of file
Modified: trunk/webapp/testsuite/classes/UserProfile/test.js
===================================================================
--- trunk/webapp/testsuite/classes/UserProfile/test.js 2016-01-06 21:14:04 UTC (rev 1375)
+++ trunk/webapp/testsuite/classes/UserProfile/test.js 2016-01-12 19:55:40 UTC (rev 1376)
@@ -14,7 +14,7 @@
assert.equal($(testUser).find('USERPRMNAME').text(), 'middleName', 'userProfileMiddleName ok');
assert.equal($(testUser).find('USERPRLNAME').text(), 'lastName', 'userProfileLastName ok');
assert.equal($(testUser).find('USERPRSNAME').text(), 'suffixName', 'userProfileSuffixName ok');
- assert.equal($(testUser).find('USERPRSTATUSID').text(), '0', 'userProfileFirstName ok');
+ assert.equal($(testUser).find('USERPRSTATUSID').text(), '0', 'userProfileStatusID ok');
assert.equal($(testUser).find('USERPRACCESSLEVEL').text(), '1', 'userProfileAccessLevel ok');
assert.equal($(testUser).find('USERPREMPTITLEID').text(), '2', 'userProfileEmployeeTitleID ok');
assert.equal($(testUser).find('USERPRACCESSMOD').text(), '3', 'userProfileAccessMode ok');
@@ -36,7 +36,7 @@
assert.equal($(modUser).find('USERPRMNAME').text(), 'middleNam2', 'modifiedUserProfileMiddleName ok');
assert.equal($(modUser).find('USERPRLNAME').text(), 'lastNam2', 'modifiedUserProfileLastName ok');
assert.equal($(modUser).find('USERPRSNAME').text(), 'suffixNam2', 'modifiedUserProfileSuffixName ok');
- assert.equal($(modUser).find('USERPRSTATUSID').text(), '1', 'modifiedUserProfileFirstName ok');
+ assert.equal($(modUser).find('USERPRSTATUSID').text(), '1', 'modifiedUserProfileStatusID ok');
assert.equal($(modUser).find('USERPRACCESSLEVEL').text(), '2', 'modifiedUserProfileAccessLevel ok');
assert.equal($(modUser).find('USERPREMPTITLEID').text(), '3', 'modifiedUserProfileEmployeeTitleID ok');
assert.equal($(modUser).find('USERPRACCESSMOD').text(), '4', 'modifiedUserProfileAccessMode ok');
Added: trunk/webapp/testsuite/css/qunit-theme-ninja.css
===================================================================
--- trunk/webapp/testsuite/css/qunit-theme-ninja.css (rev 0)
+++ trunk/webapp/testsuite/css/qunit-theme-ninja.css 2016-01-12 19:55:40 UTC (rev 1376)
@@ -0,0 +1,201 @@
+/**
+ * QUnit Ninja Theme by Jamie Hoover v1.1.0
+ *
+ * https://github.com/Krinkle/qunit-theme-ninja
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * https://jquery.org/license/
+ */
+body {
+ background:#111 no-repeat -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(1, #111));
+ background:#111 no-repeat -webkit-linear-gradient(top, #222 0%, #111 100%);
+ background:#111 no-repeat -moz-linear-gradient(top, #222 0%, #111 100%);
+ background:#111 no-repeat -o-linear-gradient(top, #222 0%, #111 100%);
+ background:#111 no-repeat -ms-linear-gradient(top, #222 0%, #111 100%);
+ background:#111 no-repeat linear-gradient(top, #222 0%, #111 100%);
+ color:#ccc;
+ font:12px/16px "Lucida Grande",sans-serif;
+ margin:0 auto;
+ max-width:1024px;
+ min-width:800px;
+ padding:24px;
+ position:relative;
+}
+#qunit-header {
+ font-size:24px;
+ line-height:1;
+ margin:0 520px 0 0;
+}
+#qunit-header > a {
+ color:#ccc;
+ text-decoration:none;
+}
+#qunit-header > a:hover {
+ color:#ccc;
+ text-decoration:underline;
+}
+#qunit-testresult {
+ font:12px/12px "Menlo",monospace;
+ margin:0;
+ position:absolute;
+ right:24px;
+ top:20px;
+}
+#qunit-testresult .module-name {
+ font-weight:bold;
+}
+#qunit-testresult br {
+ content:'';
+}
+#qunit-testresult span:before {
+ content:' ';
+}
+#qunit-testresult span.failed {
+ color:#c33;
+}
+#qunit-testresult span.passed {
+ color:#6c6;
+}
+#qunit-testrunner-toolbar {
+ position:absolute;
+ right:24px;
+ top:40px;
+}
+#qunit-testrunner-toolbar input {
+ font:inherit;
+ margin:0 6px 0 24px;
+}
+#qunit-testrunner-toolbar label {
+ display:inline-block;
+}
+#qunit-testrunner-toolbar select {
+ margin-left: 48px;
+}
+#qunit-modulefilter-container label {
+ display:none;
+}
+#qunit-banner {
+ height:1px;
+ margin:24px 0;
+}
+#qunit-banner.qunit-fail {
+ background-color:#c33;
+}
+#qunit-banner.qunit-pass {
+ background-color:#6c6;
+}
+#qunit-tests {
+ color:#666;
+ font:12px/24px "Menlo",monospace;
+ list-style-position:inside;
+ padding:0;
+}
+#qunit-tests b.counts {
+ font-weight:normal;
+}
+#qunit-tests b.counts b {
+ font-weight:normal;
+}
+#qunit-tests.hidepass li.pass,#qunit-tests.hidepass li.running {
+ display:none;
+}
+#qunit-tests li a {
+ color:#666;
+ padding: 0 6px;
+ text-decoration:none;
+}
+#qunit-tests li a:hover {
+ color:#ccc;
+}
+#qunit-tests li a:hover,
+#qunit-tests li strong:hover {
+ text-decoration:underline;
+}
+#qunit-tests li b.counts {
+ color:#666;
+}
+#qunit-tests li .runtime {
+ font-size: smaller;
+}
+#qunit-tests li.fail span.test-message {
+ color:#c33;
+}
+#qunit-tests li.fail strong {
+ color:#c33;
+}
+#qunit-tests li.fail strong b.counts b.failed {
+ color:#c33;
+}
+#qunit-tests li.pass b.passed {
+ color:#6c6;
+}
+#qunit-tests li.pass span.test-message {
+ color:#6c6;
+}
+#qunit-tests li.pass strong {
+ color:#ccc;
+}
+#qunit-tests li strong {
+ font-weight:normal;
+}
+#qunit-tests li strong:hover {
+ cursor:pointer;
+}
+#qunit-tests ol {
+ list-style-position:inside;
+ padding:0 0 0 22px;
+}
+#qunit-tests ol li table {
+ border-collapse:collapse;
+}
+#qunit-tests ol li table td pre {
+ background-color:#222;
+ -webkit-border-radius:4px;
+ border-radius:4px;
+ color:#ccc;
+ font:inherit;
+ margin:3px 0 3px 12px;
+ padding:12px 24px;
+ white-space:pre-wrap;
+ word-wrap:break-word;
+}
+#qunit-tests ol li table th {
+ font-weight:normal;
+}
+#qunit-tests ol li table th,#qunit-tests ol li table td {
+ padding:0;
+ vertical-align:top;
+}
+#qunit-tests ol li table tr.test-actual {
+ color:#c33;
+}
+#qunit-tests ol li table tr.test-diff del {
+ color:#6c6;
+}
+#qunit-tests ol li table tr.test-diff del,#qunit-tests ol li table tr.test-diff ins {
+ text-decoration:none;
+}
+#qunit-tests ol li table tr.test-diff ins {
+ color:#c33;
+}
+#qunit-tests ol li table tr.test-expected {
+ color:#6c6;
+}
+#qunit-tests ol li table tr.test-source pre {
+ padding:12px 24px 12px 0;
+}
+#qunit-userAgent {
+ color:#666;
+ font:9px/9px "Menlo",monospace;
+}
+#qunit-fixture {
+ position:absolute;
+ height:768px;
+ left:-1024px;
+ top:-768px;
+ width:1024px;
+}
+.qunit-collapsed {
+ display: none;
+}
Added: trunk/webapp/testsuite/index.jsp
===================================================================
--- trunk/webapp/testsuite/index.jsp (rev 0)
+++ trunk/webapp/testsuite/index.jsp 2016-01-12 19:55:40 UTC (rev 1376)
@@ -0,0 +1,95 @@
+<%@ page language="java" contentType="text/html;charset=utf-8" %>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ page import="com.resolutions.ils.ILSSession" %>
+
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>iLS Unit Tests</title>
+ <link rel="stylesheet" href="css/qunit-theme-ninja.css"
+</head>
+<body>
+<%
+ ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
+ if (ilsSession == null) {
+%>
+ <h2>Please log into the iLS before accessing this page: <a href="/ils/login.jsp" >Login</a>
+<%
+ } else {
+%>
+
+ <div id="qunit"></div>
+ <div id="qunit-fixture"></div>
+ <script src="js/qunit-1.15.0.js"></script>
+ <script src="../js/jquery/jquery.min.js"></script>
+
+ <script> QUnit.module("Classes"); </script>
+
+ <script src="classes/UserProfile/test.js"></script>
+
+ <script src="classes/Title/test.js"></script>
+
+ <script src="classes/SecurityMode/test.js"></script>
+
+ <script src="classes/Resource/test.js"></script>
+
+ <script src="classes/Group/test.js"></script>
+
+ <script src="classes/Course/test.js"></script>
+
+ <script src="classes/CourseAttempt/test.js"></script>
+
+ <script src="classes/Compliance/test.js"></script>
+
+ <script src="classes/Announcement/test.js"></script>
+
+ <script> QUnit.module("API"); </script>
+
+ <script src="api/user/test.js"></script>
+
+ <script>
+ QUnit.asyncTest("API course object", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ QUnit.asyncTest("API courseattempt object", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ QUnit.asyncTest("API group object", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ </script>
+
+ <script> QUnit.module("UI"); </script>
+ <script>
+ QUnit.asyncTest("login", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ QUnit.asyncTest("employee courses required", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ QUnit.asyncTest("user search", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ QUnit.asyncTest("student records", function(assert) {
+ assert.ok("ok", "ok");
+ QUnit.start();
+ return;
+ });
+ </script>
+<%
+ }
+%>
+</body>
+</html>
Deleted: trunk/webapp/testsuite/test.html
===================================================================
--- trunk/webapp/testsuite/test.html 2016-01-06 21:14:04 UTC (rev 1375)
+++ trunk/webapp/testsuite/test.html 2016-01-12 19:55:40 UTC (rev 1376)
@@ -1,79 +0,0 @@
-<html>
-<head>
- <meta charset="utf-8">
- <title>iLS Unit Tests</title>
- <link rel="stylesheet" href="css/qunit-1.15.0.css">
-</head>
-<body>
- <div id="qunit"></div>
- <div id="qunit-fixture"></div>
- <script src="js/qunit-1.15.0.js"></script>
- <script src="../js/jquery/jquery.min.js"></script>
-
- <script> QUnit.module("Classes"); </script>
-
- <script src="classes/UserProfile/test.js"></script>
-
- <script src="classes/Title/test.js"></script>
-
- <script src="classes/SecurityMode/test.js"></script>
-
- <script src="classes/Resource/test.js"></script>
-
- <script src="classes/Group/test.js"></script>
-
- <script src="classes/Course/test.js"></script>
-
- <script src="classes/CourseAttempt/test.js"></script>
-
- <script src="classes/Compliance/test.js"></script>
-
- <script src="classes/Announcement/test.js"></script>
-
- <script> QUnit.module("API"); </script>
-
- <script src="api/user/test.js"></script>
-
- <script>
- QUnit.asyncTest("API course object", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- QUnit.asyncTest("API courseattempt object", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- QUnit.asyncTest("API group object", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- </script>
-
- <script> QUnit.module("UI"); </script>
- <script>
- QUnit.asyncTest("login", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- QUnit.asyncTest("employee courses required", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- QUnit.asyncTest("user search", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- QUnit.asyncTest("student records", function(assert) {
- assert.ok("ok", "ok");
- QUnit.start();
- return;
- });
- </script>
-</body>
-</html>
More information about the Ils-source
mailing list