[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: VFSStructureBuilderUnitTestCase todo

adrian@jboss.org do-not-reply at jboss.com
Wed Mar 12 10:30:08 EDT 2008


These tests are broken in two ways. ;-)

1) NO "" CONTEXT


  |       Deployment deployment = createDeployment();
  |       StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
  |       MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
  |       attachments.addAttachment(StructureMetaData.class, structure);
  | 

It is creating a structure with no contexts then comparing it against
an artifical context it creates in the tests???? :-)


  |       protected void checkDeployment(DeploymentContext context, Deployment deployment) throws Exception
  |    {
  |       assertNotNull(context);
  |       
  |       assertEquals(deployment.getName(), context.getName());
  |       
  |       MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
  |       StructureMetaData structure = attachments.getAttachment(StructureMetaData.class);
  |       checkAttachments(context, deployment);
  |       checkDeployment(context, structure);
  | 
  | // HERE!
  | 
  |       ContextInfo contextInfo = structure.getContext("");
  |       if (contextInfo == null)
  |          contextInfo = StructureMetaDataFactory.createContextInfo();
  |       checkContextInfo(context, contextInfo);
  |    }
  | 

I should probably be adding the "" context to the stucture before running it
through the builder.

2) VFSStructureBuilderUnitTestCase SHOULD USE THE FILESYSTEM

But , this is stupid anyway. Because the VFSStructureBuilderUnitTestCase 
should be creating the structure from the file system. ;-)
The whole test needs cloning rather subclassing (and before you ask,
you can remove the attachment checks since they are irrelevant to the test).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135964#4135964

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135964



More information about the jboss-dev-forums mailing list