Index: tests/stub-generator/src/MintMakerPromiseWithStubsTest-generatedTest.dart |
diff --git a/tests/stub-generator/src/MintMakerPromiseWithStubsTest-generatedTest.dart b/tests/stub-generator/src/MintMakerPromiseWithStubsTest-generatedTest.dart |
index de6535a53f434add09d00eb7fc0428770e073489..eaf5bf117e6af3c03032796b17346caca28d4280 100644 |
--- a/tests/stub-generator/src/MintMakerPromiseWithStubsTest-generatedTest.dart |
+++ b/tests/stub-generator/src/MintMakerPromiseWithStubsTest-generatedTest.dart |
@@ -6,136 +6,6 @@ |
#import("../../isolate/src/TestFramework.dart"); |
zundel
2011/10/31 19:00:28
you need to fully revert this file before committi
|
-/* class = Mint (file:/usr/local/google/users/scheglov/Clients/Dart/dart/tests/stub-generator/src/MintMakerPromiseWithStubsTest.dart/MintMakerPromiseWithStubsTest.dart: 9) */ |
- |
-interface Mint$Proxy { |
- Purse$Proxy createPurse(int balance); |
-} |
- |
-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(this.call(["createPurse", balance])); |
- } |
-} |
- |
-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 createPurse = target.createPurse(balance); |
- SendPort port = Dispatcher.serve(new Purse$Dispatcher(createPurse)); |
- reply(port); |
- } 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]); |
- }); |
- } |
-} |
- |
-/* class = Purse (file:/usr/local/google/users/scheglov/Clients/Dart/dart/tests/stub-generator/src/MintMakerPromiseWithStubsTest.dart/MintMakerPromiseWithStubsTest.dart: 17) */ |
- |
-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(this.call(["sproutPurse"])); |
- } |
- |
- Promise<int> deposit(int amount, Purse$Proxy source) { |
- return 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 sproutPurse = target.sproutPurse(); |
- SendPort port = Dispatcher.serve(new Purse$Dispatcher(sproutPurse)); |
- reply(port); |
- } 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]); |
- 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]); |
- }); |
- } |
-} |
interface Mint factory MintImpl { |
Mint(); |