Author: toad
Date: 2008-09-11 11:36:06 +0000 (Thu, 11 Sep 2008)
New Revision: 22590

Modified:
   trunk/freenet/src/freenet/node/simulator/BootstrapPullTest.java
   trunk/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java
   trunk/freenet/src/freenet/node/simulator/BootstrapSeedTest.java
   trunk/freenet/src/freenet/node/simulator/SeednodePingTest.java
Log:
Park the nodes too.


Modified: trunk/freenet/src/freenet/node/simulator/BootstrapPullTest.java
===================================================================
--- trunk/freenet/src/freenet/node/simulator/BootstrapPullTest.java     
2008-09-11 11:32:36 UTC (rev 22589)
+++ trunk/freenet/src/freenet/node/simulator/BootstrapPullTest.java     
2008-09-11 11:36:06 UTC (rev 22590)
@@ -55,6 +55,7 @@
         * @throws InterruptedException 
         */
        public static void main(String[] args) throws 
InvalidThresholdException, IOException, NodeInitException, InterruptedException 
{
+               Node secondNode = null;
                try {
                String ipOverride = null;
                if(args.length > 0)
@@ -99,7 +100,7 @@
         FileUtil.writeTo(fis, new File(secondInnerDir, "seednodes.fref"));
         fis.close();
         PooledExecutor executor = new PooledExecutor();
-        Node secondNode = NodeStarter.createTestNode(DARKNET_PORT, 
OPENNET_PORT, dir.getPath(), true, false, false, Node.DEFAULT_MAX_HTL, 0, 
random, executor, 1000, 5*1024*1024, true, true, true, true, true, true, true, 
12*1024, false, true, ipOverride);        
+        secondNode = NodeStarter.createTestNode(DARKNET_PORT, OPENNET_PORT, 
dir.getPath(), true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 
1000, 5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, 
true, ipOverride);        
         secondNode.start(true);
         waitForTenNodes(secondNode);

@@ -121,6 +122,10 @@
            } catch (Throwable t) {
                System.err.println("CAUGHT: "+t);
                t.printStackTrace();
+               try {
+                       if(secondNode != null)
+                               secondNode.park();
+               } catch (Throwable t1) {};
                System.exit(EXIT_THREW_SOMETHING);
            }
        }

Modified: trunk/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java
===================================================================
--- trunk/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java 
2008-09-11 11:32:36 UTC (rev 22589)
+++ trunk/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java 
2008-09-11 11:36:06 UTC (rev 22590)
@@ -35,6 +35,8 @@
        public static int EXIT_THREW_SOMETHING = 261;

        public static void main(String[] args) throws 
InvalidThresholdException, IOException, NodeInitException, InterruptedException 
{
+               Node node = null;
+               Node secondNode = null;
                try {
                String ipOverride = null;
                if(args.length > 0)
@@ -54,7 +56,7 @@
         fis.close();
         // Create one node
         Executor executor = new PooledExecutor();
-        Node node = NodeStarter.createTestNode(5000, 5001, dir.getPath(), 
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 
5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, true, 
ipOverride);
+        node = NodeStarter.createTestNode(5000, 5001, dir.getPath(), true, 
false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 5*1024*1024, 
true, true, true, true, true, true, true, 12*1024, false, true, ipOverride);
         //NodeCrypto.DISABLE_GROUP_STRIP = true;
        //Logger.setupStdoutLogging(Logger.MINOR, 
"freenet:NORMAL,freenet.node.NodeDispatcher:MINOR,freenet.node.FNPPacketMangler:MINOR");
        Logger.getChain().setThreshold(Logger.ERROR); // kill logging
@@ -96,7 +98,7 @@
         FileUtil.writeTo(fis, new File(secondInnerDir, "seednodes.fref"));
         fis.close();
         executor = new PooledExecutor();
-        Node secondNode = NodeStarter.createTestNode(5002, 5003, 
dir.getPath(), true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 
1000, 5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, 
true, ipOverride);        
+        secondNode = NodeStarter.createTestNode(5002, 5003, dir.getPath(), 
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 
5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, true, 
ipOverride);        
         secondNode.start(true);
         waitForTenNodes(secondNode);

@@ -118,6 +120,15 @@
            } catch (Throwable t) {
                System.err.println("CAUGHT: "+t);
                t.printStackTrace();
+               try {
+                       if(node != null)
+                               node.park();
+               } catch (Throwable t1) {};
+               try {
+                       if(secondNode != null)
+                               secondNode.park();
+               } catch (Throwable t1) {};
+
                System.exit(EXIT_THREW_SOMETHING);
            }
        }

