forked from playframework/play1
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1849_controllerException' of https://github.com/qudini/…
…play1 into qudini-1849_controllerException
- Loading branch information
Showing
8 changed files
with
197 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
samples-and-tests/just-test-cases/app/controllers/StatusCodes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package controllers; | ||
|
||
import play.jobs.Job; | ||
import play.mvc.Controller; | ||
import play.mvc.Http.Response; | ||
|
||
public class StatusCodes extends Controller { | ||
|
||
public static void justOkay() { | ||
renderText("Okay"); | ||
} | ||
|
||
public static void rendersNotFound() { | ||
notFound(); | ||
} | ||
|
||
public static void rendersUnauthorized() { | ||
unauthorized(); | ||
} | ||
|
||
public static void usesContinuation() { | ||
final String text = await(new Job<String>() { | ||
@Override | ||
public String doJobWithResult() throws Exception { | ||
return "Job completed successfully"; | ||
} | ||
}.now()); | ||
Response.current().status = Integer.valueOf(201); | ||
renderText(text); | ||
} | ||
|
||
public static void throwsException() throws Exception { | ||
throw new UnsupportedOperationException("Whoops"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.