TestScript.groovy revision 7dcb2f62e25d05f2afeb4e79f10102350d7c2c7b
563N/A/*
563N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
563N/A *
563N/A * Copyright (c) 2013 ForgeRock AS. All rights reserved.
563N/A *
563N/A * The contents of this file are subject to the terms
563N/A * of the Common Development and Distribution License
563N/A * (the License). You may not use this file except in
6983N/A * compliance with the License.
6983N/A *
563N/A * You can obtain a copy of the License at
563N/A * http://forgerock.org/license/CDDLv1.0.html
563N/A * See the License for the specific language governing
563N/A * permission and limitations under the License.
6983N/A *
6983N/A * When distributing Covered Code, include this CDDL
6983N/A * Header Notice in each file and include the License file
6983N/A * at http://forgerock.org/license/CDDLv1.0.html
563N/A * If applicable, add the following below the CDDL Header,
563N/A * with the fields enclosed by brackets [] replaced by
563N/A * your own identifying information:
563N/A * "Portions Copyrighted [year] [name of copyright owner]"
563N/A */
4972N/Aimport groovy.sql.Sql;
6238N/Aimport groovy.sql.DataSet;
563N/A
563N/A// Parameters:
563N/A// The connector sends the following:
563N/A// connection: handler to the SQL connection
563N/A// action: a string describing the action ("TEST" here)
563N/A// log: a handler to the Log facility
563N/A
662N/Alog.info("Entering "+action+" Script");
662N/Adef sql = new Sql(connection);
1473N/A
1473N/A// a relatively-cheap query to run on start up to ensure database connectivity
563N/Asql.eachRow("select * from recon limit 1", { println it.objectid} );
1405N/Asql.eachRow("select * from activity limit 1", { println it.objectid} );
563N/Asql.eachRow("select * from access limit 1", { println it.objectid} );
563N/A
563N/A