コード例 #1
0
 /** {@inheritDoc} */
 public String getText(Object element) {
   if (element instanceof AutIdentifier) {
     AutIdentifier autId = ((AutIdentifier) element);
     IProjectPO currentProject = GeneralStorage.getInstance().getProject();
     String displayText = autId.getExecutableName();
     if (currentProject != null
         && AutAgentRegistration.getAutForId(autId, currentProject) != null) {
       return displayText;
     }
     return displayText + " (unknown AUT ID)"; // $NON-NLS-1$
   }
   return super.getText(element);
 }
コード例 #2
0
ファイル: AutAgent.java プロジェクト: hdwkboy/jubula.core
    /** {@inheritDoc} */
    @SuppressWarnings("synthetic-access")
    public void connectionGained(InetAddress inetAddress, int port) {
      boolean registeredAutSetWasModified = addAut(m_autId, m_autCommunicator);

      while (!registeredAutSetWasModified && !m_killDuplicateAuts) {
        m_autId = new AutIdentifier(StringParsing.incrementSequence(m_autId.getExecutableName()));
        registeredAutSetWasModified = addAut(m_autId, m_autCommunicator);
      }

      if (!registeredAutSetWasModified && m_killDuplicateAuts) {
        try {
          m_autCommunicator.send(new PrepareForShutdownMessage());
        } catch (CommunicationException e) {
          // As a result of not being able to send the message,
          // the AUT will end with a different exit code. This
          // may result in an unnecessary error dialog.
        }
        m_autCommunicator.clearListeners();
        m_autCommunicator.close();
      }
    }