@Test public void serverPorts() { when(configuration.getProperty("openoffice.serverPorts", List.class)) .thenReturn(Arrays.asList("10", "12", "8569")); assertArrayEquals(new int[] {10, 12, 8569}, defaultOfficeServerConfiguration.getServerPorts()); when(configuration.getProperty("openoffice.serverPorts", List.class)) .thenReturn(Collections.emptyList()); when(configuration.getProperty("openoffice.serverPort", 8100)).thenReturn(4242); assertArrayEquals(new int[] {4242}, defaultOfficeServerConfiguration.getServerPorts()); }
@Override public int[] getServerPorts() { List<String> serverPorts = this.configuration.getProperty(PREFIX + "serverPorts", List.class); int[] result; if (serverPorts != null && serverPorts.size() > 0) { result = new int[serverPorts.size()]; for (int i = 0; i < serverPorts.size(); i++) { result[i] = Integer.parseInt(serverPorts.get(i)); } } else { result = new int[] { getServerPort() }; } return result; }
DefaultOfficeServerConfiguration implements OfficeServerConfiguration, Initializable { @Override public int[] getServerPorts() { List<String> serverPorts = this.configuration.getProperty(PREFIX + "serverPorts", List.class); int[] result; if (serverPorts != null && serverPorts.size() > 0) { result = new int[serverPorts.size()]; for (int i = 0; i < serverPorts.size(); i++) { result[i] = Integer.parseInt(serverPorts.get(i)); } } else { result = new int[] { getServerPort() }; } return result; } }
DefaultOfficeServerConfiguration implements OfficeServerConfiguration, Initializable { @Override public int[] getServerPorts() { List<String> serverPorts = this.configuration.getProperty(PREFIX + "serverPorts", List.class); int[] result; if (serverPorts != null && serverPorts.size() > 0) { result = new int[serverPorts.size()]; for (int i = 0; i < serverPorts.size(); i++) { result[i] = Integer.parseInt(serverPorts.get(i)); } } else { result = new int[] { getServerPort() }; } return result; }  }
DefaultOfficeServerConfiguration implements OfficeServerConfiguration, Initializable { @Override public int[] getServerPorts() { List<String> serverPorts = this.configuration.getProperty(PREFIX + "serverPorts", List.class); int[] result; if (serverPorts != null && serverPorts.size() > 0) { result = new int[serverPorts.size()]; for (int i = 0; i < serverPorts.size(); i++) { result[i] = Integer.parseInt(serverPorts.get(i)); } } else { result = new int[] { getServerPort() }; } return result; }  @Override int getServerType(); @Override int getServerPort(); @Override int[] getServerPorts(); @Override boolean isAutoStart(); @Override String getHomePath(); @Override String getProfilePath(); @Override int getMaxTasksPerProcess(); @Override long getTaskExecutionTimeout(); @Override void initialize(); }
DefaultOfficeServerConfiguration implements OfficeServerConfiguration, Initializable { @Override public int[] getServerPorts() { List<String> serverPorts = this.configuration.getProperty(PREFIX + "serverPorts", List.class); int[] result; if (serverPorts != null && serverPorts.size() > 0) { result = new int[serverPorts.size()]; for (int i = 0; i < serverPorts.size(); i++) { result[i] = Integer.parseInt(serverPorts.get(i)); } } else { result = new int[] { getServerPort() }; } return result; }  @Override int getServerType(); @Override int getServerPort(); @Override int[] getServerPorts(); @Override boolean isAutoStart(); @Override String getHomePath(); @Override String getProfilePath(); @Override int getMaxTasksPerProcess(); @Override long getTaskExecutionTimeout(); @Override void initialize();  }