001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.test.java.editor.completion;
043:
044: import org.netbeans.spi.editor.completion.CompletionProvider;
045:
046: /**
047: *
048: * @author jp159440
049: */
050: public class SmartCCTests extends CompletionTestPerformer {
051:
052: public SmartCCTests(String name) {
053: super (name);
054: }
055:
056: public void testsmartassign() throws Exception {
057: new CompletionTest().test(outputWriter, logWriter,
058: "Double x = ", false, getDataDir(), "cp-prj-1",
059: "org/netbeans/test/editor/smartcompletion/Assign.java",
060: 11, CompletionProvider.COMPLETION_QUERY_TYPE);
061: }
062:
063: public void testsmartassign2() throws Exception {
064: new CompletionTest().test(outputWriter, logWriter,
065: "Number x = ", false, getDataDir(), "cp-prj-1",
066: "org/netbeans/test/editor/smartcompletion/Assign.java",
067: 11, CompletionProvider.COMPLETION_QUERY_TYPE);
068: }
069:
070: public void testsmartassign3() throws Exception {
071: new CompletionTest().test(outputWriter, logWriter,
072: "Number x = new ", false, getDataDir(), "cp-prj-1",
073: "org/netbeans/test/editor/smartcompletion/Assign.java",
074: 11, CompletionProvider.COMPLETION_QUERY_TYPE);
075: }
076:
077: public void testsmartassign4() throws Exception {
078: new CompletionTest().test(outputWriter, logWriter,
079: "List x = new ", false, getDataDir(), "cp-prj-1",
080: "org/netbeans/test/editor/smartcompletion/Assign.java",
081: 11, CompletionProvider.COMPLETION_QUERY_TYPE);
082: }
083:
084: public void testsmartassign5() throws Exception {
085: new CompletionTest().test(outputWriter, logWriter,
086: "String x = ", false, getDataDir(), "cp-prj-1",
087: "org/netbeans/test/editor/smartcompletion/Assign.java",
088: 11, CompletionProvider.COMPLETION_QUERY_TYPE);
089: }
090:
091: public void testsmartExtends() throws Exception {
092: new CompletionTest().test(outputWriter, logWriter,
093: "class A extends ", false, getDataDir(), "cp-prj-1",
094: "org/netbeans/test/editor/smartcompletion/Types.java",
095: 32, CompletionProvider.COMPLETION_QUERY_TYPE);
096: }
097:
098: public void testsmartImplements() throws Exception {
099: new CompletionTest().test(outputWriter, logWriter,
100: "class B implements ", false, getDataDir(), "cp-prj-1",
101: "org/netbeans/test/editor/smartcompletion/Types.java",
102: 32, CompletionProvider.COMPLETION_QUERY_TYPE);
103: }
104:
105: public void testsmartThrows() throws Exception {
106: new CompletionTest().test(outputWriter, logWriter,
107: "public void method() throws ", false, getDataDir(),
108: "cp-prj-1",
109: "org/netbeans/test/editor/smartcompletion/Types.java",
110: 32, CompletionProvider.COMPLETION_QUERY_TYPE);
111: }
112:
113: public void testsmartAnnotation() throws Exception {
114: new CompletionTest().test(outputWriter, logWriter, "@", false,
115: getDataDir(), "cp-prj-1",
116: "org/netbeans/test/editor/smartcompletion/Types.java",
117: 32, CompletionProvider.COMPLETION_QUERY_TYPE);
118: }
119:
120: public void testsmartImport() throws Exception {
121: new CompletionTest().test(outputWriter, logWriter, "import ",
122: false, getDataDir(), "cp-prj-1",
123: "org/netbeans/test/editor/smartcompletion/Types.java",
124: 21, CompletionProvider.COMPLETION_QUERY_TYPE);
125: }
126:
127: public void testsmartImportStatic() throws Exception {
128: new CompletionTest().test(outputWriter, logWriter,
129: "import static java.awt.Color.", false, getDataDir(),
130: "cp-prj-1",
131: "org/netbeans/test/editor/smartcompletion/Types.java",
132: 21, CompletionProvider.COMPLETION_QUERY_TYPE);
133: }
134:
135: public void testsmartSuperParameter() throws Exception {
136: new CompletionTest()
137: .test(
138: outputWriter,
139: logWriter,
140: "super(",
141: false,
142: getDataDir(),
143: "cp-prj-1",
144: "org/netbeans/test/editor/smartcompletion/SmartCC.java",
145: 31, CompletionProvider.COMPLETION_QUERY_TYPE);
146: }
147:
148: public void testsmartInnerClassAsParameter() throws Exception {
149: new CompletionTest()
150: .test(
151: outputWriter,
152: logWriter,
153: "method(",
154: false,
155: getDataDir(),
156: "cp-prj-1",
157: "org/netbeans/test/editor/smartcompletion/SmartCC.java",
158: 41, CompletionProvider.COMPLETION_QUERY_TYPE);
159: }
160:
161: public void testsmartInnerClassAsParameter2() throws Exception {
162: new CompletionTest()
163: .test(
164: outputWriter,
165: logWriter,
166: "method( new ",
167: false,
168: getDataDir(),
169: "cp-prj-1",
170: "org/netbeans/test/editor/smartcompletion/SmartCC.java",
171: 41, CompletionProvider.COMPLETION_QUERY_TYPE);
172: }
173:
174: public void testsmartReturn() throws Exception {
175: new CompletionTest()
176: .test(
177: outputWriter,
178: logWriter,
179: "return ",
180: false,
181: getDataDir(),
182: "cp-prj-1",
183: "org/netbeans/test/editor/smartcompletion/SmartCC.java",
184: 41, CompletionProvider.COMPLETION_QUERY_TYPE);
185: }
186:
187: public void testsmartReturn2() throws Exception {
188: new CompletionTest()
189: .test(
190: outputWriter,
191: logWriter,
192: "return new ",
193: false,
194: getDataDir(),
195: "cp-prj-1",
196: "org/netbeans/test/editor/smartcompletion/SmartCC.java",
197: 41, CompletionProvider.COMPLETION_QUERY_TYPE);
198: }
199:
200: public void testsmartCatch() throws Exception {
201: new CompletionTest()
202: .test(
203: outputWriter,
204: logWriter,
205: "catch (",
206: false,
207: getDataDir(),
208: "cp-prj-1",
209: "org/netbeans/test/editor/smartcompletion/SmartCC.java",
210: 51, CompletionProvider.COMPLETION_QUERY_TYPE);
211: }
212:
213: }
|