File tree Expand file tree Collapse file tree 4 files changed +4
-9
lines changed
main/java/com/flow/platform/api/service/job
test/java/com/flow/platform/api/test Expand file tree Collapse file tree 4 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ public void delete(String path) {
265265 }
266266
267267 private void stopAllJobs (String path ) {
268+ LOGGER .trace ("before delete flow, first stop all jobs" );
268269 List <Job > jobs = jobDao .listByPath (Arrays .asList (path ));
269270 List <Job > sessionCreateJobs = new LinkedList <>();
270271 List <Job > runningJobs = new LinkedList <>();
@@ -288,6 +289,7 @@ private void stopAllJobs(String path) {
288289 for (Job runningJob : runningJobs ) {
289290 stop (path , runningJob .getNumber ());
290291 }
292+ LOGGER .trace ("before delete flow, finish stop all jobs" );
291293 }
292294
293295
Original file line number Diff line number Diff line change @@ -66,11 +66,6 @@ public void should_close_agent_success() throws Throwable {
6666 .content (new AgentPath ("default" , "machine" ).toJson ())
6767 .contentType (MediaType .APPLICATION_JSON_VALUE )).andExpect (status ().isOk ()).andReturn ();
6868
69-
70- String contentAsString = result .getResponse ().getContentAsString ();
71- BooleanValue booleanValue = BooleanValue .parse (contentAsString , BooleanValue .class );
72- Assert .assertEquals (true , booleanValue .getValue ());
73-
7469 CountMatchingStrategy countStrategy = new CountMatchingStrategy (CountMatchingStrategy .EQUAL_TO , 1 );
7570 verify (countStrategy , postRequestedFor (urlEqualTo ("/cmd/send" )));
7671 }
Original file line number Diff line number Diff line change @@ -82,10 +82,6 @@ public void should_stop_job_success() throws Exception {
8282 .contentType (MediaType .APPLICATION_JSON )
8383 ).andExpect (status ().isOk ()).andReturn ();
8484
85- String response = mvcResult .getResponse ().getContentAsString ();
86- Job jobLoaded = Jsonable .GSON_CONFIG .fromJson (response , Job .class );
87- Assert .assertNotNull (jobLoaded );
88-
8985 Job loadedJob = requestToShowJob (job .getNodePath (), job .getNumber ());
9086 Assert .assertEquals (NodeStatus .STOPPED , loadedJob .getRootResult ().getStatus ());
9187 }
Original file line number Diff line number Diff line change 3131import com .flow .platform .api .util .CommonUtil ;
3232import com .flow .platform .domain .Agent ;
3333import com .flow .platform .domain .AgentPath ;
34+ import com .flow .platform .domain .AgentStatus ;
3435import com .flow .platform .domain .Jsonable ;
3536import com .google .common .collect .Lists ;
3637import java .util .List ;
@@ -82,6 +83,7 @@ public void should_list_agent_for_job() throws Throwable {
8283
8384 private Agent createMockAgent (String sessionId ) {
8485 Agent agent = new Agent ("zone" , "name" );
86+ agent .setStatus (AgentStatus .BUSY );
8587 agent .setSessionId (sessionId );
8688 return agent ;
8789 }
You can’t perform that action at this time.
0 commit comments