FileDocCategorySizeDatePackage
LoggingHelperTest.javaAPI DocGlassfish v2 API6639Fri May 04 22:24:04 BST 2007com.sun.enterprise.management.ext.logging

LoggingHelperTest

public final class LoggingHelperTest extends com.sun.enterprise.management.AMXTestBase
Test the LoggingHelper.

Fields Summary
private static final int
HOUR_MILLIS
Constructors Summary
public LoggingHelperTest()

	
Methods Summary
public com.sun.appserv.management.helper.LoggingHelpercreateHelper(com.sun.appserv.management.ext.logging.Logging logging)

	    return new LoggingHelper( logging );
	
final java.util.SetgetAllLogging()

	    return getQueryMgr().queryJ2EETypeSet( XTypes.LOGGING );
	
public voidtestQueryAll()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
    	    final LogQueryResult[]    results  = helper.queryAll();
    	    for( final LogQueryResult result : results )
    	    {
    	        validateResult( result );
    	    }
	    }
	
public voidtestQueryAllCurrent()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
    	    final LogQueryResult    result  =  helper.queryAllCurrent();
    	    validateResult( result );
    	}
	
public voidtestQueryAllInFile()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
    	    final String[]  names   = logging.getLogFileNames( SERVER_KEY );
    	    for( final String name : names )
    	    {
        	    final LogQueryResult    result  = helper.queryAllInFile( name );
        	    validateResult( result );
    	    }
	    }
	
public voidtestQueryServerLogLevel()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
    	    final LogQueryResult    result  = 
    	        helper.queryServerLog( LOWEST_SUPPORTED_QUERY_LEVEL );
    	    validateResult( result );
    	}
	
public voidtestQueryServerLogLevelAndModules()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
	        final LogQueryResult    result  = 
	            helper.queryServerLog( LOWEST_SUPPORTED_QUERY_LEVEL,
	            LogModuleNames.ALL_NAMES );
	        validateResult( result );
	    }
	
public voidtestQueryServerLogRecent()

	     
	
	
	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
    	    final LogQueryResult    result  = 
    	        helper.queryServerLogRecent( HOUR_MILLIS );
    	    validateResult( result );
    	}
	
public voidtestQueryServerLogRecentWithModules()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
	        
    	    final LogQueryResult    result  = 
    	        helper.queryServerLogRecent(
    	            HOUR_MILLIS, LogModuleNames.ALL_NAMES );
    	    validateResult( result );
    	 }
	
public voidtestQueryServerLogSingle()

	    final Set<Logging>  loggings    = getAllLogging();
	    
	    for( final Logging logging : loggings )
	    {
	        final LoggingHelper helper  = createHelper( logging );
    	    final LogQueryResult    result  = 
    	        helper.queryServerLog( LOWEST_SUPPORTED_QUERY_LEVEL, "EJB" );
    	    validateResult( result );
	    }
	
private voidvalidateResult(com.sun.appserv.management.ext.logging.LogQueryResult result)

	    assert( result != null );
	    assert( result.getFieldNames() != null );
	    assert( result.getEntries() != null );