Re: A problem about file distribution

Philip Aston <[email protected]> Mon, 27 Feb 2012 07:57:54 +0000
Newsgroups gmane.comp.java.grinder.devel
Message-ID <[email protected]>
I think the problem is that the FDH believes the agents to be up to date.

Try distribution.setDirectory(directory). If this works, the problem is
that you haven't created a WireFireDistribution
(container.addComponent(WireFileDistribution.class) to link the
FileDistribution with the ConsoleProperties.

- Phil

On 21/02/12 08:32, Mavlarn Tuohuti wrote:
> We have a system using Grinder to test. We wrapped the controller to
> run in a web application.
>
> Now I met a problem, every time I use a new directory
> as distribution directory, then the files can not be distributed to
> agent side. But, if I use one directory and modify the properties,
> then there is no problem.
>
> In my test, I have 2 directories, test1 and test2, and I switch
> between these 2 dir and test continuously. But the file will never be
> distributed to agent.
>
> some part of the code is as below:
>
>             String filePath; //it is the dir I want to set
> final ConsoleProperties properties = 
> (ConsoleProperties)container.getComponentInstanceOfType(ConsoleProperties.class);
> Directory directory = new Directory(new File(filePath));
> properties.setAndSaveDistributionDirectory(directory);
>
> final FileDistribution distribution = 
> (FileDistribution)
> container.getComponentInstanceOfType(FileDistributionImplementation.class);
> final FileDistributionHandler distributionHandler = distribution
> .getHandler();
>
> try {
> while (true) {
> FileDistributionHandler.Result result;
> result = distributionHandler.sendNextFile();
> if (result == null) {
> break;
> }
> LOG.debug("Success in distributing {}", result.getFileName());
> }
> } catch (FileContentsException e) {
> LOG.error(e.getMessage(), e);
> throw new NGrinderRuntimeException(e.getMessage(), e);
> }
>
> From controller side, I can see that the log "Success in
> distributing ....". It means the files are scanned properly and sent
> to agent. But there is no response on agent side.
>
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2

_______________________________________________
Grinder-development mailing list
Grinder-development-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/grinder-development