Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Exception java.io.File - Works with JUnit, Fails with JUnit TPTP
Exception java.io.File - Works with JUnit, Fails with JUnit TPTP [message #125317] Tue, 04 March 2008 16:23 Go to next message
Eclipse UserFriend
Originally posted by: maxime.lem.gmail.com

Hello,

I'm accessing in JUnit script files located on a network folder.
When I execute my code as JUnit test or as Java application, code is
executed successfully.
After importing my JUnit script as TPTP JUnit, and executing it as "Test",
I can't access anymore files that are not local to the system.

By example :

import java.io.*;
public static void testFile() {
final String filename = "\\\\myServerName\\myNetworkShare";
File file = new File(filename);
String filesList[] = file.list();
System.out.println("There are " + filesList.length + " files");
}

I'm calling testFile() from a test method of a JUnit TestCase, converted
to TPTP. If I run this test as JUnit, it works. If I run it as TPTP test,
I've got a NullPointerException.
If filename variable is set to a local folder, by example, C:\\Program
Files, it works for TPTP.

It seems that there is a problem for accessing network resource within
TPTP JUnit.
Is my TPTP configuration is wrong ?
Can you help me ?

Thanks
Re: Exception java.io.File - Works with JUnit, Fails with JUnit TPTP [message #125391 is a reply to message #125317] Wed, 05 March 2008 10:46 Go to previous message
Eclipse UserFriend
Originally posted by: maxime.lem.gmail.com

Found the problem. I was right with "It seems that there is a problem for
accessing network resource within TPTP JUnit."

TPTP runs tests with Agent Controler account. By default, this account is
local System, and this account cannot access remote folders that require
an authentication.

Solution is to change the account used for running agent controler
service, with one authenticated by the domain controler.
Previous Topic:UML Log Perspective
Next Topic:how to use TPTP charting service
Goto Forum:
  


Current Time: Fri Apr 26 04:36:41 GMT 2024

Powered by FUDForum. Page generated in 0.06186 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top