Program: 73337
Project: 73337
Buggy source:
/** 
 * Start the server and client
 * @exception Exception If the the setup or shutdown of the simulation fails.
 */
@Test(timeout=2000) public void initialize() throws Exception {
  String servletUrl=String.format("String_Node_Str","String_Node_Str",CONFIG.getString("String_Node_Str"),CONFIG.getString("String_Node_Str"));
  String brokerUrl=String.format("String_Node_Str","String_Node_Str",CONFIG.getString("String_Node_Str"));
  PtolemyServer server=PtolemyServer.getInstance();
  IServerManager serverManager=(IServerManager)new HessianProxyFactory().create(IServerManager.class,servletUrl);
  RemoteModelResponse response=serverManager.open(IServerManager.class.getResource("String_Node_Str").toString());
  Ticket ticket=response.getTicket();
  RemoteModel model=new RemoteModel(ticket.getTicketID() + "String_Node_Str",ticket.getTicketID() + "String_Node_Str",RemoteModelType.CLIENT);
  IMqttClient mqttClient=MqttClient.createMqttClient(brokerUrl,null);
  mqttClient.connect("String_Node_Str" + new Random().nextInt(1000),true,(short)10);
  model.setMqttClient(mqttClient);
  model.initModel(response.getModelXML(),response.getModelTypes());
  model.setUpInfrastructure();
  CompositeActor topLevelActor=model.getTopLevelActor();
  topLevelActor.setDirector(new PNDirector(topLevelActor,"String_Node_Str"));
  SysOutActor actor=(SysOutActor)topLevelActor.getEntity("String_Node_Str");
  actor.setDelegator(new TokenDelegator(){
    @Override public void getToken(    Token token){
      if (counter < 10) {
        assertEquals(((IntToken)token).intValue() / 2,counter);
        counter++;
      }
 else {
        isWaiting=false;
      }
    }
  }
);
  serverManager.start(ticket);
  model.getManager().startRun();
  while (isWaiting) {
  }
  serverManager.stop(ticket);
  model.getManager().stop();
  server.shutdown();
  server=null;
}

Fixed version (ground truth):
/** 
 * Start the server and client
 * @exception Exception If the the setup or shutdown of the simulation fails.
 */
@Test(timeout=2000) public void initialize() throws Exception {
  String servletUrl=String.format("String_Node_Str","String_Node_Str",CONFIG.getString("String_Node_Str"),CONFIG.getString("String_Node_Str"));
  String brokerUrl=String.format("String_Node_Str","String_Node_Str",CONFIG.getString("String_Node_Str"));
  PtolemyServer server=PtolemyServer.getInstance();
  IServerManager serverManager=(IServerManager)new HessianProxyFactory().create(IServerManager.class,servletUrl);
  RemoteModelResponse response=serverManager.open(IServerManager.class.getResource("String_Node_Str").toString());
  Ticket ticket=response.getTicket();
  RemoteModel model=new RemoteModel(ticket.getTicketID() + "String_Node_Str",ticket.getTicketID() + "String_Node_Str",RemoteModelType.CLIENT);
  IMqttClient mqttClient=MqttClient.createMqttClient(brokerUrl,null);
  mqttClient.connect("String_Node_Str" + new Random().nextInt(1000),true,(short)10);
  model.setMqttClient(mqttClient);
  model.initModel(response.getModelXML(),response.getModelTypes());
  model.setUpInfrastructure();
  CompositeActor topLevelActor=model.getTopLevelActor();
  topLevelActor.setDirector(new PNDirector(topLevelActor,"String_Node_Str"));
  SysOutActor actor=(SysOutActor)topLevelActor.getEntity("String_Node_Str");
  actor.setDelegator(new TokenDelegator(){
    public void getToken(    Token token){
      if (counter < 10) {
        assertEquals(((IntToken)token).intValue() / 2,counter);
        counter++;
      }
 else {
        isWaiting=false;
      }
    }
  }
);
  serverManager.start(ticket);
  model.getManager().startRun();
  while (isWaiting) {
  }
  serverManager.stop(ticket);
  model.getManager().stop();
  server.shutdown();
  server=null;
}