01: /******************************************************************************
02: * Copyright (C) Lars Ivar Almli. All rights reserved. *
03: * ---------------------------------------------------------------------------*
04: * This file is part of MActor. *
05: * *
06: * MActor is free software; you can redistribute it and/or modify *
07: * it under the terms of the GNU General Public License as published by *
08: * the Free Software Foundation; either version 2 of the License, or *
09: * (at your option) any later version. *
10: * *
11: * MActor is distributed in the hope that it will be useful, *
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14: * GNU General Public License for more details. *
15: * *
16: * You should have received a copy of the GNU General Public License *
17: * along with MActor; if not, write to the Free Software *
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19: ******************************************************************************/package org.mactor.tests;
20:
21: import java.util.List;
22: import junit.framework.Assert;
23: import org.junit.Test;
24: import org.mactor.framework.HtmlTestSuiteParser;
25: import org.mactor.framework.TestData;
26:
27: public class TestDataTest {
28: @Test
29: public void readHtml() throws Exception {
30: List<HtmlTestSuiteParser> all = HtmlTestSuiteParser
31: .parseFile("tests/mactor_sample_test/test-suite-data.html");
32: for (HtmlTestSuiteParser data : all) {
33: System.out.print("table:\n" + data.toString() + "\n");
34: }
35: TestData data = all.get(0).getData();
36: Assert.assertEquals(2, data.getColumnCount());
37: Assert.assertEquals(7, data.getRowCount());
38: Assert.assertEquals("CustomerId", data.getColumn(0));
39: Assert.assertEquals("ProductId", data.getColumn(1));
40: Assert.assertEquals("7", data.getValue(6, "ProductId"));
41: }
42: }
|