@Before public void setUp() throws Exception { this.wa1Config = new WorkAreaConfig("WW1", 12, true, TestData.newFieldList(TestData.fieldOne, TestData.fieldTwo), Collections.<Filter>emptyList()); this.wa2Config = new WorkAreaConfig("WW2_F1B", 4, false, TestData.newFieldList(TestData.makeField("pqr", 1, 4)), Collections.<Filter>emptyList()); this.configuration = new DefaultConfiguration(); // Don't use the names of real functions. Previously, using function "1B" // was causing the real 1B in GeosupportConfigIntegration test to fail // when all tests were run from Maven; basically, the 1B that was // returned by the integration test was the mock one created in // FunctionConfigTest. Issue did not occur within Eclipse or when // test was run individually. this.oneWorkAreaFunction = new FunctionConfig("EG", this.wa1Config, null); this.twoWorkAreaFunction = new FunctionConfig("9B", this.wa1Config, this.wa2Config); this.twoWorkAreaDefaultArgsFunction = new FunctionConfig("12", this.wa1Config, this.wa2Config, this.configuration); }
@Before public void setUp() throws Exception { this.id = "WA1"; this.length = 12; this.isWorkAreaOne = true; this.fields = TestData.newFieldList(TestData.fieldOne, TestData.fieldTwo); this.outputFilters = new ArrayList<Filter>(); this.outputFilters.add(new Filter(TestData.fieldOne.getId())); this.workAreaConfig = new WorkAreaConfig(this.id, this.length, this.isWorkAreaOne, this.fields, this.outputFilters); }
@Test//(expected=DuplicateFieldNameException.class) public void testCreateTwoWorkAreaFunction_duplicateFields() { WorkAreaConfig duplicateFieldWa2 = new WorkAreaConfig("DUP", TestData.fieldDuplicateIdOfOne.getLength(), true, TestData.newFieldList(TestData.fieldDuplicateIdOfOne),Collections.<Filter>emptyList()); FunctionConfig badFun = new FunctionConfig("DUP", this.wa1Config, duplicateFieldWa2); badFun.createFunction(new GeoclientStub()); }