CAS Unit Tests
Clover coverage report - CAS Unit Tests
Coverage timestamp: Mon Jul 4 2005 18:13:17 CDT
file stats: LOC: 86   Methods: 3
NCLOC: 59   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PackageTests.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.service;
 12   
 13    import junit.framework.Test;
 14    import junit.framework.TestSuite;
 15    import junit.framework.TestResult;
 16   
 17    import java.io.FileInputStream;
 18   
 19    import java.util.Properties;
 20   
 21    import org.globus.cas.CASPortType;
 22   
 23    import org.globus.cas.impl.databaseAccess.CasDBOptions;
 24    import org.globus.cas.impl.databaseAccess.CasDBStorage;
 25   
 26    import org.globus.axis.util.Util;
 27   
 28    import org.globus.cas.utils.TestSetup;
 29   
 30    /**
 31    * Tests for CAS server package
 32    */
 33    public class PackageTests extends TestSuite {
 34   
 35    static {
 36  0 Util.registerTransport();
 37  0 org.globus.wsrf.impl.security.authentication.wssec.GSSConfig.init();
 38    }
 39   
 40  0 public PackageTests(String name) {
 41  0 super(name);
 42    }
 43   
 44  0 public void run(TestResult result) {
 45  0 try {
 46  0 String propFileName = System.getProperty("casTestProperties");
 47  0 Properties prop = new Properties();
 48  0 prop.load(new FileInputStream(propFileName));
 49  0 String host = (String)prop.getProperty("host");
 50  0 String port = (String)prop.getProperty("port");
 51  0 CasDBOptions casDbOption =
 52    new CasDBOptions(prop.getProperty("dbDriver"),
 53    prop.getProperty("dbConnectionURL"),
 54    prop.getProperty("dbUsername"),
 55    prop.getProperty("dbPassword"));
 56  0 System.out.println("dbConnection "
 57    + prop.getProperty("dbConnectionURL"));
 58  0 CasDBStorage.setupDBConnection(casDbOption);
 59   
 60  0 String securityType = (String)prop.getProperty("securityType");
 61  0 String protType = (String)prop.getProperty("protectionType");
 62   
 63  0 TestSetup testSetup = new TestSetup(host, port, securityType,
 64    protType);
 65  0 CASPortType casPort = testSetup.getCasPort();
 66  0 TestSelfEnrollPermissions.setParams(casPort);
 67  0 TestSelfUnenrollPermissions.setParams(casPort);
 68  0 TestQueries.setParams(casPort);
 69  0 TestAssertionGeneration.setParams(casPort);
 70  0 TestGrantUser1.setParams(casPort);
 71  0 super.run(result);
 72    } catch(Exception e) {
 73  0 result.addError(this, e);
 74    }
 75    }
 76   
 77  0 public static Test suite() throws Exception {
 78  0 TestSuite suite = new PackageTests("CAS Service Tests");
 79  0 suite.addTestSuite(TestSelfEnrollPermissions.class);
 80  0 suite.addTestSuite(TestSelfUnenrollPermissions.class);
 81  0 suite.addTestSuite(TestQueries.class);
 82  0 suite.addTestSuite(TestAssertionGeneration.class);
 83  0 suite.addTestSuite(TestGrantUser1.class);
 84  0 return suite;
 85    }
 86    }