Examples of CodeAssistPdttFile


Examples of com.dubture.symfony.test.codeassist.CodeAssistPdttFile

  }

  protected void runPdttTest(String filename) throws Exception {
    File projectFile = new File(getSourceWorkspacePath().toString(), projectName);
    IPath path = new Path(projectFile.getAbsolutePath());
    final CodeAssistPdttFile pdttFile = new CodeAssistPdttFile(path.append(filename).toOSString());
    CompletionProposal[] proposals = getProposals(pdttFile.getFile());
    compareProposals(proposals, pdttFile);
  }
View Full Code Here

Examples of org.eclipse.php.core.tests.codeassist.CodeAssistPdttFile

      for (String testsDirectory : TESTS.get(phpVersion)) {

        for (final String fileName : getPDTTFiles(testsDirectory)) {
          try {
            final CodeAssistPdttFile pdttFile = new CodeAssistPdttFile(
                fileName);
            phpVerSuite.addTest(new SelectionEngineTests(phpVersion
                .getAlias() + " - /" + fileName) {

              protected void setUp() throws Exception {
                PHPCoreTests.setProjectPhpVersion(project,
                    phpVersion);
              }

              protected void tearDown() throws Exception {
                if (testFile != null) {
                  testFile.delete(true, null);
                  testFile = null;
                }
              }

              protected void runTest() throws Throwable {
                IModelElement[] elements = getSelection(pdttFile
                    .getFile());
                ExpectedProposal[] expectedProposals = pdttFile
                    .getExpectedProposals();

                boolean proposalsEqual = true;
                if (elements.length == expectedProposals.length) {
                  for (ExpectedProposal expectedProposal : pdttFile
                      .getExpectedProposals()) {
                    boolean found = false;
                    for (IModelElement modelElement : elements) {
                      if (modelElement.getElementType() == expectedProposal.type
                          && modelElement
                              .getElementName()
                              .equalsIgnoreCase(
                                  expectedProposal.name)) {
                        found = true;
                        break;
                      }
                    }
                    if (!found) {
                      proposalsEqual = false;
                      break;
                    }
                  }
                } else {
                  proposalsEqual = false;
                }

                if (!proposalsEqual) {
                  StringBuilder errorBuf = new StringBuilder();
                  errorBuf.append("\nEXPECTED ELEMENTS LIST:\n-----------------------------\n");
                  errorBuf.append(pdttFile.getExpected());
                  errorBuf.append("\nACTUAL ELEMENTS LIST:\n-----------------------------\n");
                  for (IModelElement modelElement : elements) {
                    switch (modelElement.getElementType()) {
                    case IModelElement.FIELD:
                      errorBuf.append("field");
View Full Code Here

Examples of org.eclipse.php.core.tests.performance.codeassist.CodeAssistPdttFile

      testsDirectory = testsDirectory.replaceAll("project", map.get(
          ProjectSuite.PROJECT).toString());
      for (final String fileName : getPDTTFiles(testsDirectory,
          PHPCorePerformanceTests.getDefault().getBundle())) {
        try {
          final CodeAssistPdttFile pdttFile = new CodeAssistPdttFile(
              PHPCorePerformanceTests.getDefault().getBundle(),
              fileName);
          SelectionEngineTests test = new SelectionEngineTests(
              fileName) {

            protected void setUp() throws Exception {
            }

            protected void tearDown() throws Exception {
              if (testFile != null) {
                testFile.delete(true, null);
                testFile = null;
              }
            }

            protected void runTest() throws Throwable {
              perfMonitor.execute(
                  "PerformanceTests.testSelectionEngine"
                      + "_" + fileName, new Operation() {
                    public void run() throws Exception {
                      IModelElement[] elements = getSelection(pdttFile
                          .getFile());
                    }
                  }, 1, 10);
            }
          };
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.