メインコンテンツにスキップ
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); }