Index: tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart |
diff --git a/tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart b/tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart |
index 6c99e6b5656fc0edad597fb4189af81b6d8f9196..d736bfed0f5e07945b6f9a6d74cdc33b2260afbf 100644 |
--- a/tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart |
+++ b/tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart |
@@ -6,228 +6,6 @@ |
#import("../../isolate/src/TestFramework.dart"); |
zundel
2011/10/31 19:00:28
you need to fully revert this file before committi
|
-/* class = Purse (file:/usr/local/google/users/scheglov/Clients/Dart/dart/tests/stub-generator/src/MintMakerFullyIsolatedTest.dart/MintMakerFullyIsolatedTest.dart: 9) */ |
- |
-interface Purse$Proxy { |
- Promise<int> queryBalance(); |
- |
- Purse$Proxy sproutPurse(); |
- |
- Promise<int> deposit(int amount, Purse$Proxy source); |
-} |
- |
-class Purse$ProxyImpl extends ProxyImpl implements Purse$Proxy { |
- Purse$ProxyImpl(Promise<SendPort> port) : super.forReply(port) { } |
- Purse$ProxyImpl.forIsolate(Proxy isolate) : super.forReply(isolate.call([null])) { } |
- factory Purse$ProxyImpl.createIsolate() { |
- Proxy isolate = new Proxy.forIsolate(new Purse$Dispatcher$Isolate()); |
- return new Purse$ProxyImpl.forIsolate(isolate); |
- } |
- factory Purse$ProxyImpl.localProxy(Purse obj) { |
- return new Purse$ProxyImpl(new Promise<SendPort>.fromValue(Dispatcher.serve(new Purse$Dispatcher(obj)))); |
- } |
- |
- Promise<int> queryBalance() { |
- return this.call(["queryBalance"]); |
- } |
- |
- Purse$Proxy sproutPurse() { |
- return new Purse$ProxyImpl(new PromiseProxy<SendPort>(this.call(["sproutPurse"]))); |
- } |
- |
- Promise<int> deposit(int amount, Purse$Proxy source) { |
- return new PromiseProxy<int>(this.call(["deposit", amount, source])); |
- } |
-} |
- |
-class Purse$Dispatcher extends Dispatcher<Purse> { |
- Purse$Dispatcher(Purse thing) : super(thing) { } |
- |
- void process(var message, void reply(var response)) { |
- String command = message[0]; |
- if (command == "Purse") { |
- } else if (command == "queryBalance") { |
- int queryBalance = target.queryBalance(); |
- reply(queryBalance); |
- } else if (command == "sproutPurse") { |
- Purse$Proxy sproutPurse = target.sproutPurse(); |
- reply(sproutPurse); |
- } else if (command == "deposit") { |
- int amount = message[1]; |
- List<Promise<SendPort>> promises = new List<Promise<SendPort>>(); |
- promises.add(new PromiseProxy<SendPort>(new Promise<SendPort>.fromValue(message[2]))); |
- Promise done = new Promise(); |
- done.waitFor(promises, 1); |
- done.addCompleteHandler((_) { |
- Purse$Proxy source = new Purse$ProxyImpl(promises[0]); |
- Promise<int> deposit = target.deposit(amount, source); |
- reply(deposit); |
- }); |
- } else { |
- // TODO(kasperl,benl): Somehow throw an exception instead. |
- reply("Exception: command '" + command + "' not understood by Purse."); |
- } |
- } |
-} |
- |
-class Purse$Dispatcher$Isolate extends Isolate { |
- Purse$Dispatcher$Isolate() : super() { } |
- |
- void main() { |
- this.port.receive(void _(var message, SendPort replyTo) { |
- Purse thing = new Purse(); |
- SendPort port = Dispatcher.serve(new Purse$Dispatcher(thing)); |
- Proxy proxy = new Proxy.forPort(replyTo); |
- proxy.send([port]); |
- }); |
- } |
-} |
- |
-/* class = PowerfulPurse (file:/usr/local/google/users/scheglov/Clients/Dart/dart/tests/stub-generator/src/MintMakerFullyIsolatedTest.dart/MintMakerFullyIsolatedTest.dart: 18) */ |
- |
-interface PowerfulPurse$Proxy { |
- void init(Mint$Proxy mint, int balance); |
- |
- Promise<int> grab(int amount); |
- |
- Purse$Proxy weak(); |
-} |
- |
-class PowerfulPurse$ProxyImpl extends ProxyImpl implements PowerfulPurse$Proxy { |
- PowerfulPurse$ProxyImpl(Promise<SendPort> port) : super.forReply(port) { } |
- PowerfulPurse$ProxyImpl.forIsolate(Proxy isolate) : super.forReply(isolate.call([null])) { } |
- factory PowerfulPurse$ProxyImpl.createIsolate() { |
- Proxy isolate = new Proxy.forIsolate(new PowerfulPurse$Dispatcher$Isolate()); |
- return new PowerfulPurse$ProxyImpl.forIsolate(isolate); |
- } |
- factory PowerfulPurse$ProxyImpl.localProxy(PowerfulPurse obj) { |
- return new PowerfulPurse$ProxyImpl(new Promise<SendPort>.fromValue(Dispatcher.serve(new PowerfulPurse$Dispatcher(obj)))); |
- } |
- |
- void init(Mint$Proxy mint, int balance) { |
- this.send(["init", mint, balance]); |
- } |
- |
- Promise<int> grab(int amount) { |
- return this.call(["grab", amount]); |
- } |
- |
- Purse$Proxy weak() { |
- return new Purse$ProxyImpl(this.call(["weak"])); |
- } |
-} |
- |
-class PowerfulPurse$Dispatcher extends Dispatcher<PowerfulPurse> { |
- PowerfulPurse$Dispatcher(PowerfulPurse thing) : super(thing) { } |
- |
- void process(var message, void reply(var response)) { |
- String command = message[0]; |
- if (command == "PowerfulPurse") { |
- } else if (command == "init") { |
- List<Promise<SendPort>> promises = new List<Promise<SendPort>>(); |
- promises.add(new PromiseProxy<SendPort>(new Promise<SendPort>.fromValue(message[1]))); |
- int balance = message[2]; |
- Promise done = new Promise(); |
- done.waitFor(promises, 1); |
- done.addCompleteHandler((_) { |
- Mint$Proxy mint = new Mint$ProxyImpl(promises[0]); |
- target.init(mint, balance); |
- }); |
- } else if (command == "grab") { |
- int amount = message[1]; |
- int grab = target.grab(amount); |
- reply(grab); |
- } else if (command == "weak") { |
- Purse weak = target.weak(); |
- SendPort port = Dispatcher.serve(new Purse$Dispatcher(weak)); |
- reply(port); |
- } else { |
- // TODO(kasperl,benl): Somehow throw an exception instead. |
- reply("Exception: command '" + command + "' not understood by PowerfulPurse."); |
- } |
- } |
-} |
- |
-class PowerfulPurse$Dispatcher$Isolate extends Isolate { |
- PowerfulPurse$Dispatcher$Isolate() : super() { } |
- |
- void main() { |
- this.port.receive(void _(var message, SendPort replyTo) { |
- PowerfulPurse thing = new PowerfulPurse(); |
- SendPort port = Dispatcher.serve(new PowerfulPurse$Dispatcher(thing)); |
- Proxy proxy = new Proxy.forPort(replyTo); |
- proxy.send([port]); |
- }); |
- } |
-} |
- |
-/* class = Mint (file:/usr/local/google/users/scheglov/Clients/Dart/dart/tests/stub-generator/src/MintMakerFullyIsolatedTest.dart/MintMakerFullyIsolatedTest.dart: 28) */ |
- |
-interface Mint$Proxy { |
- Purse$Proxy createPurse(int balance); |
- |
- PowerfulPurse$Proxy promote(Purse$Proxy purse); |
-} |
- |
-class Mint$ProxyImpl extends ProxyImpl implements Mint$Proxy { |
- Mint$ProxyImpl(Promise<SendPort> port) : super.forReply(port) { } |
- Mint$ProxyImpl.forIsolate(Proxy isolate) : super.forReply(isolate.call([null])) { } |
- factory Mint$ProxyImpl.createIsolate() { |
- Proxy isolate = new Proxy.forIsolate(new Mint$Dispatcher$Isolate()); |
- return new Mint$ProxyImpl.forIsolate(isolate); |
- } |
- factory Mint$ProxyImpl.localProxy(Mint obj) { |
- return new Mint$ProxyImpl(new Promise<SendPort>.fromValue(Dispatcher.serve(new Mint$Dispatcher(obj)))); |
- } |
- |
- Purse$Proxy createPurse(int balance) { |
- return new Purse$ProxyImpl(new PromiseProxy<SendPort>(this.call(["createPurse", balance]))); |
- } |
- |
- PowerfulPurse$Proxy promote(Purse$Proxy purse) { |
- return new PowerfulPurse$ProxyImpl(new PromiseProxy<SendPort>(this.call(["promote", purse]))); |
- } |
-} |
- |
-class Mint$Dispatcher extends Dispatcher<Mint> { |
- Mint$Dispatcher(Mint thing) : super(thing) { } |
- |
- void process(var message, void reply(var response)) { |
- String command = message[0]; |
- if (command == "Mint") { |
- } else if (command == "createPurse") { |
- int balance = message[1]; |
- Purse$Proxy createPurse = target.createPurse(balance); |
- reply(createPurse); |
- } else if (command == "promote") { |
- List<Promise<SendPort>> promises = new List<Promise<SendPort>>(); |
- promises.add(new PromiseProxy<SendPort>(new Promise<SendPort>.fromValue(message[1]))); |
- Promise done = new Promise(); |
- done.waitFor(promises, 1); |
- done.addCompleteHandler((_) { |
- Purse$Proxy purse = new Purse$ProxyImpl(promises[0]); |
- PowerfulPurse$Proxy promote = target.promote(purse); |
- reply(promote); |
- }); |
- } else { |
- // TODO(kasperl,benl): Somehow throw an exception instead. |
- reply("Exception: command '" + command + "' not understood by Mint."); |
- } |
- } |
-} |
- |
-class Mint$Dispatcher$Isolate extends Isolate { |
- Mint$Dispatcher$Isolate() : super() { } |
- |
- void main() { |
- this.port.receive(void _(var message, SendPort replyTo) { |
- Mint thing = new Mint(); |
- SendPort port = Dispatcher.serve(new Mint$Dispatcher(thing)); |
- Proxy proxy = new Proxy.forPort(replyTo); |
- proxy.send([port]); |
- }); |
- } |
-} |
interface Purse { |
Purse(); |
int queryBalance(); |