You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2003/03/01 05:20:14 UTC
cvs commit: avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/otherpkg Service2.java Service3.java
donaldp 2003/02/28 20:20:14
Added: src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test
InfoAssert.java InfoBuilderTestCase.java
src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data
QDoxComponent1-info.xml QDoxComponent1.java
QDoxLegacyComponent1-info.xml
QDoxLegacyComponent1.java Service1.java
component1-info.xml component2.xinfo
component3-info.xml component4-info.xml
src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/otherpkg
Service2.java Service3.java
Log:
incorporate the unit tests
Revision Changes Path
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/InfoAssert.java
Index: InfoAssert.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test;
import junit.framework.Assert;
import org.apache.avalon.phoenix.framework.info.Attribute;
import org.apache.avalon.phoenix.framework.info.ComponentDescriptor;
import org.apache.avalon.phoenix.framework.info.ComponentInfo;
import org.apache.avalon.phoenix.framework.info.ContextDescriptor;
import org.apache.avalon.phoenix.framework.info.DependencyDescriptor;
import org.apache.avalon.phoenix.framework.info.EntryDescriptor;
import org.apache.avalon.phoenix.framework.info.LoggerDescriptor;
import org.apache.avalon.phoenix.framework.info.ServiceDescriptor;
import org.apache.avalon.phoenix.framework.info.SchemaDescriptor;
/**
* A set of utilities for asserting facts about info objects.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
*/
public class InfoAssert
{
public static void assertEqualStructure( final String message,
final ComponentInfo expected,
final ComponentInfo actual )
{
final ComponentDescriptor expectedComponent = expected.getDescriptor();
final ComponentDescriptor actualComponent = actual.getDescriptor();
assertEqualAttributes( message + ": Component.attribute",
expectedComponent.getAttributes(),
actualComponent.getAttributes() );
assertEqualFeatures( message, expected, actual );
}
public static void assertEqualInfos( final String message,
final ComponentInfo expected,
final ComponentInfo actual )
{
final ComponentDescriptor expectedComponent = expected.getDescriptor();
final ComponentDescriptor actualComponent = actual.getDescriptor();
assertEqualComponents( message, expectedComponent, actualComponent );
assertEqualFeatures( message, expected, actual );
}
public static void assertEqualFeatures( final String message,
final ComponentInfo expected,
final ComponentInfo actual )
{
final LoggerDescriptor[] expectedLoggers = expected.getLoggers();
final LoggerDescriptor[] actualLoggers = actual.getLoggers();
assertEqualLoggers( message, expectedLoggers, actualLoggers );
final SchemaDescriptor expectedSchema = expected.getConfigurationSchema();
final SchemaDescriptor actualSchema = actual.getConfigurationSchema();
assertEqualSchema( message + "/Configuration", expectedSchema, actualSchema );
final SchemaDescriptor expectedPSchema = expected.getParametersSchema();
final SchemaDescriptor actualPSchema = actual.getParametersSchema();
assertEqualSchema( message + "/Parameters", expectedPSchema, actualPSchema );
final ContextDescriptor expectedContext = expected.getContext();
final ContextDescriptor actualContext = actual.getContext();
assertEqualContext( message, expectedContext, actualContext );
final ServiceDescriptor[] expectedServices = expected.getServices();
final ServiceDescriptor[] actualServices = actual.getServices();
assertEqualServices( message, expectedServices, actualServices );
final DependencyDescriptor[] expectedDeps = expected.getDependencies();
final DependencyDescriptor[] actualDeps = actual.getDependencies();
assertEqualDeps( message, expectedDeps, actualDeps );
}
private static void assertEqualSchema( final String message,
final SchemaDescriptor expected,
final SchemaDescriptor actual )
{
if( null == expected && null == actual )
{
return;
}
else if( null == expected )
{
Assert.fail( "Null expected but non-null actual" );
}
else if( null == actual )
{
Assert.fail( "Null actual but non-null expected" );
}
Assert.assertEquals( message + ": Schema.type",
expected.getType(),
actual.getType() );
Assert.assertEquals( message + ": Schema.type",
expected.getType(),
actual.getType() );
Assert.assertEquals( message + ": Schema.location",
expected.getLocation(),
actual.getLocation() );
}
public static void assertEqualDeps( final String message,
final DependencyDescriptor[] expected,
final DependencyDescriptor[] actual )
{
Assert.assertEquals( message + ": Dependencys.length", expected.length, actual.length );
for( int i = 0; i < expected.length; i++ )
{
Assert.assertEquals( message + ": Dependencys[ " + i + "].service",
expected[ i ].getType(),
actual[ i ].getType() );
Assert.assertEquals( message + ": Dependencys[ " + i + "].key",
expected[ i ].getKey(),
actual[ i ].getKey() );
assertEqualAttributes( message + ": Dependencys[ " + i + "].attributes",
expected[ i ].getAttributes(),
actual[ i ].getAttributes() );
}
}
public static void assertEqualServices( final String message,
final ServiceDescriptor[] expected,
final ServiceDescriptor[] actual )
{
Assert.assertEquals( message + ": Services.length", expected.length, actual.length );
for( int i = 0; i < expected.length; i++ )
{
final String prefix = message + ": Services[ " + i + "]";
final ServiceDescriptor expectedService = expected[ i ];
final ServiceDescriptor actualService = actual[ i ];
assertEqualService( prefix, expectedService, actualService );
}
}
private static void assertEqualService( final String message,
final ServiceDescriptor expected,
final ServiceDescriptor actual )
{
Assert.assertEquals( message + ".type",
expected.getType(),
actual.getType() );
assertEqualAttributes( message + ".attributes",
expected.getAttributes(),
actual.getAttributes() );
}
public static void assertEqualLoggers( final String message,
final LoggerDescriptor[] expected,
final LoggerDescriptor[] actual )
{
Assert.assertEquals( message + ": Loggers.length", expected.length, actual.length );
for( int i = 0; i < expected.length; i++ )
{
Assert.assertEquals( message + ": Loggers[ " + i + "].name",
expected[ i ].getName(), actual[ i ].getName() );
assertEqualAttributes( message + ": Loggers[ " + i + "].attributes",
expected[ i ].getAttributes(), actual[ i ].getAttributes() );
}
}
public static void assertEqualContext( final String message,
final ContextDescriptor expected,
final ContextDescriptor actual )
{
Assert.assertEquals( message + ": Context.type", expected.getType(), actual.getType() );
assertEqualEntrys( message + ": Context.entrys", expected.getEntrys(), expected.getEntrys() );
assertEqualAttributes( message + ": Context.attribute",
expected.getAttributes(),
actual.getAttributes() );
}
public static void assertEqualEntrys( final String message,
final EntryDescriptor[] expected,
final EntryDescriptor[] actual )
{
Assert.assertEquals( message + " Length", expected.length, actual.length );
for( int i = 0; i < expected.length; i++ )
{
Assert.assertEquals( message + " [" + i + "].key",
expected[ i ].getKey(), actual[ i ].getKey() );
Assert.assertEquals( message + " [" + i + "].type",
expected[ i ].getType(), actual[ i ].getType() );
assertEqualAttributes( message + " [" + i + "].attribute",
expected[ i ].getAttributes(),
actual[ i ].getAttributes() );
}
}
public static void assertEqualComponents( final String message,
final ComponentDescriptor expected,
final ComponentDescriptor actual )
{
Assert.assertEquals( message + ": Component.type", expected.getImplementationKey(),
actual.getImplementationKey() );
assertEqualAttributes( message + ": Component.attribute",
expected.getAttributes(),
actual.getAttributes() );
}
public static void assertEqualParameters( final String message,
final Attribute expected,
final Attribute actual )
{
final String[] expectedNames = expected.getParameterNames();
final String[] actualNames = actual.getParameterNames();
Assert.assertEquals( message + " Length", expectedNames.length, actualNames.length );
for( int i = 0; i < expectedNames.length; i++ )
{
final String name = expectedNames[ i ];
Assert.assertEquals( message + " value",
expected.getParameter( name ),
actual.getParameter( name ) );
}
}
protected static void assertEqualAttributes( final String message,
final Attribute[] expected,
final Attribute[] actual )
{
Assert.assertEquals( message + " Length", expected.length, actual.length );
for( int i = 0; i < expected.length; i++ )
{
Assert.assertEquals( message + " [" + i + "].name",
expected[ i ].getName(), actual[ i ].getName() );
assertEqualParameters( message + " [" + i + "].parameters",
expected[ i ], actual[ i ] );
}
}
}
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/InfoBuilderTestCase.java
Index: InfoBuilderTestCase.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test;
import com.thoughtworks.qdox.JavaDocBuilder;
import com.thoughtworks.qdox.model.JavaClass;
import com.thoughtworks.qdox.model.JavaSource;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Properties;
import junit.framework.TestCase;
import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.avalon.phoenix.framework.info.Attribute;
import org.apache.avalon.phoenix.framework.info.ComponentDescriptor;
import org.apache.avalon.phoenix.framework.info.ComponentInfo;
import org.apache.avalon.phoenix.framework.info.ContextDescriptor;
import org.apache.avalon.phoenix.framework.info.DependencyDescriptor;
import org.apache.avalon.phoenix.framework.info.EntryDescriptor;
import org.apache.avalon.phoenix.framework.info.LoggerDescriptor;
import org.apache.avalon.phoenix.framework.info.SchemaDescriptor;
import org.apache.avalon.phoenix.framework.info.ServiceDescriptor;
import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.phoenix.framework.tools.infobuilder.InfoBuilder;
import org.apache.avalon.phoenix.framework.tools.infobuilder.InfoReader;
import org.apache.avalon.phoenix.framework.tools.infobuilder.InfoWriter;
import org.apache.avalon.phoenix.framework.tools.infobuilder.SerializedInfoReader;
import org.apache.avalon.phoenix.framework.tools.infobuilder.SerializedInfoWriter;
import org.apache.avalon.phoenix.framework.tools.infobuilder.XMLInfoReader;
import org.apache.avalon.phoenix.framework.tools.infobuilder.XMLInfoWriter;
import org.apache.avalon.phoenix.framework.tools.infobuilder.LegacyBlockInfoReader;
import org.apache.avalon.phoenix.framework.tools.infobuilder.LegacyBlockInfoWriter;
import org.apache.avalon.phoenix.framework.tools.qdox.DefaultInfoBuilder;
import org.apache.avalon.phoenix.framework.tools.qdox.LegacyInfoBuilder;
/**
* Abstract class which TestCases can extend.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
*/
public class InfoBuilderTestCase
extends TestCase
{
private static final String BASE_PACKAGE =
"org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.";
private static final String BASE_DIR = '/' + BASE_PACKAGE.replace( '.', '/' );
private static final String COMPONENT1 = BASE_PACKAGE + "component1";
private static final String COMPONENT2 = BASE_PACKAGE + "component2";
private static final String COMPONENT3 = BASE_PACKAGE + "component3";
private static final String COMPONENT4 = BASE_PACKAGE + "component4";
private static final String SOURCE1 = BASE_DIR + "QDoxComponent1.java";
private static final String SOURCE1_INFO = BASE_PACKAGE + "QDoxComponent1";
private static final String LSOURCE1 = BASE_DIR + "QDoxLegacyComponent1.java";
private static final String LSOURCE1_INFO = BASE_PACKAGE + "QDoxLegacyComponent1";
public InfoBuilderTestCase( String name )
{
super( name );
}
public void testLoadXMLComponent1()
throws Exception
{
final ComponentInfo actual = loadComponentInfo( COMPONENT1 );
final ComponentInfo expected = createDummyComponentInfo();
InfoAssert.assertEqualInfos( COMPONENT1 + " should be equal to constructed actual",
expected,
actual );
}
public void testLoadLegacyComponent()
throws Exception
{
final ComponentInfo actual = loadComponentInfo( COMPONENT2 );
final ComponentInfo expected = loadComponentInfo( COMPONENT3 );
InfoAssert.assertEqualStructure( COMPONENT2 + " should be identical to " + COMPONENT3,
expected,
actual );
}
public void testLoadParametersComponent()
throws Exception
{
final ComponentInfo actual = loadComponentInfo( COMPONENT4 );
final ComponentInfo expected = createComponentInfoWithParameters();
InfoAssert.assertEqualStructure( COMPONENT4 + " should be identical to " + COMPONENT4,
expected,
actual );
}
private ComponentInfo createComponentInfoWithParameters()
{
final ComponentDescriptor component =
new ComponentDescriptor( "org.realityforge.Component1", Attribute.EMPTY_SET );
final SchemaDescriptor schema =
new SchemaDescriptor( "",
"",
Attribute.EMPTY_SET );
return new ComponentInfo( component,
ServiceDescriptor.EMPTY_SET,
LoggerDescriptor.EMPTY_SET,
ContextDescriptor.EMPTY_CONTEXT,
DependencyDescriptor.EMPTY_SET,
null,
schema );
}
public void testWriteSerComponent1()
throws Exception
{
runWriteReadTest( createDummyComponentInfo(),
new SerializedInfoWriter(),
new SerializedInfoReader() );
}
public void testWriteXMLComponent1()
throws Exception
{
runWriteReadTest( createDummyComponentInfo(),
new XMLInfoWriter(),
new XMLInfoReader() );
}
public void testWriteLegacyXMLComponent1()
throws Exception
{
final ComponentInfo info = loadComponentInfo( COMPONENT2 );
runWriteReadTest( info,
new LegacyBlockInfoWriter(),
new LegacyBlockInfoReader() );
}
public void testQDoxScan()
throws Exception
{
final ComponentInfo expected = loadComponentInfo( SOURCE1_INFO );
final JavaClass javaClass = loadJavaSource( SOURCE1 );
final DefaultInfoBuilder infoBuilder = new DefaultInfoBuilder();
final ComponentInfo actual = infoBuilder.buildComponentInfo( javaClass );
InfoAssert.assertEqualInfos( " ComponentInfo generated from source file",
expected,
actual );
}
public void testLegacyQDoxScan()
throws Exception
{
final ComponentInfo expected = loadComponentInfo( LSOURCE1_INFO );
final JavaClass javaClass = loadJavaSource( LSOURCE1 );
final LegacyInfoBuilder infoBuilder = new LegacyInfoBuilder();
final ComponentInfo actual = infoBuilder.buildComponentInfo( javaClass );
InfoAssert.assertEqualInfos( " ComponentInfo generated from source file",
expected,
actual );
}
private JavaClass loadJavaSource( final String resource )
{
final JavaDocBuilder builder = new JavaDocBuilder();
final InputStream inputStream = getClass().getResourceAsStream( resource );
assertNotNull( "resource " + resource + " not null", inputStream );
final Reader reader = new InputStreamReader( inputStream );
builder.addSource( reader );
final JavaSource[] sources = builder.getSources();
assertEquals( "sources.length", 1, sources.length );
final JavaSource source = sources[ 0 ];
final JavaClass[] classes = source.getClasses();
assertEquals( "source.getClasses()", 1, classes.length );
return classes[ 0 ];
}
private void runWriteReadTest( final ComponentInfo expected,
final InfoWriter writer,
final InfoReader reader )
throws Exception
{
ContainerUtil.enableLogging( writer, new ConsoleLogger() );
final File output = File.createTempFile( "info-test", ".xml" );
final FileOutputStream outputStream = new FileOutputStream( output );
writer.writeComponentInfo( expected, outputStream );
outputStream.close();
ContainerUtil.enableLogging( reader, new ConsoleLogger() );
final String implementationKey = expected.getDescriptor().getImplementationKey();
final FileInputStream inputStream = new FileInputStream( output );
final ComponentInfo actual = reader.createComponentInfo( implementationKey, inputStream );
inputStream.close();
//output.deleteOnExit();
//output.delete();
InfoAssert.assertEqualInfos( " Dummy ComponentInfo written out and read back " +
"in again should be equal",
expected,
actual );
}
private ComponentInfo createDummyComponentInfo()
{
final ComponentDescriptor component =
new ComponentDescriptor( "org.realityforge.Component1", Attribute.EMPTY_SET );
final LoggerDescriptor logger1 = new LoggerDescriptor( "", Attribute.EMPTY_SET );
final LoggerDescriptor logger2 = new LoggerDescriptor( "audit", Attribute.EMPTY_SET );
final LoggerDescriptor[] loggers = new LoggerDescriptor[]{logger1, logger2};
final EntryDescriptor entry1 = new EntryDescriptor( "mbean",
"javax.jmx.MBeanServer",
false,
Attribute.EMPTY_SET );
final EntryDescriptor[] entrys = new EntryDescriptor[]{entry1};
final ContextDescriptor context =
new ContextDescriptor( "org.apache.avalon.phoenix.BlockContext",
entrys,
Attribute.EMPTY_SET );
final ServiceDescriptor service1 = createServiceDescriptor();
final ServiceDescriptor[] services = new ServiceDescriptor[]{service1};
final DependencyDescriptor dependency1 =
new DependencyDescriptor( "org.realityforge.Service2",
"org.realityforge.Service2",
true,
Attribute.EMPTY_SET );
final DependencyDescriptor dependency2 =
new DependencyDescriptor( "foo",
"org.realityforge.Service3",
false,
Attribute.EMPTY_SET );
final DependencyDescriptor[] deps =
new DependencyDescriptor[]{dependency1, dependency2};
final SchemaDescriptor schema =
new SchemaDescriptor( "",
"http://relaxng.org/ns/structure/1.0",
Attribute.EMPTY_SET );
return new ComponentInfo( component, services, loggers,
context, deps, schema, null );
}
private ServiceDescriptor createServiceDescriptor()
{
final Properties parameters = new Properties();
parameters.setProperty( "display-name", "Special Service" );
parameters.setProperty( "description-key", "service1.desc" );
final Attribute attribute = new Attribute( "doc", parameters );
final Attribute[] attributes = new Attribute[]{attribute};
return new ServiceDescriptor( "org.realityforge.Service1", attributes );
}
protected ComponentInfo loadComponentInfo( final String classname )
throws Exception
{
final ClassLoader classLoader = getClass().getClassLoader();
return createInfoBuilder().buildComponentInfo( classname, classLoader );
}
private InfoBuilder createInfoBuilder()
{
final InfoBuilder builder = new InfoBuilder();
builder.enableLogging( new ConsoleLogger() );
return builder;
}
}
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/QDoxComponent1-info.xml
Index: QDoxComponent1-info.xml
===================================================================
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE component-info
PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/info/componentinfo_1_0.dtd" >
<component-info>
<component type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.QDoxComponent1"/>
<loggers>
<logger/>
<logger name="foo"/>
</loggers>
<context>
<entry key="foo" type="java.lang.ClassLoader"/>
<entry key="bar" type="org.apache.avalon.framework.logger.Logger"/>
<entry key="baz" type="java.io.File"/>
</context>
<services>
<service type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.Service1"/>
<service type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2"/>
<service type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"/>
</services>
<dependencies>
<dependency key="foo" type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"/>
<dependency type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"/>
<dependency type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2" optional="true"/>
</dependencies>
<configuration-schema type="http://relaxng.org/ns/structure/1.0"/>
</component-info>
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/QDoxComponent1.java
Index: QDoxComponent1.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test.data;
import java.io.Serializable;
import org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2;
import org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.logger.Logger;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.context.Contextualizable;
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
/**
* A simple avalon component to test QDox loading of info etc.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
* @avalon.component
* @avalon.service type="Service1"
* @avalon.service type="Service2"
* @avalon.service type="Service3"
*/
public class QDoxComponent1
extends AbstractLogEnabled
implements Serializable, Service1, Service2, Service3, Serviceable, Contextualizable, Configurable
{
/**
* @avalon.logger
* @avalon.logger name="foo"
*/
public void enableLogging( Logger logger )
{
super.enableLogging( logger );
}
/**
* @avalon.context type="Context"
* @avalon.entry key="foo" type="ClassLoader"
* @avalon.entry key="bar" type="Logger"
* @avalon.entry key="baz" type="java.io.File"
*/
public void contextualize( Context context )
throws ContextException
{
}
/**
* @avalon.dependency key="foo" type="Service3"
* @avalon.dependency type="Service3"
* @avalon.dependency type="Service2" optional="true"
*/
public void service( ServiceManager manager )
throws ServiceException
{
}
/**
* @avalon.configuration type="http://relaxng.org/ns/structure/1.0"
*/
public void configure( Configuration configuration )
throws ConfigurationException
{
}
}
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/QDoxLegacyComponent1-info.xml
Index: QDoxLegacyComponent1-info.xml
===================================================================
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE component-info
PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/info/componentinfo_1_0.dtd" >
<component-info>
<component type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.QDoxLegacyComponent1"/>
<context type="org.apache.avalon.phoenix.BlockContext" />
<services>
<service type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.Service1"/>
<service type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2"/>
<service type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"/>
</services>
<dependencies>
<dependency key="foo" type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"/>
<dependency type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"/>
<dependency type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2"/>
</dependencies>
<configuration-schema type="http://relaxng.org/ns/structure/1.0"/>
</component-info>
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/QDoxLegacyComponent1.java
Index: QDoxLegacyComponent1.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test.data;
import java.io.Serializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2;
import org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3;
/**
* A simple avalon component to test QDox loading of info etc.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
* @phoenix:block
* @phoenix:service name="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.Service1"
* @phoenix:service name="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2"
* @phoenix:service name="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"
*/
public class QDoxLegacyComponent1
extends AbstractLogEnabled
implements Serializable, Service1, Service2, Service3, Serviceable, Configurable
{
/**
* @phoenix:dependency role="foo" name="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"
* @phoenix:dependency name="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service3"
* @phoenix:dependency name="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg.Service2"
*/
public void service( ServiceManager manager )
throws ServiceException
{
}
/**
* @phoenix:configuration-schema type="relax-ng"
*/
public void configure( Configuration configuration )
throws ConfigurationException
{
}
}
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/Service1.java
Index: Service1.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test.data;
/**
* Some random service
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
*/
public interface Service1
{
}
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/component1-info.xml
Index: component1-info.xml
===================================================================
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE component-info
PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/info/componentinfo_1_0.dtd" >
<component-info>
<component type="org.realityforge.Component1"/>
<loggers>
<logger/>
<logger name="audit"/>
</loggers>
<context type="org.apache.avalon.phoenix.BlockContext">
<entry key="mbean" type="javax.jmx.MBeanServer"/>
</context>
<services>
<service type="org.realityforge.Service1">
<attribute name="doc">
<param name="display-name" value="Special Service"/>
<param name="description-key" value="service1.desc"/>
</attribute>
</service>
</services>
<dependencies>
<dependency type="org.realityforge.Service2" optional="true" />
<dependency key="foo" type="org.realityforge.Service3"/>
</dependencies>
<configuration-schema type="http://relaxng.org/ns/structure/1.0"/>
</component-info>
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/component2.xinfo
Index: component2.xinfo
===================================================================
<?xml version="1.0"?>
<!DOCTYPE blockinfo PUBLIC "-//PHOENIX/Block Info DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/phoenix/blockinfo_1.0.dtd">
<blockinfo>
<!-- section to describe block -->
<block>
<version>1.0</version>
<schema-type>relax-ng</schema-type>
</block>
<!-- services that are offered by this block -->
<services>
<service name="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"/>
</services>
<!-- interfaces that may be exported to manange this block -->
<management-access-points>
<service name="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler2"/>
</management-access-points>
<!-- services that are required by this block -->
<dependencies>
<dependency>
<service name="org.apache.avalon.cornerstone.services.threads.ThreadManager"/>
</dependency>
</dependencies>
</blockinfo>
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/component3-info.xml
Index: component3-info.xml
===================================================================
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE component-info
PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/info/componentinfo_1_0.dtd" >
<component-info>
<!-- This component should be identical to the one loaded out of component2 blockinfo -->
<component type="org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.component3">
<attribute name="phoenix:version">
<param name="version" value="1.0"/>
</attribute>
</component>
<context type="org.apache.avalon.phoenix.BlockContext"/>
<services>
<service type="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"/>
<service type="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler2">
<attribute name="phoenix:mx"/>
</service>
</services>
<dependencies>
<dependency type="org.apache.avalon.cornerstone.services.threads.ThreadManager"/>
</dependencies>
<configuration-schema type="http://relaxng.org/ns/structure/1.0"/>
</component-info>
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/component4-info.xml
Index: component4-info.xml
===================================================================
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE component-info
PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/info/componentinfo_1_0.dtd" >
<component-info>
<component type="org.realityforge.Component1"/>
<parameters-schema/>
</component-info>
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/otherpkg/Service2.java
Index: Service2.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg;
/**
* Some random service
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
*/
public interface Service2
{
}
1.1 avalon-phoenix/src/test/org/apache/avalon/phoenix/framework/tools/infobuilder/test/data/otherpkg/Service3.java
Index: Service3.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.framework.tools.infobuilder.test.data.otherpkg;
/**
* Some random service
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/03/01 04:20:14 $
*/
public interface Service3
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org