FileDocCategorySizeDatePackage
DeploymentStatusTest.javaAPI DocGlassfish v2 API8206Fri May 04 22:24:04 BST 2007com.sun.enterprise.management.deploy

DeploymentStatusTest

public final class DeploymentStatusTest extends TestCase

Fields Summary
Constructors Summary
public DeploymentStatusTest()

	
Methods Summary
private com.sun.appserv.management.deploy.DeploymentStatusImplcreateDeploymentStatus(java.lang.Object deployID)

		final DeploymentStatusImpl	ds	=
			new DeploymentStatusImpl( 
			0,
			"success",
			"description",
			null );
		
		final Throwable	t	= new Exception( "test", new Throwable( "test2" ) );
		
		ds.setStageThrowable( t );
		assert( ds.getStageThrowable() == t );
		
		return( ds );
	
public voidtestCreateDeploymentStatus()

		createDeploymentStatus( "dummy" );
	
public voidtestCreateDeploymentStatusFromDeploymentStatus()

		final DeploymentStatusFoo	foo	= new DeploymentStatusFoo();
		final DeploymentStatusImpl	ds	= new DeploymentStatusImpl( foo );
		
		assert( foo.equals( ds ) );
		assert( ds.equals( foo ) );
	
public voidtestDeploymentStatusAsMap()

		final DeploymentStatusImpl	ds	= createDeploymentStatus( "dummy" );
		
		final Map<String,Serializable>	m	= ds.asMap();
	
public voidtestDeploymentStatusFromMap()

		final DeploymentStatusImpl	ds	= createDeploymentStatus( "dummy" );
		final DeploymentStatusFoo	stage1	= new DeploymentStatusFoo();
		ds.addSubStage( stage1 );
		
		final Map<String,Serializable>	data	= ds.asMap();
		
		final DeploymentStatusImpl ds2	= new DeploymentStatusImpl( data );
		
		assert( ds2.equals( ds ) );
	
public voidtestDeploymentStatusSubStages()

		final DeploymentStatusFoo	stage1	= new DeploymentStatusFoo();
		final DeploymentStatusFoo	stage2	= new DeploymentStatusFoo();
		final DeploymentStatusFoo	stage1_1	= new DeploymentStatusFoo();
		final DeploymentStatusFoo	stage2_1	= new DeploymentStatusFoo();
		
		final DeploymentStatusImpl	root	= createDeploymentStatus( "root" );
		assert( stage1.getParent() == null );
		root.addSubStage( stage1 );
		assert( stage1.getParent() == root );
		root.addSubStage( stage2 );
		assert( stage2.getParent() == root );
		stage1.addSubStage( stage1_1 );
		assert( stage1_1.getParent() == stage1 );
		stage2.addSubStage( stage2_1 );
		assert( stage2_1.getParent() == stage2 );
		
		final List<DeploymentStatus> subStages = root.getSubStagesList();
		assert( subStages.get(0) == stage1 );
		assert( subStages.get(1) == stage2 );
	
public voidtestIllegalThrowableDetected()

		final DeploymentStatusImpl	root	= createDeploymentStatus( "root" );
		
		final Throwable	t	= new MyException( new MyException() );
		root.setStageThrowable( t );
		assert( root.getStageThrowable() != t );