Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. @Test
  2. public void testMultiByteCommitMessageOnAssetUpdate() throws Exception {
  3. Repository repository = new VFSRepository(producer.getIoService());
  4. ((VFSRepository)repository).setDescriptor(descriptor);
  5. profile.setRepository(repository);
  6. AssetBuilder builder = AssetBuilderFactory.getAssetBuilder(Asset.AssetType.Text);
  7. builder.content("custom editors content")
  8. .type("bpmn2")
  9. .name("testprocess")
  10. .location("/defaultPackage");
  11. String id = repository.createAsset(builder.getAsset());
  12.  
  13. // setup parameters
  14. Map<String, String> params = new HashMap<String, String>();
  15.  
  16. params.put("profile", "jbpm");
  17. params.put("action", "updateasset");
  18. params.put("assetid", id);
  19. params.put("assetcontent", "testprocess");
  20. params.put("commitmessage", "こんにちは世界");
  21.  
  22. boolean processAssetExists = repository.assetExists("/defaultPackage/testprocess.bpmn2");
  23. assertTrue(processAssetExists);
  24.  
  25. AssetServiceServlet assetServiceServlet = new AssetServiceServlet();
  26. assetServiceServlet.setProfile(profile);
  27.  
  28. assetServiceServlet.init(new TestServletConfig(new TestServletContext(repository)));
  29. TestHttpServletResponse response = new TestHttpServletResponse();
  30. assetServiceServlet.doPost(new TestHttpServletRequest(params), response);
  31.  
  32. assertEquals("こんにちは世界", assetServiceServlet.getCommitMessage());
  33. }
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. private String commitMessage;
  46. req.setCharacterEncoding("UTF-8");
  47.  
  48. public String getCommitMessage() {
  49. return commitMessage;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement