MCPcopy Index your code
hub / github.com/java-native-access/jna / runBare

Method runBare

test/com/sun/jna/WebStartTest.java:375–405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

373 private static final String CERTS_KEY =
374 "deployment.user.security.trusted.certs";
375 @Override
376 public void runBare() throws Throwable {
377 if (runningWebStart()) {
378 super.runBare();
379 }
380 else if (!GraphicsEnvironment.isHeadless()) {
381 File policy = File.createTempFile(getName(), ".policy");
382 OutputStream os = new FileOutputStream(policy);
383 os.write(POLICY.getBytes());
384 os.close();
385 File dpfile = findDeploymentProperties();
386 Properties saved = new Properties();
387 saved.load(new FileInputStream(dpfile));
388 Properties props = new Properties();
389 props.putAll(saved);
390 props.setProperty(CERTS_KEY, new File("jna.keystore").getAbsolutePath());
391 props.setProperty(POLICY_KEY, policy.getAbsolutePath());
392 os = new FileOutputStream(dpfile);
393 props.store(os, "deployment.properties (for testing)");
394 os.close();
395 try {
396 runTestUnderWebStart();
397 }
398 finally {
399 policy.delete();
400 os = new FileOutputStream(dpfile);
401 saved.store(os, "deployment.properties");
402 os.close();
403 }
404 }
405 }
406
407 private static void sendResults(Throwable t, int port) throws IOException {
408 Socket s = new Socket(InetAddress.getLocalHost(), port);

Callers

nothing calls this directly

Calls 11

runningWebStartMethod · 0.95
runTestUnderWebStartMethod · 0.95
getNameMethod · 0.65
closeMethod · 0.65
setPropertyMethod · 0.65
createTempFileMethod · 0.45
writeMethod · 0.45
getBytesMethod · 0.45
loadMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected