001package org.apache.turbine.test; 002 003 004/* 005 * Licensed to the Apache Software Foundation (ASF) under one 006 * or more contributor license agreements. See the NOTICE file 007 * distributed with this work for additional information 008 * regarding copyright ownership. The ASF licenses this file 009 * to you under the Apache License, Version 2.0 (the 010 * "License"); you may not use this file except in compliance 011 * with the License. You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, 016 * software distributed under the License is distributed on an 017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 018 * KIND, either express or implied. See the License for the 019 * specific language governing permissions and limitations 020 * under the License. 021 */ 022 023 024import org.apache.avalon.framework.logger.AbstractLogEnabled; 025import org.apache.avalon.framework.activity.Initializable; 026import org.apache.avalon.framework.activity.Disposable; 027import org.apache.avalon.framework.context.Contextualizable; 028import org.apache.avalon.framework.context.Context; 029import org.apache.avalon.framework.context.ContextException; 030 031/** 032 * Implementation of the test component. 033 * 034 * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a> 035 * @version $Id$ 036 */ 037public class TestComponentImpl 038 extends AbstractLogEnabled 039 implements Initializable, Disposable, TestComponent, Contextualizable 040{ 041 private String appRoot; 042 043 @Override 044 public void initialize() throws Exception 045 { 046 // empty 047 } 048 049 @Override 050 public void dispose() 051 { 052 // empty 053 } 054 055 @Override 056 public void test() 057 { 058 setupLogger(this, "TestComponent"); 059 getLogger().debug("test"); 060 getLogger().debug("componentAppRoot = "+appRoot); 061 } 062 063 @Override 064 public void contextualize(Context context) throws ContextException 065 { 066 appRoot = (String) context.get("componentAppRoot"); 067 } 068}