Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ajdt-dev] Running JUnit Plug-in test with extended HierarchyBuilder

Hi Juergen,

I've experience similar problems when mocking up unit tests.  It usually
boils down to one of the following:
1) The test project(s) that you set up are not getting created or deleted
properly.  You can add assertions to the setup and cleanup to verify this.
2) The code that you are testing is running an asyncExec somewhere, so that
even though the compile finishes properly, it does so after your unit test
has had failed.

(2) is more likely, so I suggest walking through the call graph of
buildRefresh() to see if there is an asyncExec called either on
workbench.getDisplay() or by running a Job.  Then see if there is a method
that you can call directly. 

Fyi, lately I've been giving some classes a "syncExecMode" flag purely for
the purpose of having a predictable way of testing them.

Mik

> -----Original Message-----
> From: ajdt-dev-bounces@xxxxxxxxxxx [mailto:ajdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Juergen Graf
> Sent: October 3, 2005 12:12 AM
> To: Ajdt Development
> Subject: [ajdt-dev] Running JUnit Plug-in test with extended
> HierarchyBuilder
> 
> Hi Ajdt Folks,
> 
> as proposed by Mik Kersten (thanks Mik, i would be stuck in the middle
> of nowhere without your help) i extented the hierarchy builder in order
> to extract all information i can get from the aspectj compiler.
> Now its about testing my implementation and i (have been) decided to
> include JUnit plug-in tests for my project. Very strange things happen
> when i try to run those tests. Once in a while, mostly on a fresh
> restarted system, everything works fine. But most of the time the
> example projects do not seem to be compiled using my extended version of
> the hierarchy builder. As i'm not getting any error message i don't know
> where to start.
> I trigger the build in the following way:
> 
> AjBuildManager.setAsmHierarchyBuilder(ExtendedAsmHierarchyBuilder.getInsta
> nce());
> ...
> AspectJPlugin.getDefault().setCurrentProject(project);
> ...
> Ajde.getDefault().getBuildManager().buildFresh();
> 
> Perhaps I missed an important call or missused the interface. But when
> operating manually in the run-time workbench it's working just fine...
> 
> I'll be happy about any comments regarding this problem.
> 
> Best regards,
> Juergen
> --
> Juergen Graf <aspectj@xxxxxxxxxxxxxxxxx>
> 
> "When the solution is simple, God is answering."
>   --  Albert Einstein
> _______________________________________________
> ajdt-dev mailing list
> ajdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ajdt-dev



Back to the top