forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://source.sakaiproject.org/svn/providers/trunk@9187 66ffb92e-73f9-0310-93c1-f5514f145a0a
- Loading branch information
Glenn R. Golden
committed
May 9, 2006
1 parent
996ac60
commit 65eb3ba
Showing
14 changed files
with
1,330 additions
and
1,061 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 25 additions & 40 deletions
65
providers/imsent/src/java/org/sakaiproject/component/imsent/user/IMSEntProviderUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,65 @@ | ||
/********************************************************************************** | ||
* $URL$ | ||
* $Id$ | ||
********************************************************************************** | ||
*********************************************************************************** | ||
* | ||
* Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan, Trustees of Indiana University, | ||
* Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation | ||
* Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation. | ||
* | ||
* Licensed under the Educational Community License Version 1.0 (the "License"); | ||
* By obtaining, using and/or copying this Original Work, you agree that you have read, | ||
* understand, and will comply with the terms and conditions of the Educational Community License. | ||
* You may obtain a copy of the License at: | ||
* Licensed under the Educational Community License, Version 1.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://cvs.sakaiproject.org/licenses/license_1_0.html | ||
* http://www.opensource.org/licenses/ecl1.php | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE | ||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
**********************************************************************************/ | ||
|
||
/* | ||
* Created on May 6, 2005 | ||
* | ||
* TODO To change the template for this generated file go to | ||
* Window - Preferences - Java - Code Style - Code Templates | ||
*/ | ||
package org.sakaiproject.component.imsent.user; | ||
|
||
import org.sakaiproject.service.legacy.authzGroup.GroupProvider; | ||
import org.sakaiproject.service.legacy.coursemanagement.CourseManagementProvider; | ||
import org.sakaiproject.service.legacy.user.UserDirectoryProvider; | ||
import org.sakaiproject.authz.api.GroupProvider; | ||
import org.sakaiproject.user.api.UserDirectoryProvider; | ||
|
||
public class IMSEntProviderUnitTest { | ||
public class IMSEntProviderUnitTest | ||
{ | ||
|
||
/********************************************************************************************************************************************************************************************************************************************************** | ||
* In-House Unit Check | ||
*********************************************************************************************************************************************************************************************************************************************************/ | ||
|
||
// TODO: Make these real unit tests | ||
|
||
private static boolean m_passUnitTest = true; | ||
|
||
private static void passFail(boolean testVal, String message) | ||
{ | ||
if (testVal) | ||
{ | ||
System.out.println("Passed unit Test"+message); | ||
System.out.println("Passed unit Test" + message); | ||
} | ||
else | ||
{ | ||
System.out.println("Failed Unit Test:"+message); | ||
m_passUnitTest = false; | ||
System.out.println("Failed Unit Test:" + message); | ||
m_passUnitTest = false; | ||
} | ||
} | ||
|
||
public static boolean localUnitTests(UserDirectoryProvider udp, GroupProvider rp, | ||
CourseManagementProvider cp) | ||
public static boolean localUnitTests(UserDirectoryProvider udp, GroupProvider rp) | ||
{ | ||
m_passUnitTest = true; // Assume we pass | ||
if ( udp != null ) | ||
m_passUnitTest = true; // Assume we pass | ||
if (udp != null) | ||
{ | ||
passFail( ! udp.userExists("user1"), "Checking existing user retrieval (user1)"); | ||
passFail ( udp.userExists("user7"), "Non existent user test (user7)"); | ||
passFail(!udp.userExists("user1"), "Checking existing user retrieval (user1)"); | ||
passFail(udp.userExists("user7"), "Non existent user test (user7)"); | ||
} | ||
if ( rp != null ) | ||
if (rp != null) | ||
{ | ||
System.out.println("Testing RP"); | ||
} | ||
if ( cp != null ) | ||
{ | ||
System.out.println("Testing CP"); | ||
} | ||
|
||
return m_passUnitTest; | ||
|
||
} | ||
} |
Oops, something went wrong.