CAS Unit Tests
Clover coverage report - CAS Unit Tests
Coverage timestamp: Mon Jul 4 2005 18:13:17 CDT
file stats: LOC: 79   Methods: 3
NCLOC: 52   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PostPackageTests.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 PostPackageTests 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 PostPackageTests(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 TestGrantUser2.setParams(casPort);
 67  0 super.run(result);
 68    } catch (Exception e) {
 69  0 e.printStackTrace();
 70  0 result.addError(this, e);
 71    }
 72    }
 73   
 74  0 public static Test suite() throws Exception {
 75  0 TestSuite suite = new PostPackageTests("CAS Service Tests");
 76  0 suite.addTestSuite(TestGrantUser2.class);
 77  0 return suite;
 78    }
 79    }