public GeosupportClient() throws IOException { super(); log.info("Platform is {}", OperatingSystemUtils.uname()); this.geosupportConfiguration = new GeosupportConfig(new GeoclientImpl()); this.scanner = new Scanner(System.in); }
private Function getFunction(String functionName) { return this.geosupportConfiguration.getFunction(functionName); }
public GeosupportConfig(String configFile, String documentationConfigFile, Geoclient geoclient) { this.geoclientXmlReader = GeoclientXmlReader.fromXml(configFile); this.documentationXmlReader = DocumentationXmlReader.fromXml(documentationConfigFile); this.geoclient = geoclient; init(); }
public static void main(String[] args) throws Exception { GeosupportConfig geosupportConfig = null; if (OperatingSystemUtils.isWindows()) { geosupportConfig = new GeosupportConfig(new GeoclientStub()); } else { geosupportConfig = new GeosupportConfig(new GeoclientStub()); } log.debug("Name,Function,WorkArea"); Function f1 = geosupportConfig.getFunction(Function.F1); logFields("All",f1.getWorkAreaOne()); logFields(Function.F1,f1.getWorkAreaTwo()); logFields(Function.F1A,geosupportConfig.getFunction(Function.F1A).getWorkAreaTwo()); logFields(Function.F1AX,geosupportConfig.getFunction(Function.F1AX).getWorkAreaTwo()); logFields(Function.F1B,geosupportConfig.getFunction(Function.F1B).getWorkAreaTwo()); logFields(Function.F1E,geosupportConfig.getFunction(Function.F1E).getWorkAreaTwo()); logFields(Function.F2,geosupportConfig.getFunction(Function.F2).getWorkAreaTwo()); logFields(Function.F3,geosupportConfig.getFunction(Function.F3).getWorkAreaTwo()); logFields(Function.FBL,geosupportConfig.getFunction(Function.FBL).getWorkAreaTwo()); logFields(Function.FBN,geosupportConfig.getFunction(Function.FBN).getWorkAreaTwo()); DataDictionary dataDictionary = geosupportConfig.getDataDictionary(); for (ItemDocumentation itemDocumentation : dataDictionary.getItems()) { logDataDictionaryItem(itemDocumentation); } }
Mockito.when(geosupportConfigMock.getDataDictionary()).thenReturn(dataDictionary); addressDocumentation.setDisplayName("address"); addressDocumentation.setFields(new TreeSet<ItemDocumentation>()); Mockito.when(geosupportConfigMock.getFunctionDocumentation(Function.F1B)).thenReturn(addressDocumentation); Mockito.when(geosupportConfigMock.getFunctionDocumentation(Function.FBL)).thenReturn(bblDocumentation); Mockito.when(geosupportConfigMock.getFunctionDocumentation(Function.FBN)).thenReturn(binDocumentation); Mockito.when(geosupportConfigMock.getFunctionDocumentation(Function.F3)).thenReturn(blockfaceDocumentation); Mockito.when(geosupportConfigMock.getFunctionDocumentation(Function.F2)).thenReturn(intersectionDocumentation);
@Test public void testItemDocumentationDisplayNameSetProperly() { assertItemDocumentationDisplayNames(geosupportConfig.getFunctionDocumentation(Function.F1B), Arrays.asList("listOfSecondSetOf5Lgcs")); assertItemDocumentationDisplayNames(geosupportConfig.getFunctionDocumentation(Function.F2), Arrays.asList("dcpPreferredLgcForStreet1")); }
@Test(expected=UnknownFunctionException.class) public void nonExistentFunction() { geosupportConfig.getFunction("fun"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { geosupportConfig = new GeosupportConfig(new GeoclientImpl()); }
@Test public void testGetFunction() { assertNotNull(geosupportConfig.getFunction(Function.F1)); assertNotNull(geosupportConfig.getFunction(Function.F1E)); assertNotNull(geosupportConfig.getFunction(Function.F1A)); assertNotNull(geosupportConfig.getFunction(Function.F1AX)); assertNotNull(geosupportConfig.getFunction(Function.F1B)); assertNotNull(geosupportConfig.getFunction(Function.FBL)); assertNotNull(geosupportConfig.getFunction(Function.FBN)); assertNotNull(geosupportConfig.getFunction(Function.F2)); assertNotNull(geosupportConfig.getFunction(Function.F3)); assertNotNull(geosupportConfig.getFunction(Function.FDG)); assertNotNull(geosupportConfig.getFunction(Function.FHR)); }
@Test public void testGetFunctionConfiguration() { assertNotNull(geosupportConfig.getFunction(Function.F1).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.F1E).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.F1A).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.F1AX).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.F1B).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.FBL).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.FBN).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.F2).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.F3).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.FDG).getConfiguration()); assertNotNull(geosupportConfig.getFunction(Function.FHR).getConfiguration()); }