Commits

desmaj  committed 73f54dc

added a pip requirements file and a bundle containing those requirements

  • Participants
  • Parent commits 5278f04
  • Branches TRAC-153

Comments (0)

Files changed (5)

File daemon/jsTestDriver.conf

+server: http://localhost:9876
+
+load:
+  - orbited/static/Orbited.js
+  - orbited/test/js/functional/test_*.js

File daemon/orbited-debug.cfg

 * -> localhost:8004     # announce
 * -> localhost:8005     # daemon monitoring feed
 
-[logging]
-debug=STDERR,debug.log
-info=STDERR,info.log
-access=STDERR,info.log
-warn=STDERR,error.log
-error=STDERR,error.log
+# new logging configuration using the python stdlib logging.fileConfig
+[loggers]
+keys = root,orbited
 
-enabled.default=debug,info,access,warn,error
+[handlers]
+keys = console, debug, info, error
 
-[loggers]
+[formatters]
+keys = generic
 
+[logger_root]
+level = NOTSET
+handlers = console
+
+[logger_orbited]
+level = WARN
+handlers = 
+qualname = orbited
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_debug]
+class = FileHandler
+level = DEBUG
+formatter = generic
+args = ('debug.log', 'w')
+
+[handler_info]
+class = FileHandler
+level = INFO
+formatter = generic
+args = ('info.log', 'w')
+
+[handler_error]
+class = FileHandler
+level = ERROR
+formatter = generic
+args = ('error.log', 'w')
+
+[formatter_generic]
+format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %H:%M:%S

File daemon/orbited.req

+Paste==1.7.5.1
+PasteDeploy==1.3.4
+PasteScript==1.7.3
+Twisted==10.1.0
+distribute==0.6.14
+docutils==0.7
+morbid==0.8.7.3
+simplejson==2.1.1
+stomper==0.2.4
+uuid==1.30
+zope.interface==3.6.1

File daemon/orbited.req.bundle

Binary file added.

File daemon/orbited/test/js/functional/test_tcpsocket.js

-EchoTest = function (socket, text, binary) {
+
+var EchoTest = function (queue, socket, text, binary) {
     var success = false;
     var buffer = "";
     
         socket.send(text);
     };
     
-    socket.onread = function(data) {
-        buffer += data;
-        testlog.info("buffer contains: ", buffer, 'text is', text);
-        if (buffer == text) {
-            success = true;
-            socket.close();
-        }
-    };
+    queue.defer("Wait for onread to be fired", function (pool) {
+	
+	socket.onread = pool.add(function(data) {
+            buffer += data;
+	    if (buffer == text) {
+                success = true;
+                socket.close();
+            }
+        });	
+    });
     
-    socket.onclose = function() {
-        if (!success) {
-            throw new Error("socket closed before receiving message");	    
-	}
-    };
+    queue.defer("The socket shouldn't be closed until the message is read", function (pool) {
+        socket.onclose = pool.add(function() {
+            if (!success) {
+                throw new Error("socket closed before receiving message");	    
+	    }
+        });
+    });
     
     socket.onerror = function(error) {
 	throw error;
     
 };
 
-TCPSocketTest = TestCase('TCPSocketTest');
+var TCPSocketTest = AsyncTestCase('TCPSocketTest');
 
 TCPSocketTest.prototype.setUp = function () {
     this.socket = new Orbited.TCPSocket();    
     }
 };
 
-TCPSocketTest.
+TCPSocketTest.prototype.testSimpleEcho = function(queue) {
+    assertNotNull(queue.defer);
+    EchoTest(queue, this.socket, "fleegle", false);
+};
+
+TCPSocketTest.prototype.testFailure = function(queue) {
+    assertNull(queue, typeof queue);
+};