172 } catch (UnsupportedOperationException e) {
173 if (expectSupport) {
174 throw new RuntimeException("Test failed: " +
175 "unexpected UnsupportedOperationException");
176 }
177 out.println("UnsupportedOperationException as expected");
178 return;
179 } catch (IOException e) {
180 // Probably a permission error, but we're not
181 // going to check unless a specific permission exception
182 // is defined.
183 System.out.println(e);
184 }
185 if (!expectSupport) {
186 throw new RuntimeException("Test failed: " +
187 "UnsupportedOperationException was not thrown");
188 }
189 }
190
191 private static boolean checkExpectedOptionSupport() {
192 if (Platform.isSolaris()) {
193 OSVersion solarisVersion = OSVersion.current();
194 OSVersion solarisVersionToCheck = new OSVersion(11, 2);
195 if (solarisVersion.compareTo(solarisVersionToCheck) >= 0) {
196 System.out.println("This Solaris version (" + solarisVersion
197 + ") should support SO_FLOW_SLA option");
198 return true;
199 } else {
200 System.out.println("This Solaris version (" + solarisVersion
201 + ") should not support SO_FLOW_SLA option");
202 }
203 } else {
204 System.out.println("Not Solaris, SO_FLOW_SLA should not be " +
205 "supported");
206 }
207 return false;
208 }
209
210 }
|
172 } catch (UnsupportedOperationException e) {
173 if (expectSupport) {
174 throw new RuntimeException("Test failed: " +
175 "unexpected UnsupportedOperationException");
176 }
177 out.println("UnsupportedOperationException as expected");
178 return;
179 } catch (IOException e) {
180 // Probably a permission error, but we're not
181 // going to check unless a specific permission exception
182 // is defined.
183 System.out.println(e);
184 }
185 if (!expectSupport) {
186 throw new RuntimeException("Test failed: " +
187 "UnsupportedOperationException was not thrown");
188 }
189 }
190
191 private static boolean checkExpectedOptionSupport() {
192 System.out.println("SO_FLOW_SLA should not be supported");
193 return false;
194 }
195
196 }
|