Examples of StatusInfo


Examples of com.dianping.cat.status.model.entity.StatusInfo

import com.dianping.cat.status.model.entity.StatusInfo;

public class StatusInfoCollectorTest {
  @Test
  public void test() {
    StatusInfo status = new StatusInfo();

    status.accept(new StatusInfoCollector(null, null));

    Assert.assertEquals(true, status.getDisk() != null);
    Assert.assertEquals(true, status.getMemory() != null);
    Assert.assertEquals(true, status.getMessage().getBytes() >= 0);
    Assert.assertEquals(true, status.getMessage().getOverflowed() >= 0);
    Assert.assertEquals(true, status.getMessage().getProduced() >= 0);
    Assert.assertEquals(true, status.getOs() != null);
    Assert.assertEquals(true, status.getRuntime() != null);
    Assert.assertEquals(true, status.getThread() != null);
  }
View Full Code Here

Examples of com.dianping.cat.status.model.entity.StatusInfo

public class StatusInfoTest {
  @Test
  public void testXml() throws Exception {
    String source = Files.forIO().readFrom(getClass().getResourceAsStream("status.xml"), "utf-8");
    StatusInfo root = DefaultSaxParser.parse(source);
    String xml = new DefaultXmlBuilder().buildXml(root);
    String expected = source;

    Assert.assertEquals("XML is not well parsed!", expected.replace("\r", ""), xml.replace("\r", ""));
  }
View Full Code Here

Examples of com.microsoft.windowsazure.management.sql.models.StatusInfo

            Element arrayOfStatusInfoElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ArrayOfStatusInfo");
            if (arrayOfStatusInfoElement != null) {
                if (arrayOfStatusInfoElement != null) {
                    for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(arrayOfStatusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "StatusInfo").size(); i1 = i1 + 1) {
                        org.w3c.dom.Element statusInfoElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(arrayOfStatusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "StatusInfo").get(i1));
                        StatusInfo statusInfoInstance = new StatusInfo();
                        result.getStatusInfoList().add(statusInfoInstance);
                       
                        Element blobUriElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "BlobUri");
                        if (blobUriElement != null) {
                            URI blobUriInstance;
                            blobUriInstance = new URI(blobUriElement.getTextContent());
                            statusInfoInstance.setBlobUri(blobUriInstance);
                        }
                       
                        Element databaseNameElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "DatabaseName");
                        if (databaseNameElement != null) {
                            String databaseNameInstance;
                            databaseNameInstance = databaseNameElement.getTextContent();
                            statusInfoInstance.setDatabaseName(databaseNameInstance);
                        }
                       
                        Element errorMessageElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ErrorMessage");
                        if (errorMessageElement != null) {
                            boolean isNil = false;
                            Attr nilAttribute = errorMessageElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                            if (nilAttribute != null) {
                                isNil = "true".equals(nilAttribute.getValue());
                            }
                            if (isNil == false) {
                                String errorMessageInstance;
                                errorMessageInstance = errorMessageElement.getTextContent();
                                statusInfoInstance.setErrorMessage(errorMessageInstance);
                            }
                        }
                       
                        Element lastModifiedTimeElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "LastModifiedTime");
                        if (lastModifiedTimeElement != null) {
                            Calendar lastModifiedTimeInstance;
                            lastModifiedTimeInstance = DatatypeConverter.parseDateTime(lastModifiedTimeElement.getTextContent());
                            statusInfoInstance.setLastModifiedTime(lastModifiedTimeInstance);
                        }
                       
                        Element queuedTimeElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "QueuedTime");
                        if (queuedTimeElement != null) {
                            Calendar queuedTimeInstance;
                            queuedTimeInstance = DatatypeConverter.parseDateTime(queuedTimeElement.getTextContent());
                            statusInfoInstance.setQueuedTime(queuedTimeInstance);
                        }
                       
                        Element requestIdElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "RequestId");
                        if (requestIdElement != null) {
                            String requestIdInstance;
                            requestIdInstance = requestIdElement.getTextContent();
                            statusInfoInstance.setRequestId(requestIdInstance);
                        }
                       
                        Element requestTypeElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "RequestType");
                        if (requestTypeElement != null) {
                            String requestTypeInstance;
                            requestTypeInstance = requestTypeElement.getTextContent();
                            statusInfoInstance.setRequestType(requestTypeInstance);
                        }
                       
                        Element serverNameElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ServerName");
                        if (serverNameElement != null) {
                            String serverNameInstance;
                            serverNameInstance = serverNameElement.getTextContent();
                            statusInfoInstance.setServerName(serverNameInstance);
                        }
                       
                        Element statusElement = XmlUtility.getElementByTagNameNS(statusInfoElement, "http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "Status");
                        if (statusElement != null) {
                            String statusInstance;
                            statusInstance = statusElement.getTextContent();
                            statusInfoInstance.setStatus(statusInstance);
                        }
                    }
                }
            }
           
