.meetup.com/13
Example application
Preproduction environment
Symbolic link
port=9090 shutdown_port=9190 datasource.url=jdbc:mysql://localhost/nocontainer_dev datasource.username=johannes datasource.password=johannes
public void testDeleteCategory() throws Exception { // Insert test data Category category = new Category(uniqueName()); Serializable key = getRepo().insert(category); getRepo().writeChanges(); // Ensure that data is displayed in index beginAt("categories/list.html"); assertTextPresent("Showing all categories"); assertLinkPresentWithText(category.getName()); // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there assertLinkNotPresentWithText(category.getName()); }
public void testDeleteCategory() throws Exception { // Insert test data Category category = new Category(uniqueName()); Serializable key = getRepo().insert(category); getRepo().writeChanges(); // Ensure that data is displayed in index beginAt("categories/list.html"); assertTextPresent("Showing all categories"); assertLinkPresentWithText(category.getName()); // Delete it // Ensure that the category is no longer there assertLinkNotPresentWithText(category.getName()); }
public void testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }
public void testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }
${category.name} #showErrors("category") Parent: #selectForObject("category.parent" $allCategories) Description: #springFormInput("category.description" "") #springShowErrors(" " "") Type: #selectForEnum("category.type" $categoryTypes) List all
${category.name} #showErrors("category") Parent: #selectForObject("category.parent" $allCategories) Description: #springFormInput("category.description" "") #springShowErrors(" " "") Type: #selectForEnum("category.type" $categoryTypes) List all
public void testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }
protected ModelAndView onSubmit( HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) { Category category = (Category)command; if (category.getId() == null) { Serializable key = repository.insert(category); return new ModelAndView(new RedirectView("show.html?id=" + key)); } repository.update(category); // Redirect on post - go back to the same page return new ModelAndView( new RedirectView(req.getRequestURI() + "?" + req.getQueryString())); }
protected ModelAndView onSubmit( HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) { Category category = (Category)command; if (category.getId() == null) { Serializable key = repository.insert(category); return new ModelAndView(new RedirectView("show.html?id=" + key)); } if (req.getParameter("delete") != null) { repository.delete(Category.class, category.getId()); return new ModelAndView(new RedirectView("list.html")); } repository.update(category); // Redirect on post - go back to the same page return new ModelAndView( new RedirectView(req.getRequestURI() + "?" + req.getQueryString())); }
Mon Sep 10 18:37:02 EDT 2007: Not upgraded, skipping restart Mon Sep 10 18:38:13 EDT 2007: Installed new version Stopping Starting Testing connection (user=johannes, url=jdbc:mysql://localhost/nocontainer_dev)... OK! Deploy 'nocontainer' from /home/nocontainer/test/nocontainer- app/curr/repo/com/b rodwall/nocontainer/nocontainer-web/1.1- SNAPSHOT/nocontainer-web-1.1-SNAPSHOT.wa r Server started on in s Mon Sep 10 18:39:02 EDT 2007: Not upgraded, skipping restart
./prod/nocontainer-app/operate.sh start./prod/nocontainer-app/operate.sh stop./prod/nocontainer-app/operate.sh status
Jetty: 221k
(Okay, then)