Move the testapp out of the main directory and under t/, avoiding the need for a...
[catagits/Catalyst-Engine-STOMP.git] / t / lib / StompTestApp / Controller / TestController.pm
diff --git a/t/lib/StompTestApp/Controller/TestController.pm b/t/lib/StompTestApp/Controller/TestController.pm
new file mode 100644 (file)
index 0000000..9ae99d5
--- /dev/null
@@ -0,0 +1,30 @@
+package # Hide from PAUSE
+  StompTestApp::Controller::TestController;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller::MessageDriven' };
+
+sub testaction : Local {
+    my ($self, $c, $request) = @_;
+
+    # Reply with a minimal response message
+    my $response = { type => 'testaction_response' };
+    $c->stash->{response} = $response;
+}
+
+sub badaction : Local {
+    my ($self, $c, $request) = @_;
+    die "oh noes";
+}
+
+sub ping : Local {
+    my ($self, $c, $request) = @_;
+    if ($request->{type} eq 'ping') {
+           $c->stash->{response} = { status => 'PONG' };
+           return;
+    }
+    die "not a ping request?";
+}
+
+1;