주 컨텐츠로 이동
Administrator Guide
최종 업데이트: 2023-06-23
참조: AUnit 테스트 주석

참조: AUnit 테스트 주석

주석
설명
@AssemblyTest
테스트를 AUnit 테스트로 식별하고 이를 조립품과 연결합니다.
@AssemblyTest(project = "AUnitTrainer", displayLabel = "Citizens of the Cloud")
@UnitTest
개별 테스트 케이스를 식별합니다.
@UnitTest(startComponent = "Simple-Mediation") public void testSimpleMediation() throws Exception { setMessagePart(0, "test/simple-input.xml", "text/xml"); }
@AssertBefore
명명된 조립품 구성요소 또는 단계를 실행하기 전에 어설션을 실행합니다.
@AssertBefore(id="Store-Output") public void verifySummaryDoc() throws Exception { assertEquals("10", evaluateExpression("parts[0].xpath('count(/summary/wd:WorkerSummary)')")); }
@AssertAfter
명명된 조립품 구성요소 또는 단계를 실행한 후 어설션을 실행합니다.
@AssertAfter(id = "Simple-Mediation", step="transform") public void verifySimpleMediation() throws Exception { assertTrue(compare(getTestResourceInputStream("test/simple-expected.xml"), "text/xml", (InputStream) getMediationContext().getMessage().getMessagePart(0, InputStream.class), "text/xml", Comparator.dom)); } @AssertAfter(id="Process", step="transform") public void verifySummary() throws Exception { assertEquals("Ace Developer", evaluateExpression("parts[0].xpath('/wd:WorkerSummary/wd:Name')")); assertEquals("2010-07-27-07:00", evaluateExpression("parts[0].xpath('/wd:WorkerSummary/wd:HireDate')")); }
@AssertAfterCompletion
조립이 완료된 후 어설션을 실행합니다.
@AssertAfterCompletion public void verifyErrorHandling() throws Exception { assertEquals(3, evaluateExpression("props['error.count']")); }
@AtComponent
테스트가 검증을 수행하기 위해 조립품을 가로채는 위치를 정의하고 명명된 구성요소에 대한 테스트 동작을 정의합니다.
@AtComponent(id="Get-Workers") public Action handleGetWorkersInvocation() throws Exception { setMessagePart(0, "test/fromworkdayin/workdayin_workers_response.xml", "text/xml"); return new StandardAction(Action.Type.mock); }