Перейти к содержимому

qad

Регистрация: 14 сен 2010
Offline Активность: 26 мар 2013 12:15
-----

Мои сообщения

В теме: Вывод в файл AssertionError

17 сентября 2010 - 15:28

Спасибо за мысль, попробую покопаться!

В теме: Вывод в файл AssertionError

14 сентября 2010 - 14:47

Окей, опишу подробнее.

Я тоже попытался последовать примеру Boltick:

static public void assertTrue(boolean condition) {
	try {
	     assertTrue(null, condition);
	     } catch (Throwable ex){
		      LOG.error(" Test case failed \n");
		      LOG.error("Details:", ex);
                      throw new Error();
	       }
	}

При возникновении ошибки в логе видим следующее:
17:44:57,967 ERROR main SeleniumTest:ErrorLog:87 - Details:
junit.framework.AssertionFailedError
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at com.exigen.hldsa.core.SeleniumTest.assertTrue(SeleniumTest.java:96)
	at com.exigen.hldsa.conformance.Homeowners_Conformance_Test.test1_RA_InitialPage(Homeowners_Conformance_Test.java:207)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Хотелось бы

17:44:57,967 ERROR main SeleniumTest:ErrorLog:87 - Details:
junit.framework.AssertionFailedError
	at com.exigen.hldsa.conformance.Homeowners_Conformance_Test.test1_RA_InitialPage(Homeowners_Conformance_Test.java:207)

В теме: Вывод в файл AssertionError

14 сентября 2010 - 10:50

Привет,
2 contestar:
"Я хочу получить в логе только это:

INFO : Test is running…
ERROR:at tests.tests.CreateTaskScreen.UI.Buttons.testExample(Example.java:34)

Это возможно?"

Получилось ли сделать это? Как добились? Спасибо заранее