View Full Code Here

Examples of org.eclipse.debug.internal.ui.actions.StatusInfo

    fDialogSettings = PHPUiPlugin.getDefault().getDialogSettings();

    fElement = element;

    fNameStatus = new StatusInfo();
    fPathStatus = new StatusInfo();

    NewVariableAdapter adapter = new NewVariableAdapter();
    fNameField = new StringDialogField();
    fNameField.setDialogFieldListener(adapter);
    fNameField
View Full Code Here

Examples of org.eclipse.dltk.internal.ui.dialogs.StatusInfo

    fLibrariesPage = null;
    fProjectsPage = null;
    fCurrPage = null;
    fRunnableContext = runnableContext;
    initContainerElements();
    fBuildPathStatus = new StatusInfo();
    fPathStatus = new StatusInfo();
    fCurrScriptProject = null;
  }
View Full Code Here

Examples of org.eclipse.dltk.ui.dialogs.StatusInfo

    super();
    setImageDescriptor(PDTPluginImages.DESC_WIZBAN_NEW_PHPCLASS);
    this.selection = selection;
    this.initialFilename = initialFileName;

    status = new StatusInfo();
  }
View Full Code Here

Examples of org.eclipse.dltk.ui.dialogs.StatusInfo

      }
    });
  }

  protected StatusInfo classModifiedChanged() {
    StatusInfo status = new StatusInfo();
    if (classModifierField.getSelectionButton(IS_ABSTRACT_INDEX).getSelection()
        && classModifierField.getSelectionButton(IS_FINAL_INDEX).getSelection()) {
      status.setError("A class cannot be abstract and final at the same time");
    }
    return status;
  }
View Full Code Here

Examples of org.eclipse.dltk.ui.dialogs.StatusInfo

    });
   
  }

  private StatusInfo filenameChanged() {
    StatusInfo status = new StatusInfo();
    if (!fileNameField.equals("") && getScriptFolder().getSourceModule(fileNameField.getText()).exists()) { //$NON-NLS-1$
      status.setError("The specified class already exists");
      return status;
    }

    int dotIndex = fileNameField.getText().lastIndexOf('.');
    if ((fileNameField.getText().length() == 0 || dotIndex == 0) && fileNameField.getText().length() > 0) {
      status.setError(PHPUIMessages.PHPFileCreationWizardPage_15);
      return status;
    }

    if (dotIndex != -1) {
      String fileNameWithoutExtention = fileNameField.getText().substring(0, dotIndex);
      for (int i = 0; i < fileNameWithoutExtention.length(); i++) {
        char ch = fileNameWithoutExtention.charAt(i);
        if (!(Character.isJavaIdentifierPart(ch) || ch == '.' || ch == '-')) {
          status.setError(PHPUIMessages.PHPFileCreationWizardPage_16); //$NON-NLS-1$
          return status;
        }
      }
    }
    return status;
View Full Code Here

Examples of org.eclipse.dltk.ui.dialogs.StatusInfo

    });
   
  }

  protected StatusInfo nameChanged() {
    StatusInfo status = new StatusInfo();
    if (classNameField.getText().length() == 0) {
      status.setError("Enter name of class.");
      fileNameField.setTextWithoutUpdate("");
    } else {
      fileNameField.setText(classNameField.getText() + ".php");
    }

    if (classNameField.getText().length() > 0 && Character.isLowerCase(classNameField.getText().charAt(0))) {
      status.setWarning("Classes starting with lowercase letters are discouraged");
    }

    return status;
  }
View Full Code Here

Examples of org.eclipse.dltk.ui.dialogs.StatusInfo

    super();
    setImageDescriptor(PDTPluginImages.DESC_WIZBAN_NEW_PHPINTERFACE);
    this.selection = selection;
    this.initialFilename = initialFileName;

    status = new StatusInfo();
  }
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.