PageRenderTime 48ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/netbeans-7.3/php.editor/test/unit/src/org/netbeans/modules/php/editor/PHPCodeCompletion160444Test.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 217 lines | 131 code | 41 blank | 45 comment | 0 complexity | 2cb6a58138672737d162d67077b696c4 MD5 | raw file
  1. /*
  2. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  3. *
  4. * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
  5. *
  6. * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  7. * Other names may be trademarks of their respective owners.
  8. *
  9. * The contents of this file are subject to the terms of either the GNU
  10. * General Public License Version 2 only ("GPL") or the Common
  11. * Development and Distribution License("CDDL") (collectively, the
  12. * "License"). You may not use this file except in compliance with the
  13. * License. You can obtain a copy of the License at
  14. * http://www.netbeans.org/cddl-gplv2.html
  15. * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  16. * specific language governing permissions and limitations under the
  17. * License. When distributing the software, include this License Header
  18. * Notice in each file and include the License file at
  19. * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
  20. * particular file as subject to the "Classpath" exception as provided
  21. * by Oracle in the GPL Version 2 section of the License file that
  22. * accompanied this code. If applicable, add the following below the
  23. * License Header, with the fields enclosed by brackets [] replaced by
  24. * your own identifying information:
  25. * "Portions Copyrighted [year] [name of copyright owner]"
  26. *
  27. * If you wish your version of this file to be governed by only the CDDL
  28. * or only the GPL Version 2, indicate your decision by adding
  29. * "[Contributor] elects to include this software in this distribution
  30. * under the [CDDL or GPL Version 2] license." If you do not indicate a
  31. * single choice of license, a recipient has the option to distribute
  32. * your version of this file under either the CDDL, the GPL Version 2 or
  33. * to extend the choice of license to its licensees as provided above.
  34. * However, if you add GPL Version 2 code and therefore, elected the GPL
  35. * Version 2 license, then the option applies only if the new code is
  36. * made subject to such option by the copyright holder.
  37. *
  38. * Contributor(s):
  39. *
  40. * Portions Copyrighted 2011 Sun Microsystems, Inc.
  41. */
  42. package org.netbeans.modules.php.editor;
  43. import java.io.File;
  44. import java.util.Collections;
  45. import java.util.Map;
  46. import org.netbeans.api.java.classpath.ClassPath;
  47. import org.netbeans.modules.php.project.api.PhpSourcePath;
  48. import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  49. import org.openide.filesystems.FileObject;
  50. import org.openide.filesystems.FileUtil;
  51. /**
  52. *
  53. * @author Ondrej Brejla <obrejla@netbeans.org>
  54. */
  55. public class PHPCodeCompletion160444Test extends PHPCodeCompletionTestBase {
  56. public PHPCodeCompletion160444Test(String testName) {
  57. super(testName);
  58. }
  59. public void testIssue160444_1() throws Exception {
  60. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->^foo();", false);
  61. }
  62. public void testIssue160444_2() throws Exception {
  63. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj /**/->^foo();", false);
  64. }
  65. public void testIssue160444_3() throws Exception {
  66. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/ ->^foo();", false);
  67. }
  68. public void testIssue160444_4() throws Exception {
  69. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj /* aa */ ->^foo();", false);
  70. }
  71. public void testIssue160444_5() throws Exception {
  72. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/-> /**/^foo();", false);
  73. }
  74. public void testIssue160444_6() throws Exception {
  75. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/-> /**/ ^foo();", false);
  76. }
  77. public void testIssue160444_7() throws Exception {
  78. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->/**/ ^foo();", false);
  79. }
  80. public void testIssue160444_8() throws Exception {
  81. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->/**/^foo();", false);
  82. }
  83. public void testIssue160444_9() throws Exception {
  84. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/-> /* aa */^foo();", false);
  85. }
  86. public void testIssue160444_10() throws Exception {
  87. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/-> /* aa */ ^foo();", false);
  88. }
  89. public void testIssue160444_11() throws Exception {
  90. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->/* aa */^foo();", false);
  91. }
  92. public void testIssue160444_12() throws Exception {
  93. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->/* aa */ ^foo();", false);
  94. }
  95. public void testIssue160444_13() throws Exception {
  96. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->\n /* aa */\n ^foo();", false);
  97. }
  98. public void testIssue160444_14() throws Exception {
  99. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->\n /** aa */\n ^foo();", false);
  100. }
  101. public void testIssue160444_15() throws Exception {
  102. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->\n /**/\n ^foo();", false);
  103. }
  104. public void testIssue160444_16() throws Exception {
  105. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->\n // aa\n ^foo();", false);
  106. }
  107. public void testIssue160444_17() throws Exception {
  108. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->\n // aa\n^foo();", false);
  109. }
  110. public void testIssue160444_18() throws Exception {
  111. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "$obj/**/->\n// aa\n^foo();", false);
  112. }
  113. public void testIssue160444_19() throws Exception {
  114. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::^bar();", false);
  115. }
  116. public void testIssue160444_20() throws Exception {
  117. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment /**/::^bar();", false);
  118. }
  119. public void testIssue160444_21() throws Exception {
  120. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/ ::^bar();", false);
  121. }
  122. public void testIssue160444_22() throws Exception {
  123. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment /* aa */ ::^bar();", false);
  124. }
  125. public void testIssue160444_23() throws Exception {
  126. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/:: /**/^bar();", false);
  127. }
  128. public void testIssue160444_24() throws Exception {
  129. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/:: /**/ ^bar();", false);
  130. }
  131. public void testIssue160444_25() throws Exception {
  132. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::/**/ ^bar();", false);
  133. }
  134. public void testIssue160444_26() throws Exception {
  135. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::/**/^bar();", false);
  136. }
  137. public void testIssue160444_27() throws Exception {
  138. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/:: /* aa */^bar();", false);
  139. }
  140. public void testIssue160444_28() throws Exception {
  141. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/:: /* aa */ ^bar();", false);
  142. }
  143. public void testIssue160444_29() throws Exception {
  144. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::/* aa */^bar();", false);
  145. }
  146. public void testIssue160444_30() throws Exception {
  147. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::/* aa */ ^bar();", false);
  148. }
  149. public void testIssue160444_31() throws Exception {
  150. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::\n /* aa */\n ^bar();", false);
  151. }
  152. public void testIssue160444_32() throws Exception {
  153. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::\n /** aa */\n ^bar();", false);
  154. }
  155. public void testIssue160444_33() throws Exception {
  156. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::\n /**/\n ^bar();", false);
  157. }
  158. public void testIssue160444_34() throws Exception {
  159. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::\n // aa\n ^bar();", false);
  160. }
  161. public void testIssue160444_35() throws Exception {
  162. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::\n // aa\n^bar();", false);
  163. }
  164. public void testIssue160444_36() throws Exception {
  165. checkCompletion("testfiles/completion/lib/tests160444/issue160444.php", "InvocationComment/**/::\n// aa\n^bar();", false);
  166. }
  167. @Override
  168. protected Map<String, ClassPath> createClassPathsForTest() {
  169. return Collections.singletonMap(
  170. PhpSourcePath.SOURCE_CP,
  171. ClassPathSupport.createClassPath(new FileObject[] {
  172. FileUtil.toFileObject(new File(getDataDir(), "/testfiles/completion/lib/tests160444"))
  173. })
  174. );
  175. }
  176. }