TestScript.groovy revision 7f6887b5c5e1d621fbbb48d93b8ac940521d1e38
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay/*
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay *
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * Copyright (c) 2013-2014 ForgeRock AS. All rights reserved.
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay *
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * The contents of this file are subject to the terms
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * of the Common Development and Distribution License
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * (the License). You may not use this file except in
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * compliance with the License.
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay *
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * You can obtain a copy of the License at
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * http://forgerock.org/license/CDDLv1.0.html
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * See the License for the specific language governing
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * permission and limitations under the License.
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay *
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * When distributing Covered Code, include this CDDL
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * Header Notice in each file and include the License file
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * at http://forgerock.org/license/CDDLv1.0.html
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * If applicable, add the following below the CDDL Header,
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * with the fields enclosed by brackets [] replaced by
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * your own identifying information:
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay * "Portions Copyrighted [year] [name of copyright owner]"
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay */
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemayimport groovy.sql.Sql;
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemayimport org.identityconnectors.common.logging.Log;
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemayimport java.sql.Connection;
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay// Parameters:
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay// The connector sends the following:
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay// connection: handler to the SQL connection
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay// action: a string describing the action ("TEST" here)
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay// log: a handler to the Log facility
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemaydef sql = new Sql(connection as Connection);
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemaydef log = log as Log;
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemaylog.info("Entering Test Script");
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay// a relatively-cheap query to run on start up to ensure database connectivity
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemaysql.eachRow("select * from auditrecon limit 1", { } );
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemaysql.eachRow("select * from auditactivity limit 1", { } );
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemaysql.eachRow("select * from auditaccess limit 1", { } );
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay
3b9de50fdf0980762d6930a49e1a0f20b61a6f6bJason Lemay