2015-01-06 59 views
0
@BeforeTest 
public void testLogin() throws IOException, InterruptedException { 
    // Log4j.logMessage("Deleted the Existing LogFile"); 
    // DeleteFile.deleteFile(); 
    Log4j.logMessage("Login the application"); 
    // Login.loginsession(); 
    Log4j.logMessage("Logged in the application"); 
} 

@Test 
public void testChangePassword() throws InterruptedException, IOException { 
    Log4j.logMessage("Change Password Test Case Started"); 
    // ChangePassword.changepwd(); 
} 

@AfterTest 
public void testLogout() throws InterruptedException, IOException { 
    // Logout.logoutsession(); 
    Log4j.logMessage("Logged out the application"); 
} 

如果我使用下面,莫非无法删除日志文件中的Log4j在Java中

PARAM NAME =“附加”价值=“真”

所有运行都将记录在日志文件..如果我设置为false,只有最后一条消息是logged..I想记录整个运行(如果我开始新的运行,旧日志应当删除,只有当前运行应显示)

我试图删除文件@BeforeSuite但删除不起作用。

回答