Commits

vadimtsushko committed ebe5c2b

Cosmetic changes

  • Participants
  • Parent commits 6d0faa6

Comments (0)

Files changed (8)

 tests/allTests.dart
 tests/CursorTest.dart
 tests/DbCommandTest.dart
-lib/objectory/WebsocketClient.dart
 tests/objectory/allObjectoryTests.dart
 tests/objectory/PersistentObjectTest.dart
 lib/objectory/objectory_server.dart
     return connection.connect();
   }
   Future<Map> executeDbCommand(MongoMessage message){
-      Completer<bool> result = new Completer();
+      Completer<Map> result = new Completer();
       //print("executeDbCommand.message = ${message}");
       connection.query(message).then((replyMessage){
         //print("replyMessage = ${replyMessage}");

File lib/objectory/ObjectoryWebSocketImpl.dart

-Objectory get objectory() => new ObjectorySingleton._singleton();
+/*Objectory get objectory() => new ObjectorySingleton._singleton();
 abstract class ObjectorySingleton extends ObjectoryBaseImpl{
   static Objectory _objectory;
   ObjectorySingleton._internal();
     print("Closing objectory");
     webSocket.close(null,"Normal closing, socketId: $socketId");
   }
-/*  Future<List<PersistentObject>> find(String className,[Map selector]){
+  Future<List<PersistentObject>> find(String className,[Map selector]){
     Completer completer = new Completer();
     List<PersistentObject> result = new List<PersistentObject>();
     db.collection(className)
     return completer.future;  
   }
   
-*/  
+  
 }
+*/

File lib/objectory/WebsocketClient.dart

-#import("dart:io");
-
-void main() {  
-  WebSocket webSocket;
-  webSocket = new WebSocket("ws://localhost:8080/");
-  webSocket.onopen = (){
-    webSocket.send("Objectory opened");
-    webSocket.send([123,234,23,34,45]);
-    webSocket.close(123,"Normal closing");
-  };
-}

File lib/objectory/objectory_server.dart

       db.drop();
     }  
     if (command == "update"){
-      db.collection(collection).update(obj);
+      db.collection(collection).update({"_id":obj["_id"]},obj);
     }
     if (command == "findOne"){
       db.collection(collection).findOne(obj).then((val)=>sendObject(connection,val));

File tests/CursorTest.dart

     }
     collection.insertAll(toInsert);  
     int count = 0;
-    db.getLastError().then((dummy){
+    db.getLastError().then((_){
     Cursor cursor = new Cursor(db,collection,limit:10);  
       cursor.each((v){
             count++;

File tests/DbCollectionTest.dart

 }
 testDrop(){
   Db db = new Db('mongo-dart-test');
-  db.open().then((v){
+  db.open().then((_){
   db.dropCollection("testDrop").then((v)=>v);
-  db.dropCollection("testDrop").then((v){    
+  db.dropCollection("testDrop").then((__){    
     db.close();
     callbackDone();    
   });

File tests/objectory/DomainModel.dart

   String get type()=>"Person";
   init(){
     address = new Address();
-//    setProperty("address",new Address());
   }
 }  
 class AddressImpl extends InnerPersistentObject implements Address{