Modified: trunk/freenet/src/freenet/node/simulator/BootstrapSeedTest.java
===================================================================
--- trunk/freenet/src/freenet/node/simulator/BootstrapSeedTest.java     
2008-09-11 11:32:36 UTC (rev 22589)
+++ trunk/freenet/src/freenet/node/simulator/BootstrapSeedTest.java     
2008-09-11 11:36:06 UTC (rev 22590)
@@ -30,6 +30,7 @@
         * @throws IOException 
         */
        public static void main(String[] args) throws 
InvalidThresholdException, NodeInitException, InterruptedException, IOException 
{
+               Node node = null;
                try {
                String ipOverride = null;
                if(args.length > 0)
@@ -49,7 +50,7 @@
         fis.close();
         // Create one node
         Executor executor = new PooledExecutor();
-        Node node = NodeStarter.createTestNode(5000, 5001, "bootstrap-test", 
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 
5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, true, 
ipOverride);
+        node = NodeStarter.createTestNode(5000, 5001, "bootstrap-test", true, 
false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 5*1024*1024, 
true, true, true, true, true, true, true, 12*1024, false, true, ipOverride);
         //NodeCrypto.DISABLE_GROUP_STRIP = true;
        //Logger.setupStdoutLogging(Logger.MINOR, 
"freenet:NORMAL,freenet.node.NodeDispatcher:MINOR,freenet.node.FNPPacketMangler:MINOR");
        Logger.getChain().setThreshold(Logger.ERROR); // kill logging
@@ -80,6 +81,10 @@
            } catch (Throwable t) {
                System.err.println("CAUGHT: "+t);
                t.printStackTrace();
+               try {
+                       if(node != null)
+                               node.park();
+               } catch (Throwable t1) {};
                System.exit(EXIT_THREW_SOMETHING);
            }
        }

Modified: trunk/freenet/src/freenet/node/simulator/SeednodePingTest.java
===================================================================
--- trunk/freenet/src/freenet/node/simulator/SeednodePingTest.java      
2008-09-11 11:32:36 UTC (rev 22589)
+++ trunk/freenet/src/freenet/node/simulator/SeednodePingTest.java      
2008-09-11 11:36:06 UTC (rev 22590)
@@ -43,13 +43,14 @@
        static final long COUNT_SUCCESSES_PERIOD = 7*24*60*60*1000; // 1 week

     public static void main(String[] args) throws FSParseException, 
IOException, OpennetDisabledException, PeerParseException, 
InterruptedException, ReferenceSignatureVerificationException, 
NodeInitException, InvalidThresholdException {
+       Node node = null;
        try {
        if(args.length == 1)
                STATUS_DIR = new File(args[0]);
         RandomSource random = NodeStarter.globalTestInit("seednode-pingtest", 
false, Logger.ERROR, "");
         // Create one node
         Executor executor = new PooledExecutor();
-       Node node = NodeStarter.createTestNode(5000, 5001, "seednode-pingtest", 
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 
5*1024*1024, true, false, false, false, false, false, false, 0, false, false, 
null);
+       node = NodeStarter.createTestNode(5000, 5001, "seednode-pingtest", 
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 
5*1024*1024, true, false, false, false, false, false, false, 0, false, false, 
null);
        // Connect & ping
        Vector<SeedServerTestPeerNode> seedNodes = new 
Vector<SeedServerTestPeerNode>();
        Vector<SimpleFieldSet> seedNodesAsSFS = Announcer.readSeednodes(new 
File("/tmp/"));
@@ -183,6 +184,10 @@
     } catch (Throwable t) {
        System.err.println("CAUGHT: "+t);
        t.printStackTrace();
+       try {
+               if(node != null)
+               node.park();
+       } catch (Throwable t1) {};
        System.exit(1);
     }
     }


Reply via email to