コード例 #1
0
 public void execute(WorkerProcessContext workerProcessContext) {
   TestListenerInterface sender =
       workerProcessContext.getServerConnection().addOutgoing(TestListenerInterface.class);
   sender.send("message 1", 1);
   sender.send("message 2", 2);
   // crash
   Runtime.getRuntime().halt(1);
 }
コード例 #2
0
  public static void main(String[] args) throws IOException {
    // At last count, we could do this in 22 seconds on a 2.4ghz MacBookPro.
    // Although, it looks like when you run it in the test it runs a little slower
    LargeWorkspacePerformanceSimulation testHarness = new LargeWorkspacePerformanceSimulation(true);
    testHarness.inContext();
    System.out.println("File Count: " + testHarness.files.size());
    System.out.println("Max Memory " + humanReadable(Runtime.getRuntime().maxMemory()));

    long timestamp = System.currentTimeMillis();
    System.out.println("Creating Projects...");
    testHarness.createProjects();
    System.out.println("Created in " + (System.currentTimeMillis() - timestamp) + "ms");
    System.out.println("Updating Projects...");

    timestamp = System.currentTimeMillis();
    testHarness.updateProjects();
    System.out.println();
    long time = System.currentTimeMillis() - timestamp;
    System.out.println(
        "Updated " + PROJECT_COUNT + " projects " + UPDATE_COUNT + " times in " + time + "ms");
  }