CAS Unit Tests
Clover coverage report - CAS Unit Tests
Coverage timestamp: Mon Jul 4 2005 18:13:17 CDT
file stats: LOC: 131   Methods: 1
NCLOC: 76   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PopulateImplicitObjectData.java - 0% 0% 0%
coverage
 1    /*
 2    * Portions of this file Copyright 1999-2005 University of Chicago
 3    * Portions of this file Copyright 1999-2005 The University of Southern California.
 4    *
 5    * This file or a portion of this file is licensed under the
 6    * terms of the Globus Toolkit Public License, found at
 7    * http://www.globus.org/toolkit/download/license.html.
 8    * If you redistribute this file, with or without
 9    * modifications, you must include this notice in the file.
 10    */
 11    package org.globus.cas.impl.bootstrap;
 12   
 13    import org.globus.cas.impl.CasConstants;
 14   
 15    import org.globus.cas.types.ObjectData;
 16    import org.globus.cas.types.NamespaceData;
 17    import org.globus.cas.types.ServiceTypeData;
 18   
 19    import org.globus.cas.impl.databaseAccess.ObjectDataHandler;
 20    import org.globus.cas.impl.databaseAccess.NamespaceDataHandler;
 21    import org.globus.cas.impl.databaseAccess.ServiceTypeDataHandler;
 22    import org.globus.cas.impl.databaseAccess.ServiceTypeActionHandler;
 23   
 24    public class PopulateImplicitObjectData {
 25   
 26  0 public static void populateDb() throws Exception {
 27   
 28    // CAS Namespace
 29  0 NamespaceData nsData = new NamespaceData();
 30  0 nsData.setNickname(CasConstants.NAMESPACE_SELF);
 31  0 nsData.setBasename("baseName");
 32  0 nsData.setComparisonAlg(CasConstants.EXACT_ALG_CLASSNAME);
 33  0 NamespaceDataHandler.storeObject(nsData);
 34   
 35    // casServer as object
 36  0 ObjectData objData = new ObjectData();
 37  0 objData.setObjectName(CasConstants.OBJECT_SELF);
 38  0 objData.setObjectNamespace(CasConstants.NAMESPACE_SELF);
 39  0 ObjectDataHandler.storeObject(objData);
 40   
 41    // cas as service type
 42  0 ServiceTypeData serviceType = new ServiceTypeData();
 43  0 serviceType.setName(CasConstants.SERVICETYPE_CAS);
 44  0 ServiceTypeDataHandler.storeObject(serviceType);
 45   
 46    // cas/enroll_anchor
 47  0 ServiceTypeActionHandler.addServiceActionMapping(
 48    CasConstants.SERVICETYPE_CAS,
 49    CasConstants.ACTION_ENROLL_ANCHOR);
 50   
 51    // cas/enroll_user
 52  0 ServiceTypeActionHandler.addServiceActionMapping(
 53    CasConstants.SERVICETYPE_CAS,
 54    CasConstants.ACTION_ENROLL_USER);
 55   
 56    //cas/enroll_namespace
 57  0 ServiceTypeActionHandler.addServiceActionMapping(
 58    CasConstants.SERVICETYPE_CAS,
 59    CasConstants.ACTION_ENROLL_NAMESPACE);
 60   
 61    //cas/enroll_object
 62  0 ServiceTypeActionHandler.addServiceActionMapping(
 63    CasConstants.SERVICETYPE_CAS,
 64    CasConstants.ACTION_ENROLL_OBJECT);
 65   
 66    // cas/enroll_ServiceType
 67  0 ServiceTypeActionHandler.addServiceActionMapping(
 68    CasConstants.SERVICETYPE_CAS,
 69    CasConstants.ACTION_CREATE_SERVICE_TYPE);
 70   
 71    // cas/create_object_group
 72  0 ServiceTypeActionHandler.addServiceActionMapping(
 73    CasConstants.SERVICETYPE_CAS,
 74    CasConstants.ACTION_CREATE_OBJECT_GROUP);
 75   
 76    // cas/create_user_group
 77  0 ServiceTypeActionHandler.addServiceActionMapping(
 78    CasConstants.SERVICETYPE_CAS,
 79    CasConstants.ACTION_CREATE_USER_GROUP);
 80   
 81    // cas/create_serviceAction_group
 82  0 ServiceTypeActionHandler.addServiceActionMapping(
 83    CasConstants.SERVICETYPE_CAS,
 84    CasConstants.ACTION_CREATE_SERVICEACTION_GROUP);
 85   
 86    //cas/unenroll
 87  0 ServiceTypeActionHandler.addServiceActionMapping(
 88    CasConstants.SERVICETYPE_CAS,
 89    CasConstants.ACTION_UNENROLL);
 90   
 91    //cas/delete_group
 92  0 ServiceTypeActionHandler.addServiceActionMapping(
 93    CasConstants.SERVICETYPE_CAS,
 94    CasConstants.ACTION_DELETE_GROUP);
 95   
 96    //cas/add_group_entry
 97  0 ServiceTypeActionHandler.addServiceActionMapping(
 98    CasConstants.SERVICETYPE_CAS,
 99    CasConstants.ACTION_ADD_GROUP_ENTRY);
 100   
 101    //cas/delete_group_entry
 102  0 ServiceTypeActionHandler.addServiceActionMapping(
 103    CasConstants.SERVICETYPE_CAS,
 104    CasConstants.ACTION_REMOVE_GROUP_ENTRY);
 105   
 106    //cas/grant
 107  0 ServiceTypeActionHandler.addServiceActionMapping(
 108    CasConstants.SERVICETYPE_CAS,
 109    CasConstants.ACTION_GRANT);
 110   
 111    //cas/grantAll
 112  0 ServiceTypeActionHandler.addServiceActionMapping(
 113    CasConstants.SERVICETYPE_CAS,
 114    CasConstants.ACTION_GRANTALL);
 115   
 116    //cas/revoke
 117  0 ServiceTypeActionHandler.addServiceActionMapping(
 118    CasConstants.SERVICETYPE_CAS,
 119    CasConstants.ACTION_REVOKE);
 120   
 121    //cas/superuser
 122  0 ServiceTypeActionHandler.addServiceActionMapping(
 123    CasConstants.SERVICETYPE_CAS,
 124    CasConstants.ACTION_SU);
 125   
 126    //cas/query
 127  0 ServiceTypeActionHandler.addServiceActionMapping(
 128    CasConstants.SERVICETYPE_CAS,
 129    CasConstants.ACTION_QUERY);
 130    }
 131    }