Package org.springframework.ui

Examples of org.springframework.ui.ModelMap.clear()


            new RedirectAttributesModelMap(), model);
    FileEntry script = (FileEntry) model.get("file");
    scriptController.save(getTestUser(), script, null, "", false, model);

    // save another script
    model.clear();
    script.setPath(script.getPath().replace("file-for-search", "new-file-for-search"));
    scriptController.save(getTestUser(), script, null, "", false, model);
    // save and get
    model.clear();
    scriptController.getOne(getTestUser(), script.getPath(), -1L, model);
View Full Code Here


    // save another script
    model.clear();
    script.setPath(script.getPath().replace("file-for-search", "new-file-for-search"));
    scriptController.save(getTestUser(), script, null, "", false, model);
    // save and get
    model.clear();
    scriptController.getOne(getTestUser(), script.getPath(), -1L, model);

    model.clear();
    scriptController.search(getTestUser(), "file-for-search", model);
    Collection<FileEntry> searchResult = (Collection<FileEntry>) model.get("files");
View Full Code Here

    scriptController.save(getTestUser(), script, null, "", false, model);
    // save and get
    model.clear();
    scriptController.getOne(getTestUser(), script.getPath(), -1L, model);

    model.clear();
    scriptController.search(getTestUser(), "file-for-search", model);
    Collection<FileEntry> searchResult = (Collection<FileEntry>) model.get("files");
    assertThat(searchResult.size(), is(2));

    model.clear();
View Full Code Here

    model.clear();
    scriptController.search(getTestUser(), "file-for-search", model);
    Collection<FileEntry> searchResult = (Collection<FileEntry>) model.get("files");
    assertThat(searchResult.size(), is(2));

    model.clear();
    // delete both files
    scriptController.delete(getTestUser(), path, "file-for-search.py,new-file-for-search.py");
    scriptController.getAll(getTestUser(), path, model);
    List<FileEntry> scriptList = (List<FileEntry>) model.get("files");
    assertThat(scriptList.size(), is(0));
View Full Code Here

    String upFileName = "Uploaded";
    MultipartFile upFile = new MockMultipartFile("Uploaded.py", "Uploaded.py", null, "#test content...".getBytes());
    path = path + "/" + upFileName;
    scriptController.upload(getTestUser(), path, "Uploaded file desc.", upFile, model);
    model.clear();
    scriptController.search(getTestUser(), "Uploaded", model);
    Collection<FileEntry> searchResult = (Collection<FileEntry>) model.get("files");
    assertThat(searchResult.size(), is(1));
  }
View Full Code Here

      tmpDownFile.deleteOnExit();
    } catch (IOException e) {
      e.printStackTrace();
    }

    model.clear();
    agentController.getAll("", model);
    Collection<AgentInfo> agents = (Collection<AgentInfo>) model.get("agents");
  }

  @Test
View Full Code Here

    assertThat(agentInDB.getName(), is(agent.getName()));
    assertThat(agentInDB.getIp(), is(agent.getIp()));
    assertThat(agentInDB.isApproved(), is(false));

    // test approve agent
    model.clear();
    agentController.approve(agentInDB.getId());
    agentController.getOne(agent.getId(), model);
    agentInDB = (AgentInfo) model.get("agent");
    assertThat(agentInDB.isApproved(), is(true));
View Full Code Here

    agentController.getOne(agent.getId(), model);
    agentInDB = (AgentInfo) model.get("agent");
    assertThat(agentInDB.isApproved(), is(true));

    // test un-approve
    model.clear();
    agentController.disapprove(agentInDB.getId());
    agentController.getOne(agent.getId(), model);
    agentInDB = (AgentInfo) model.get("agent");
    assertThat(agentInDB.isApproved(), is(false));
  }
View Full Code Here

  @Test
  public void testGetPerfTestDetail() {
    ModelMap model = new ModelMap();
    controller.getOne(getTestUser(), null, model);
    assertThat(model.get(PARAM_TEST), notNullValue());
    model.clear();

    controller.getOne(getTestUser(), 0L, model);
    assertThat(model.get(PARAM_TEST), notNullValue());
    model.clear();
    long invalidId = 123123123123L;
View Full Code Here

    assertThat(model.get(PARAM_TEST), notNullValue());
    model.clear();

    controller.getOne(getTestUser(), 0L, model);
    assertThat(model.get(PARAM_TEST), notNullValue());
    model.clear();
    long invalidId = 123123123123L;
    controller.getOne(getTestUser(), invalidId, model);
    assertThat(model.get(PARAM_TEST), notNullValue());

    PerfTest createPerfTest = createPerfTest("hello", Status.READY, new Date());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.