diff --git a/ipp-v3-java-devkit/pom.xml b/ipp-v3-java-devkit/pom.xml index 4fd9d44e..e372b5f0 100755 --- a/ipp-v3-java-devkit/pom.xml +++ b/ipp-v3-java-devkit/pom.xml @@ -144,6 +144,7 @@ maven-surefire-plugin 3.0.0-M3 + ${argLine} -Djdk.attach.allowAttachSelf testng-devkit.xml diff --git a/ipp-v3-java-devkit/src/test/java/com/intuit/ipp/services/ReportNameTest.java b/ipp-v3-java-devkit/src/test/java/com/intuit/ipp/services/ReportNameTest.java new file mode 100644 index 00000000..580bf2ed --- /dev/null +++ b/ipp-v3-java-devkit/src/test/java/com/intuit/ipp/services/ReportNameTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2017 Intuit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ +package com.intuit.ipp.services; + +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +public class ReportNameTest { + + private ReportName reportName; + + + + @Test + public void testProfitAndLoss() { + reportName = ReportName.PROFITANDLOSS; + assertEquals(reportName.toString(), "ProfitAndLoss"); + } + + @Test + public void testBalanceSheet() { + reportName = ReportName.BALANCESHEET; + assertEquals(reportName.toString(), "BalanceSheet"); + } + + @Test + public void testCashFlow() { + reportName = ReportName.CASHFLOW; + assertEquals(reportName.toString(), "CashFlow"); + } + + @Test + public void testCustomerIncome() { + reportName = ReportName.CUSTOMERINCOME; + assertEquals(reportName.toString(), "CustomerIncome"); + } + + @Test + public void testAgedReceivables() { + reportName = ReportName.AGEDRECEIVABLES; + assertEquals(reportName.toString(), "AgedReceivables"); + } + + @Test + public void testAgedPayables() { + reportName = ReportName.AGEDPAYABLES; + assertEquals(reportName.toString(), "AgedPayables"); + } + + @Test + public void testItemSales() { + reportName = ReportName.ITEMSALES; + assertEquals(reportName.toString(), "ItemSales"); + } + + @Test + public void testDepartmentSales() { + reportName = ReportName.DEPARTMENTSALES; + assertEquals(reportName.toString(), "DepartmentSales"); + } + + @Test + public void testClassSales() { + reportName = ReportName.CLASSSALES; + assertEquals(reportName.toString(), "ClassSales"); + } + + @Test + public void testTrialBalance() { + reportName = ReportName.TRIALBALANCE; + assertEquals(reportName.toString(), "TrialBalance"); + } + + @Test + public void testTrialBalanceFR() { + reportName = ReportName.TRIALBALANCE_FR; + assertEquals(reportName.toString(), "TrialBalanceFR"); + } + + @Test + public void testVendorBalance() { + reportName = ReportName.VENDORBALANCE; + assertEquals(reportName.toString(), "VendorBalance"); + } + + @Test + public void testVendorExpenses() { + reportName = ReportName.VENDOREXPENSES; + assertEquals(reportName.toString(), "VendorExpenses"); + } + + @Test + public void testInventoryValuationSummary() { + reportName = ReportName.INVENTORYVALUATIONSUMMARY; + assertEquals(reportName.toString(), "InventoryValuationSummary"); + } + + @Test + public void testBAS() { + reportName = ReportName.BAS; + assertEquals(reportName.toString(), "BAS"); + } + + @Test + public void testVendorBalanceDetail() { + reportName = ReportName.VENDORBALANCEDETAIL; + assertEquals(reportName.toString(), "VendorBalanceDetail"); + } + + @Test + public void testGeneralLedger() { + reportName = ReportName.GENERALLEDGER; + assertEquals(reportName.toString(), "GeneralLedger"); + } + + @Test + public void testGeneralLedgerFR() { + reportName = ReportName.GENERALLEDGER_FR; + assertEquals(reportName.toString(), "GeneralLedgerFR"); + } + + @Test + public void testAgedPayableDetail() { + reportName = ReportName.AGEDPAYABLEDETAIL; + assertEquals(reportName.toString(), "AgedPayableDetail"); + } +} diff --git a/ipp-v3-java-devkit/src/test/java/com/intuit/ipp/services/ReportServiceTest.java b/ipp-v3-java-devkit/src/test/java/com/intuit/ipp/services/ReportServiceTest.java new file mode 100644 index 00000000..52e0e5b8 --- /dev/null +++ b/ipp-v3-java-devkit/src/test/java/com/intuit/ipp/services/ReportServiceTest.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * Copyright (c) 2017 Intuit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ +package com.intuit.ipp.services; + +import com.intuit.ipp.core.Context; +import com.intuit.ipp.exception.FMSException; +import com.intuit.ipp.interceptors.IntuitInterceptorProvider; +import com.intuit.ipp.interceptors.IntuitMessage; +import mockit.Mock; +import mockit.MockUp; +import mockit.Mocked; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class ReportServiceTest { + @Mocked + private Context context; + + private ReportService reportService; + + @BeforeClass + public void setup() { + reportService = new ReportService(context); + reportService = getMockedIntuitMessage(); + } + + @Test + public void testExecuteReport() throws FMSException { + MockIntuitInterceptorProvider mockIntuitInterceptorProvider + = new MockIntuitInterceptorProvider(); + reportService.executeReport("mock"); + } + + public ReportService getMockedIntuitMessage() { + reportService.setReport_date(""); + reportService.setStart_date(""); + reportService.setEnd_date(""); + reportService.setDate_macro(""); + reportService.setDate_macro(""); + reportService.setPast_due(""); + reportService.setEnd_duedate(""); + reportService.setStart_duedate(""); + reportService.setDuedate_macro(""); + reportService.setAccounting_method(""); + reportService.setAccount(""); + reportService.setSource_account(""); + reportService.setSource_account_type(""); + reportService.setSummarize_column_by(""); + reportService.setAccount_type(""); + reportService.setCustomer(""); + reportService.setVendor(""); + reportService.setItem(""); + reportService.setClassid(""); + reportService.setAppaid(""); + reportService.setDepartment(""); + reportService.setQzurl(""); + reportService.setAging_period(""); + reportService.setAging_method(""); + reportService.setNum_periods(""); + reportService.setTerm(""); + reportService.setColumns(""); + reportService.setSort_by(""); + reportService.setSort_order(""); + reportService.setGroup_by(""); + reportService.setCreatedate_macro(""); + reportService.setEnd_createdate(""); + reportService.setStart_createdate(""); + reportService.setModdate_macro(""); + reportService.setEnd_moddate(""); + reportService.setStart_moddate(""); + reportService.setPayment_method(""); + reportService.setName(""); + reportService.setTransaction_type(""); + reportService.setCleared(""); + reportService.setArpaid(""); + reportService.setPrinted(""); + reportService.setBoth_amount(""); + reportService.setMemo(""); + reportService.setDoc_num(""); + reportService.setJournal_code(""); + reportService.setEmployee(""); + reportService.setAgency_id(""); + reportService.setCustom1(""); + reportService.setCustom2(""); + reportService.setCustom3(""); + reportService.setShipvia(""); + reportService.setAccount_status(""); + reportService.setSubcol_pct_inc(""); + reportService.setSubcol_pct_exp(""); + + return reportService; + } + private static final class MockIntuitInterceptorProvider extends MockUp { + + @Mock + public void executeInterceptors(final IntuitMessage intuitMessage) throws FMSException { + // mocked executeInterceptors + } + } +} \ No newline at end of file