0001: /*BEGIN_COPYRIGHT_BLOCK
0002: *
0003: * Copyright (c) 2001-2007, JavaPLT group at Rice University (javaplt@rice.edu)
0004: * All rights reserved.
0005: *
0006: * Redistribution and use in source and binary forms, with or without
0007: * modification, are permitted provided that the following conditions are met:
0008: * * Redistributions of source code must retain the above copyright
0009: * notice, this list of conditions and the following disclaimer.
0010: * * Redistributions in binary form must reproduce the above copyright
0011: * notice, this list of conditions and the following disclaimer in the
0012: * documentation and/or other materials provided with the distribution.
0013: * * Neither the names of DrJava, the JavaPLT group, Rice University, nor the
0014: * names of its contributors may be used to endorse or promote products
0015: * derived from this software without specific prior written permission.
0016: *
0017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0018: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0019: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0020: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
0021: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0022: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0023: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0024: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0025: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0026: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0027: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0028: *
0029: * This software is Open Source Initiative approved Open Source Software.
0030: * Open Source Initative Approved is a trademark of the Open Source Initiative.
0031: *
0032: * This file is part of DrJava. Download the current version of this project
0033: * from http://www.drjava.org/ or http://sourceforge.net/projects/drjava/
0034: *
0035: * END_COPYRIGHT_BLOCK*/
0036:
0037: package edu.rice.cs.drjava.ui.predictive;
0038:
0039: import edu.rice.cs.drjava.DrJavaTestCase;
0040:
0041: import java.util.List;
0042:
0043: /**
0044: * Unit tests for PredictiveInputModel class.
0045: */
0046: public class PredictiveInputModelTest extends DrJavaTestCase {
0047: public void testInitial() {
0048: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0049: false,
0050: new PredictiveInputModel.PrefixStrategy<String>(),
0051: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0052: "Utilities.java");
0053: assertEquals("AboutDialog.java", pim.getCurrentItem());
0054: assertEquals("", pim.getMask());
0055: assertEquals(4, pim.getMatchingItems().size());
0056: assertEquals("", pim.getSharedMaskExtension());
0057: }
0058:
0059: public void testEmpty() {
0060: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0061: false,
0062: new PredictiveInputModel.PrefixStrategy<String>());
0063: assertEquals(null, pim.getCurrentItem());
0064: assertEquals("", pim.getMask());
0065: assertEquals(0, pim.getMatchingItems().size());
0066: assertEquals("", pim.getSharedMaskExtension());
0067:
0068: pim.setMask("F");
0069: assertEquals(null, pim.getCurrentItem());
0070: assertEquals("F", pim.getMask());
0071: assertEquals(0, pim.getMatchingItems().size());
0072: assertEquals("", pim.getSharedMaskExtension());
0073:
0074: pim.extendMask(pim.getSharedMaskExtension());
0075: assertEquals(null, pim.getCurrentItem());
0076: assertEquals("F", pim.getMask());
0077: assertEquals(0, pim.getMatchingItems().size());
0078: assertEquals("", pim.getSharedMaskExtension());
0079:
0080: pim.extendMask(".");
0081: assertEquals(null, pim.getCurrentItem());
0082: assertEquals("F.", pim.getMask());
0083: assertEquals(0, pim.getMatchingItems().size());
0084: assertEquals("", pim.getSharedMaskExtension());
0085:
0086: pim.extendMask("x");
0087: assertEquals(null, pim.getCurrentItem());
0088: assertEquals("F.x", pim.getMask());
0089: assertEquals(0, pim.getMatchingItems().size());
0090: assertEquals("", pim.getSharedMaskExtension());
0091:
0092: pim.extendMask("y");
0093: assertEquals(null, pim.getCurrentItem());
0094: assertEquals("F.xy", pim.getMask());
0095: assertEquals(0, pim.getMatchingItems().size());
0096: assertEquals("", pim.getSharedMaskExtension());
0097:
0098: pim.setList("AboutDialog.java", "FileOps.java",
0099: "FileOpsTest.java", "Utilities.java");
0100: pim.setMask("F");
0101: assertEquals("FileOps.java", pim.getCurrentItem());
0102: assertEquals("F", pim.getMask());
0103: assertEquals(2, pim.getMatchingItems().size());
0104: assertEquals("ileOps", pim.getSharedMaskExtension());
0105:
0106: pim.extendMask(pim.getSharedMaskExtension());
0107: assertEquals("FileOps.java", pim.getCurrentItem());
0108: assertEquals("FileOps", pim.getMask());
0109: assertEquals(2, pim.getMatchingItems().size());
0110: assertEquals("", pim.getSharedMaskExtension());
0111:
0112: pim.extendMask(".");
0113: assertEquals("FileOps.java", pim.getCurrentItem());
0114: assertEquals("FileOps.", pim.getMask());
0115: assertEquals(1, pim.getMatchingItems().size());
0116: assertEquals("java", pim.getSharedMaskExtension());
0117:
0118: pim.extendMask("x");
0119: assertEquals("FileOps.java", pim.getCurrentItem());
0120: assertEquals("FileOps.x", pim.getMask());
0121: assertEquals(0, pim.getMatchingItems().size());
0122: assertEquals("", pim.getSharedMaskExtension());
0123:
0124: pim.extendMask("y");
0125: assertEquals("FileOps.java", pim.getCurrentItem());
0126: assertEquals("FileOps.xy", pim.getMask());
0127: assertEquals(0, pim.getMatchingItems().size());
0128: assertEquals("", pim.getSharedMaskExtension());
0129: }
0130:
0131: public void testNarrowingWithExtend() {
0132: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0133: false,
0134: new PredictiveInputModel.PrefixStrategy<String>(),
0135: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0136: "Utilities.java");
0137: pim.setMask("F");
0138: assertEquals("FileOps.java", pim.getCurrentItem());
0139: assertEquals("F", pim.getMask());
0140: assertEquals(2, pim.getMatchingItems().size());
0141: assertEquals("ileOps", pim.getSharedMaskExtension());
0142:
0143: pim.extendMask(pim.getSharedMaskExtension());
0144: assertEquals("FileOps.java", pim.getCurrentItem());
0145: assertEquals("FileOps", pim.getMask());
0146: assertEquals(2, pim.getMatchingItems().size());
0147: assertEquals("", pim.getSharedMaskExtension());
0148:
0149: pim.extendMask(".");
0150: assertEquals("FileOps.java", pim.getCurrentItem());
0151: assertEquals("FileOps.", pim.getMask());
0152: assertEquals(1, pim.getMatchingItems().size());
0153: assertEquals("java", pim.getSharedMaskExtension());
0154:
0155: pim.extendMask("x");
0156: assertEquals("FileOps.java", pim.getCurrentItem());
0157: assertEquals("FileOps.x", pim.getMask());
0158: assertEquals(0, pim.getMatchingItems().size());
0159: assertEquals("", pim.getSharedMaskExtension());
0160:
0161: pim.extendMask("y");
0162: assertEquals("FileOps.java", pim.getCurrentItem());
0163: assertEquals("FileOps.xy", pim.getMask());
0164: assertEquals(0, pim.getMatchingItems().size());
0165: assertEquals("", pim.getSharedMaskExtension());
0166: }
0167:
0168: public void testNarrowingWithSet() {
0169: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0170: false,
0171: new PredictiveInputModel.PrefixStrategy<String>(),
0172: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0173: "Utilities.java");
0174: pim.setMask("F");
0175: assertEquals("FileOps.java", pim.getCurrentItem());
0176: assertEquals("F", pim.getMask());
0177: assertEquals(2, pim.getMatchingItems().size());
0178: assertEquals("ileOps", pim.getSharedMaskExtension());
0179:
0180: pim.setMask(pim.getMask() + pim.getSharedMaskExtension());
0181: assertEquals("FileOps.java", pim.getCurrentItem());
0182: assertEquals("FileOps", pim.getMask());
0183: assertEquals(2, pim.getMatchingItems().size());
0184: assertEquals("", pim.getSharedMaskExtension());
0185:
0186: pim.setMask(pim.getMask() + ".");
0187: assertEquals("FileOps.java", pim.getCurrentItem());
0188: assertEquals("FileOps.", pim.getMask());
0189: assertEquals(1, pim.getMatchingItems().size());
0190: assertEquals("java", pim.getSharedMaskExtension());
0191:
0192: pim.setMask(pim.getMask() + "x");
0193: assertEquals("FileOps.java", pim.getCurrentItem());
0194: assertEquals("FileOps.x", pim.getMask());
0195: assertEquals(0, pim.getMatchingItems().size());
0196: assertEquals("", pim.getSharedMaskExtension());
0197:
0198: pim.setMask(pim.getMask() + "y");
0199: assertEquals("FileOps.java", pim.getCurrentItem());
0200: assertEquals("FileOps.xy", pim.getMask());
0201: assertEquals(0, pim.getMatchingItems().size());
0202: assertEquals("", pim.getSharedMaskExtension());
0203: }
0204:
0205: public void testWidening() {
0206: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0207: false,
0208: new PredictiveInputModel.PrefixStrategy<String>(),
0209: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0210: "Utilities.java");
0211: pim.setMask("FileOps.");
0212: assertEquals("FileOps.java", pim.getCurrentItem());
0213: assertEquals("FileOps.", pim.getMask());
0214: assertEquals(1, pim.getMatchingItems().size());
0215: assertEquals("java", pim.getSharedMaskExtension());
0216:
0217: pim.setMask("FileOps");
0218: assertEquals("FileOps.java", pim.getCurrentItem());
0219: assertEquals("FileOps", pim.getMask());
0220: assertEquals(2, pim.getMatchingItems().size());
0221: assertEquals("", pim.getSharedMaskExtension());
0222:
0223: pim.setMask("F");
0224: assertEquals("FileOps.java", pim.getCurrentItem());
0225: assertEquals("F", pim.getMask());
0226: assertEquals(2, pim.getMatchingItems().size());
0227: assertEquals("ileOps", pim.getSharedMaskExtension());
0228:
0229: pim.setMask("");
0230: assertEquals("FileOps.java", pim.getCurrentItem());
0231: assertEquals("", pim.getMask());
0232: assertEquals(4, pim.getMatchingItems().size());
0233: assertEquals("", pim.getSharedMaskExtension());
0234: }
0235:
0236: public void testSetMatching() {
0237: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0238: false,
0239: new PredictiveInputModel.PrefixStrategy<String>(),
0240: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0241: "Utilities.java");
0242: pim.setMask("F");
0243: assertEquals("FileOps.java", pim.getCurrentItem());
0244: assertEquals("F", pim.getMask());
0245: assertEquals(2, pim.getMatchingItems().size());
0246: assertEquals("ileOps", pim.getSharedMaskExtension());
0247:
0248: pim.setCurrentItem(pim.getCurrentItem());
0249: assertEquals("FileOps.java", pim.getCurrentItem());
0250: assertEquals("F", pim.getMask());
0251: assertEquals(2, pim.getMatchingItems().size());
0252: assertEquals("ileOps", pim.getSharedMaskExtension());
0253:
0254: List<String> m = pim.getMatchingItems();
0255: int i = m.indexOf(pim.getCurrentItem());
0256: pim.setCurrentItem(m.get(i + 1));
0257: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0258: assertEquals("F", pim.getMask());
0259: assertEquals(2, pim.getMatchingItems().size());
0260: assertEquals("ileOps", pim.getSharedMaskExtension());
0261: }
0262:
0263: public void testSetNotMatching() {
0264: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0265: false,
0266: new PredictiveInputModel.PrefixStrategy<String>(),
0267: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0268: "Utilities.java");
0269: pim.setMask("F");
0270: assertEquals("FileOps.java", pim.getCurrentItem());
0271: assertEquals("F", pim.getMask());
0272: assertEquals(2, pim.getMatchingItems().size());
0273: assertEquals("ileOps", pim.getSharedMaskExtension());
0274:
0275: pim.setCurrentItem("AboutDialog.java");
0276: assertEquals("FileOps.java", pim.getCurrentItem());
0277: assertEquals("F", pim.getMask());
0278: assertEquals(2, pim.getMatchingItems().size());
0279: assertEquals("ileOps", pim.getSharedMaskExtension());
0280:
0281: pim.setCurrentItem("Utilities.java");
0282: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0283: assertEquals("F", pim.getMask());
0284: assertEquals(2, pim.getMatchingItems().size());
0285: assertEquals("ileOps", pim.getSharedMaskExtension());
0286: }
0287:
0288: public void testSetNotInList() {
0289: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0290: false,
0291: new PredictiveInputModel.PrefixStrategy<String>(),
0292: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0293: "Utilities.java");
0294: pim.setMask("F");
0295: assertEquals("FileOps.java", pim.getCurrentItem());
0296: assertEquals("F", pim.getMask());
0297: assertEquals(2, pim.getMatchingItems().size());
0298: assertEquals("ileOps", pim.getSharedMaskExtension());
0299:
0300: pim.setCurrentItem("BBBB");
0301: assertEquals("FileOps.java", pim.getCurrentItem());
0302: assertEquals("F", pim.getMask());
0303: assertEquals(2, pim.getMatchingItems().size());
0304: assertEquals("ileOps", pim.getSharedMaskExtension());
0305:
0306: pim.setCurrentItem("FileOps.XXX");
0307: assertEquals("FileOps.java", pim.getCurrentItem());
0308: assertEquals("F", pim.getMask());
0309: assertEquals(2, pim.getMatchingItems().size());
0310: assertEquals("ileOps", pim.getSharedMaskExtension());
0311:
0312: pim.setCurrentItem("XXX");
0313: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0314: assertEquals("F", pim.getMask());
0315: assertEquals(2, pim.getMatchingItems().size());
0316: assertEquals("ileOps", pim.getSharedMaskExtension());
0317: }
0318:
0319: public void testIgnoreCaseNarrowingWithExtend() {
0320: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0321: true,
0322: new PredictiveInputModel.PrefixStrategy<String>(),
0323: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0324: "Utilities.java");
0325: pim.setMask("f");
0326: assertEquals("FileOps.java", pim.getCurrentItem());
0327: assertEquals("f", pim.getMask());
0328: assertEquals(2, pim.getMatchingItems().size());
0329: assertEquals("ileOps", pim.getSharedMaskExtension());
0330:
0331: pim.extendMask(pim.getSharedMaskExtension().toUpperCase());
0332: assertEquals("FileOps.java", pim.getCurrentItem());
0333: assertEquals("fILEOPS", pim.getMask());
0334: assertEquals(2, pim.getMatchingItems().size());
0335: assertEquals("", pim.getSharedMaskExtension());
0336:
0337: pim.extendMask(".");
0338: assertEquals("FileOps.java", pim.getCurrentItem());
0339: assertEquals("fILEOPS.", pim.getMask());
0340: assertEquals(1, pim.getMatchingItems().size());
0341: assertEquals("java", pim.getSharedMaskExtension());
0342:
0343: pim.extendMask("x");
0344: assertEquals("FileOps.java", pim.getCurrentItem());
0345: assertEquals("fILEOPS.x", pim.getMask());
0346: assertEquals(0, pim.getMatchingItems().size());
0347: assertEquals("", pim.getSharedMaskExtension());
0348:
0349: pim.extendMask("y");
0350: assertEquals("FileOps.java", pim.getCurrentItem());
0351: assertEquals("fILEOPS.xy", pim.getMask());
0352: assertEquals(0, pim.getMatchingItems().size());
0353: assertEquals("", pim.getSharedMaskExtension());
0354: }
0355:
0356: public void testIgnoreCaseNarrowingWithSet() {
0357: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0358: true,
0359: new PredictiveInputModel.PrefixStrategy<String>(),
0360: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0361: "Utilities.java");
0362: pim.setMask("f");
0363: assertEquals("FileOps.java", pim.getCurrentItem());
0364: assertEquals("f", pim.getMask());
0365: assertEquals(2, pim.getMatchingItems().size());
0366: assertEquals("ileOps", pim.getSharedMaskExtension());
0367:
0368: pim.setMask(pim.getMask()
0369: + pim.getSharedMaskExtension().toUpperCase());
0370: assertEquals("FileOps.java", pim.getCurrentItem());
0371: assertEquals("fILEOPS", pim.getMask());
0372: assertEquals(2, pim.getMatchingItems().size());
0373: assertEquals("", pim.getSharedMaskExtension());
0374:
0375: pim.setMask(pim.getMask() + ".");
0376: assertEquals("FileOps.java", pim.getCurrentItem());
0377: assertEquals("fILEOPS.", pim.getMask());
0378: assertEquals(1, pim.getMatchingItems().size());
0379: assertEquals("java", pim.getSharedMaskExtension());
0380:
0381: pim.setMask(pim.getMask() + "x");
0382: assertEquals("FileOps.java", pim.getCurrentItem());
0383: assertEquals("fILEOPS.x", pim.getMask());
0384: assertEquals(0, pim.getMatchingItems().size());
0385: assertEquals("", pim.getSharedMaskExtension());
0386:
0387: pim.setMask(pim.getMask() + "y");
0388: assertEquals("FileOps.java", pim.getCurrentItem());
0389: assertEquals("fILEOPS.xy", pim.getMask());
0390: assertEquals(0, pim.getMatchingItems().size());
0391: assertEquals("", pim.getSharedMaskExtension());
0392: }
0393:
0394: public void testIgnoreCaseWidening() {
0395: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0396: true,
0397: new PredictiveInputModel.PrefixStrategy<String>(),
0398: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0399: "Utilities.java");
0400: pim.setMask("fILEOPS.");
0401: assertEquals("FileOps.java", pim.getCurrentItem());
0402: assertEquals("fILEOPS.", pim.getMask());
0403: assertEquals(1, pim.getMatchingItems().size());
0404: assertEquals("java", pim.getSharedMaskExtension());
0405:
0406: pim.setMask("fILEOPS");
0407: assertEquals("FileOps.java", pim.getCurrentItem());
0408: assertEquals("fILEOPS", pim.getMask());
0409: assertEquals(2, pim.getMatchingItems().size());
0410: assertEquals("", pim.getSharedMaskExtension());
0411:
0412: pim.setMask("f");
0413: assertEquals("FileOps.java", pim.getCurrentItem());
0414: assertEquals("f", pim.getMask());
0415: assertEquals(2, pim.getMatchingItems().size());
0416: assertEquals("ileOps", pim.getSharedMaskExtension());
0417:
0418: pim.setMask("");
0419: assertEquals("FileOps.java", pim.getCurrentItem());
0420: assertEquals("", pim.getMask());
0421: assertEquals(4, pim.getMatchingItems().size());
0422: assertEquals("", pim.getSharedMaskExtension());
0423: }
0424:
0425: public void testIgnoreCaseSetMatching() {
0426: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0427: true,
0428: new PredictiveInputModel.PrefixStrategy<String>(),
0429: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0430: "Utilities.java");
0431: pim.setMask("f");
0432: assertEquals("FileOps.java", pim.getCurrentItem());
0433: assertEquals("f", pim.getMask());
0434: assertEquals(2, pim.getMatchingItems().size());
0435: assertEquals("ileOps", pim.getSharedMaskExtension());
0436:
0437: pim.setCurrentItem(pim.getCurrentItem());
0438: assertEquals("FileOps.java", pim.getCurrentItem());
0439: assertEquals("f", pim.getMask());
0440: assertEquals(2, pim.getMatchingItems().size());
0441: assertEquals("ileOps", pim.getSharedMaskExtension());
0442:
0443: pim.setCurrentItem(pim.getCurrentItem().toUpperCase());
0444: assertEquals("FileOps.java", pim.getCurrentItem());
0445: assertEquals("f", pim.getMask());
0446: assertEquals(2, pim.getMatchingItems().size());
0447: assertEquals("ileOps", pim.getSharedMaskExtension());
0448:
0449: List<String> m = pim.getMatchingItems();
0450: int i = m.indexOf(pim.getCurrentItem());
0451: pim.setCurrentItem(m.get(i + 1).toUpperCase());
0452: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0453: assertEquals("f", pim.getMask());
0454: assertEquals(2, pim.getMatchingItems().size());
0455: assertEquals("ileOps", pim.getSharedMaskExtension());
0456: }
0457:
0458: public void testIgnoreCaseSetNotMatching() {
0459: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0460: true,
0461: new PredictiveInputModel.PrefixStrategy<String>(),
0462: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0463: "Utilities.java");
0464: pim.setMask("f");
0465: assertEquals("FileOps.java", pim.getCurrentItem());
0466: assertEquals("f", pim.getMask());
0467: assertEquals(2, pim.getMatchingItems().size());
0468: assertEquals("ileOps", pim.getSharedMaskExtension());
0469:
0470: pim.setCurrentItem("AboutDialog.java");
0471: assertEquals("FileOps.java", pim.getCurrentItem());
0472: assertEquals("f", pim.getMask());
0473: assertEquals(2, pim.getMatchingItems().size());
0474: assertEquals("ileOps", pim.getSharedMaskExtension());
0475:
0476: pim.setCurrentItem("aboutDIALOG.JAVa");
0477: assertEquals("FileOps.java", pim.getCurrentItem());
0478: assertEquals("f", pim.getMask());
0479: assertEquals(2, pim.getMatchingItems().size());
0480: assertEquals("ileOps", pim.getSharedMaskExtension());
0481:
0482: pim.setCurrentItem("Utilities.java");
0483: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0484: assertEquals("f", pim.getMask());
0485: assertEquals(2, pim.getMatchingItems().size());
0486: assertEquals("ileOps", pim.getSharedMaskExtension());
0487:
0488: pim.setCurrentItem("uTILIties.JaVa");
0489: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0490: assertEquals("f", pim.getMask());
0491: assertEquals(2, pim.getMatchingItems().size());
0492: assertEquals("ileOps", pim.getSharedMaskExtension());
0493: }
0494:
0495: public void testIgnoreCaseSetNotInList() {
0496: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0497: true,
0498: new PredictiveInputModel.PrefixStrategy<String>(),
0499: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0500: "Utilities.java");
0501: pim.setMask("f");
0502: assertEquals("FileOps.java", pim.getCurrentItem());
0503: assertEquals("f", pim.getMask());
0504: assertEquals(2, pim.getMatchingItems().size());
0505: assertEquals("ileOps", pim.getSharedMaskExtension());
0506:
0507: pim.setCurrentItem("BBBB");
0508: assertEquals("FileOps.java", pim.getCurrentItem());
0509: assertEquals("f", pim.getMask());
0510: assertEquals(2, pim.getMatchingItems().size());
0511: assertEquals("ileOps", pim.getSharedMaskExtension());
0512:
0513: pim.setCurrentItem("bbbb");
0514: assertEquals("FileOps.java", pim.getCurrentItem());
0515: assertEquals("f", pim.getMask());
0516: assertEquals(2, pim.getMatchingItems().size());
0517: assertEquals("ileOps", pim.getSharedMaskExtension());
0518:
0519: pim.setCurrentItem("FileOps.XXX");
0520: assertEquals("FileOps.java", pim.getCurrentItem());
0521: assertEquals("f", pim.getMask());
0522: assertEquals(2, pim.getMatchingItems().size());
0523: assertEquals("ileOps", pim.getSharedMaskExtension());
0524:
0525: pim.setCurrentItem("fILEoPS.xXx");
0526: assertEquals("FileOps.java", pim.getCurrentItem());
0527: assertEquals("f", pim.getMask());
0528: assertEquals(2, pim.getMatchingItems().size());
0529: assertEquals("ileOps", pim.getSharedMaskExtension());
0530:
0531: pim.setCurrentItem("xxx");
0532: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0533: assertEquals("f", pim.getMask());
0534: assertEquals(2, pim.getMatchingItems().size());
0535: assertEquals("ileOps", pim.getSharedMaskExtension());
0536: }
0537:
0538: public void testFragmentInitial() {
0539: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0540: false,
0541: new PredictiveInputModel.FragmentStrategy<String>(),
0542: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0543: "Utilities.java");
0544: assertEquals("AboutDialog.java", pim.getCurrentItem());
0545: assertEquals("", pim.getMask());
0546: assertEquals(4, pim.getMatchingItems().size());
0547: assertEquals("", pim.getSharedMaskExtension());
0548: }
0549:
0550: public void testFragmentEmpty() {
0551: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0552: false,
0553: new PredictiveInputModel.FragmentStrategy<String>());
0554: assertEquals(null, pim.getCurrentItem());
0555: assertEquals("", pim.getMask());
0556: assertEquals(0, pim.getMatchingItems().size());
0557:
0558: pim.setMask("F");
0559: assertEquals(null, pim.getCurrentItem());
0560: assertEquals("F", pim.getMask());
0561: assertEquals(0, pim.getMatchingItems().size());
0562:
0563: pim.extendMask(pim.getSharedMaskExtension());
0564: assertEquals(null, pim.getCurrentItem());
0565: assertEquals("F", pim.getMask());
0566: assertEquals(0, pim.getMatchingItems().size());
0567:
0568: pim.extendMask(".");
0569: assertEquals(null, pim.getCurrentItem());
0570: assertEquals("F.", pim.getMask());
0571: assertEquals(0, pim.getMatchingItems().size());
0572:
0573: pim.extendMask("x");
0574: assertEquals(null, pim.getCurrentItem());
0575: assertEquals("F.x", pim.getMask());
0576: assertEquals(0, pim.getMatchingItems().size());
0577:
0578: pim.extendMask("y");
0579: assertEquals(null, pim.getCurrentItem());
0580: assertEquals("F.xy", pim.getMask());
0581: assertEquals(0, pim.getMatchingItems().size());
0582:
0583: pim.setMask("i .java");
0584: assertEquals(null, pim.getCurrentItem());
0585: assertEquals("i .java", pim.getMask());
0586: assertEquals(0, pim.getMatchingItems().size());
0587:
0588: pim.setList("AboutDialog.java", "FileOps.java",
0589: "FileOpsTest.java", "Utilities.java");
0590: pim.setMask("F");
0591: assertEquals("FileOps.java", pim.getCurrentItem());
0592: assertEquals("F", pim.getMask());
0593: assertEquals(2, pim.getMatchingItems().size());
0594:
0595: pim.extendMask("ileOps");
0596: assertEquals("FileOps.java", pim.getCurrentItem());
0597: assertEquals("FileOps", pim.getMask());
0598: assertEquals(2, pim.getMatchingItems().size());
0599:
0600: pim.extendMask(".");
0601: assertEquals("FileOps.java", pim.getCurrentItem());
0602: assertEquals("FileOps.", pim.getMask());
0603: assertEquals(1, pim.getMatchingItems().size());
0604:
0605: pim.extendMask("x");
0606: assertEquals("AboutDialog.java", pim.getCurrentItem());
0607: assertEquals("FileOps.x", pim.getMask());
0608: assertEquals(0, pim.getMatchingItems().size());
0609:
0610: pim.extendMask("y");
0611: assertEquals("AboutDialog.java", pim.getCurrentItem());
0612: assertEquals("FileOps.xy", pim.getMask());
0613: assertEquals(0, pim.getMatchingItems().size());
0614:
0615: pim.setMask("File java");
0616: assertEquals("FileOps.java", pim.getCurrentItem());
0617: assertEquals("File java", pim.getMask());
0618: assertEquals(2, pim.getMatchingItems().size());
0619: }
0620:
0621: public void testFragmentNarrowingWithExtend() {
0622: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0623: false,
0624: new PredictiveInputModel.FragmentStrategy<String>(),
0625: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0626: "Utilities.java");
0627: pim.setMask("F");
0628: assertEquals("FileOps.java", pim.getCurrentItem());
0629: assertEquals("F", pim.getMask());
0630: assertEquals(2, pim.getMatchingItems().size());
0631:
0632: pim.extendMask(" ileOps");
0633: assertEquals("FileOps.java", pim.getCurrentItem());
0634: assertEquals("F ileOps", pim.getMask());
0635: assertEquals(2, pim.getMatchingItems().size());
0636:
0637: pim.extendMask(".");
0638: assertEquals("FileOps.java", pim.getCurrentItem());
0639: assertEquals("F ileOps.", pim.getMask());
0640: assertEquals(1, pim.getMatchingItems().size());
0641:
0642: pim.extendMask("x");
0643: assertEquals("AboutDialog.java", pim.getCurrentItem());
0644: assertEquals("F ileOps.x", pim.getMask());
0645: assertEquals(0, pim.getMatchingItems().size());
0646:
0647: pim.extendMask("y");
0648: assertEquals("AboutDialog.java", pim.getCurrentItem());
0649: assertEquals("F ileOps.xy", pim.getMask());
0650: assertEquals(0, pim.getMatchingItems().size());
0651: }
0652:
0653: public void testFragmentNarrowingWithSet() {
0654: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0655: false,
0656: new PredictiveInputModel.FragmentStrategy<String>(),
0657: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0658: "Utilities.java");
0659: pim.setMask("F");
0660: assertEquals("FileOps.java", pim.getCurrentItem());
0661: assertEquals("F", pim.getMask());
0662: assertEquals(2, pim.getMatchingItems().size());
0663:
0664: pim.setMask("F ileOps");
0665: assertEquals("FileOps.java", pim.getCurrentItem());
0666: assertEquals("F ileOps", pim.getMask());
0667: assertEquals(2, pim.getMatchingItems().size());
0668:
0669: pim.setMask(pim.getMask() + ".");
0670: assertEquals("FileOps.java", pim.getCurrentItem());
0671: assertEquals("F ileOps.", pim.getMask());
0672: assertEquals(1, pim.getMatchingItems().size());
0673:
0674: pim.setMask(pim.getMask() + "x");
0675: assertEquals("AboutDialog.java", pim.getCurrentItem());
0676: assertEquals("F ileOps.x", pim.getMask());
0677: assertEquals(0, pim.getMatchingItems().size());
0678:
0679: pim.setMask(pim.getMask() + "y");
0680: assertEquals("AboutDialog.java", pim.getCurrentItem());
0681: assertEquals("F ileOps.xy", pim.getMask());
0682: assertEquals(0, pim.getMatchingItems().size());
0683: }
0684:
0685: public void testFragmentWidening() {
0686: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0687: false,
0688: new PredictiveInputModel.FragmentStrategy<String>(),
0689: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0690: "Utilities.java");
0691: pim.setMask("File Ops.");
0692: assertEquals("FileOps.java", pim.getCurrentItem());
0693: assertEquals("File Ops.", pim.getMask());
0694: assertEquals(1, pim.getMatchingItems().size());
0695:
0696: pim.setMask("File Ops");
0697: assertEquals("FileOps.java", pim.getCurrentItem());
0698: assertEquals("File Ops", pim.getMask());
0699: assertEquals(2, pim.getMatchingItems().size());
0700:
0701: pim.setMask("F i");
0702: assertEquals("FileOps.java", pim.getCurrentItem());
0703: assertEquals("F i", pim.getMask());
0704: assertEquals(2, pim.getMatchingItems().size());
0705:
0706: pim.setMask("");
0707: assertEquals("FileOps.java", pim.getCurrentItem());
0708: assertEquals("", pim.getMask());
0709: assertEquals(4, pim.getMatchingItems().size());
0710: }
0711:
0712: public void testFragmentSetMatching() {
0713: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0714: false,
0715: new PredictiveInputModel.FragmentStrategy<String>(),
0716: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0717: "Utilities.java");
0718: pim.setMask("F");
0719: assertEquals("FileOps.java", pim.getCurrentItem());
0720: assertEquals("F", pim.getMask());
0721: assertEquals(2, pim.getMatchingItems().size());
0722:
0723: pim.setCurrentItem(pim.getCurrentItem());
0724: assertEquals("FileOps.java", pim.getCurrentItem());
0725: assertEquals("F", pim.getMask());
0726: assertEquals(2, pim.getMatchingItems().size());
0727:
0728: List<String> m = pim.getMatchingItems();
0729: int i = m.indexOf(pim.getCurrentItem());
0730: pim.setCurrentItem(m.get(i + 1));
0731: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0732: assertEquals("F", pim.getMask());
0733: assertEquals(2, pim.getMatchingItems().size());
0734: }
0735:
0736: public void testFragmentSetNotMatching() {
0737: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0738: false,
0739: new PredictiveInputModel.FragmentStrategy<String>(),
0740: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0741: "Utilities.java");
0742: pim.setMask("F");
0743: assertEquals("FileOps.java", pim.getCurrentItem());
0744: assertEquals("F", pim.getMask());
0745: assertEquals(2, pim.getMatchingItems().size());
0746:
0747: pim.setCurrentItem("AboutDialog.java");
0748: assertEquals("FileOps.java", pim.getCurrentItem());
0749: assertEquals("F", pim.getMask());
0750: assertEquals(2, pim.getMatchingItems().size());
0751:
0752: pim.setCurrentItem("Utilities.java");
0753: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0754: assertEquals("F", pim.getMask());
0755: assertEquals(2, pim.getMatchingItems().size());
0756: }
0757:
0758: public void testFragmentSetNotInList() {
0759: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0760: false,
0761: new PredictiveInputModel.FragmentStrategy<String>(),
0762: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0763: "Utilities.java");
0764: pim.setMask("F");
0765: assertEquals("FileOps.java", pim.getCurrentItem());
0766: assertEquals("F", pim.getMask());
0767: assertEquals(2, pim.getMatchingItems().size());
0768:
0769: pim.setCurrentItem("BBBB");
0770: assertEquals("FileOps.java", pim.getCurrentItem());
0771: assertEquals("F", pim.getMask());
0772: assertEquals(2, pim.getMatchingItems().size());
0773:
0774: pim.setCurrentItem("FileOps.XXX");
0775: assertEquals("FileOps.java", pim.getCurrentItem());
0776: assertEquals("F", pim.getMask());
0777: assertEquals(2, pim.getMatchingItems().size());
0778:
0779: pim.setCurrentItem("XXX");
0780: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0781: assertEquals("F", pim.getMask());
0782: assertEquals(2, pim.getMatchingItems().size());
0783: }
0784:
0785: public void testFragmentIgnoreCaseEmpty() {
0786: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0787: true,
0788: new PredictiveInputModel.FragmentStrategy<String>());
0789: assertEquals(null, pim.getCurrentItem());
0790: assertEquals("", pim.getMask());
0791: assertEquals(0, pim.getMatchingItems().size());
0792:
0793: pim.setMask("F");
0794: assertEquals(null, pim.getCurrentItem());
0795: assertEquals("F", pim.getMask());
0796: assertEquals(0, pim.getMatchingItems().size());
0797:
0798: pim.extendMask(".");
0799: assertEquals(null, pim.getCurrentItem());
0800: assertEquals("F.", pim.getMask());
0801: assertEquals(0, pim.getMatchingItems().size());
0802:
0803: pim.extendMask("x");
0804: assertEquals(null, pim.getCurrentItem());
0805: assertEquals("F.x", pim.getMask());
0806: assertEquals(0, pim.getMatchingItems().size());
0807:
0808: pim.extendMask("y");
0809: assertEquals(null, pim.getCurrentItem());
0810: assertEquals("F.xy", pim.getMask());
0811: assertEquals(0, pim.getMatchingItems().size());
0812:
0813: pim.setMask("I .JAVa");
0814: assertEquals(null, pim.getCurrentItem());
0815: assertEquals("I .JAVa", pim.getMask());
0816: assertEquals(0, pim.getMatchingItems().size());
0817:
0818: pim.setList("AboutDialog.java", "FileOps.java",
0819: "FileOpsTest.java", "Utilities.java");
0820: pim.setMask("F");
0821: assertEquals("FileOps.java", pim.getCurrentItem());
0822: assertEquals("F", pim.getMask());
0823: assertEquals(2, pim.getMatchingItems().size());
0824:
0825: pim.extendMask("ILEoPS");
0826: assertEquals("FileOps.java", pim.getCurrentItem());
0827: assertEquals("FILEoPS", pim.getMask());
0828: assertEquals(2, pim.getMatchingItems().size());
0829:
0830: pim.extendMask(".");
0831: assertEquals("FileOps.java", pim.getCurrentItem());
0832: assertEquals("FILEoPS.", pim.getMask());
0833: assertEquals(1, pim.getMatchingItems().size());
0834:
0835: pim.extendMask("x");
0836: assertEquals("AboutDialog.java", pim.getCurrentItem());
0837: assertEquals("FILEoPS.x", pim.getMask());
0838: assertEquals(0, pim.getMatchingItems().size());
0839:
0840: pim.extendMask("y");
0841: assertEquals("AboutDialog.java", pim.getCurrentItem());
0842: assertEquals("FILEoPS.xy", pim.getMask());
0843: assertEquals(0, pim.getMatchingItems().size());
0844:
0845: pim.setMask("FiLe JAVa");
0846: assertEquals("FileOps.java", pim.getCurrentItem());
0847: assertEquals("FiLe JAVa", pim.getMask());
0848: assertEquals(2, pim.getMatchingItems().size());
0849: }
0850:
0851: public void testFragmentIgnoreCaseNarrowingWithExtend() {
0852: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0853: true,
0854: new PredictiveInputModel.FragmentStrategy<String>(),
0855: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0856: "Utilities.java");
0857: pim.setMask("F");
0858: assertEquals("FileOps.java", pim.getCurrentItem());
0859: assertEquals("F", pim.getMask());
0860: assertEquals(2, pim.getMatchingItems().size());
0861:
0862: pim.extendMask(" IlEOpS");
0863: assertEquals("FileOps.java", pim.getCurrentItem());
0864: assertEquals("F IlEOpS", pim.getMask());
0865: assertEquals(2, pim.getMatchingItems().size());
0866:
0867: pim.extendMask(".");
0868: assertEquals("FileOps.java", pim.getCurrentItem());
0869: assertEquals("F IlEOpS.", pim.getMask());
0870: assertEquals(1, pim.getMatchingItems().size());
0871:
0872: pim.extendMask("x");
0873: assertEquals("AboutDialog.java", pim.getCurrentItem());
0874: assertEquals("F IlEOpS.x", pim.getMask());
0875: assertEquals(0, pim.getMatchingItems().size());
0876:
0877: pim.extendMask("y");
0878: assertEquals("AboutDialog.java", pim.getCurrentItem());
0879: assertEquals("F IlEOpS.xy", pim.getMask());
0880: assertEquals(0, pim.getMatchingItems().size());
0881: }
0882:
0883: public void testFragmentIgnoreCaseNarrowingWithSet() {
0884: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0885: true,
0886: new PredictiveInputModel.FragmentStrategy<String>(),
0887: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0888: "Utilities.java");
0889: pim.setMask("F");
0890: assertEquals("FileOps.java", pim.getCurrentItem());
0891: assertEquals("F", pim.getMask());
0892: assertEquals(2, pim.getMatchingItems().size());
0893:
0894: pim.setMask("F IlEOpS");
0895: assertEquals("FileOps.java", pim.getCurrentItem());
0896: assertEquals("F IlEOpS", pim.getMask());
0897: assertEquals(2, pim.getMatchingItems().size());
0898:
0899: pim.setMask(pim.getMask() + ".");
0900: assertEquals("FileOps.java", pim.getCurrentItem());
0901: assertEquals("F IlEOpS.", pim.getMask());
0902: assertEquals(1, pim.getMatchingItems().size());
0903:
0904: pim.setMask(pim.getMask() + "x");
0905: assertEquals("AboutDialog.java", pim.getCurrentItem());
0906: assertEquals("F IlEOpS.x", pim.getMask());
0907: assertEquals(0, pim.getMatchingItems().size());
0908:
0909: pim.setMask(pim.getMask() + "y");
0910: assertEquals("AboutDialog.java", pim.getCurrentItem());
0911: assertEquals("F IlEOpS.xy", pim.getMask());
0912: assertEquals(0, pim.getMatchingItems().size());
0913: }
0914:
0915: public void testFragmentIgnoreCaseWidening() {
0916: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0917: true,
0918: new PredictiveInputModel.FragmentStrategy<String>(),
0919: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0920: "Utilities.java");
0921: pim.setMask("FiLE oPS.");
0922: assertEquals("FileOps.java", pim.getCurrentItem());
0923: assertEquals("FiLE oPS.", pim.getMask());
0924: assertEquals(1, pim.getMatchingItems().size());
0925:
0926: pim.setMask("FiLE oPS");
0927: assertEquals("FileOps.java", pim.getCurrentItem());
0928: assertEquals("FiLE oPS", pim.getMask());
0929: assertEquals(2, pim.getMatchingItems().size());
0930:
0931: pim.setMask("f I");
0932: assertEquals("FileOps.java", pim.getCurrentItem());
0933: assertEquals("f I", pim.getMask());
0934: assertEquals(2, pim.getMatchingItems().size());
0935:
0936: pim.setMask("");
0937: assertEquals("FileOps.java", pim.getCurrentItem());
0938: assertEquals("", pim.getMask());
0939: assertEquals(4, pim.getMatchingItems().size());
0940: }
0941:
0942: public void testFragmentIgnoreCaseSetMatching() {
0943: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0944: true,
0945: new PredictiveInputModel.FragmentStrategy<String>(),
0946: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0947: "Utilities.java");
0948: pim.setMask("F");
0949: assertEquals("FileOps.java", pim.getCurrentItem());
0950: assertEquals("F", pim.getMask());
0951: assertEquals(2, pim.getMatchingItems().size());
0952:
0953: pim.setCurrentItem(pim.getCurrentItem().toUpperCase());
0954: assertEquals("FileOps.java", pim.getCurrentItem());
0955: assertEquals("F", pim.getMask());
0956: assertEquals(2, pim.getMatchingItems().size());
0957:
0958: List<String> m = pim.getMatchingItems();
0959: int i = m.indexOf(pim.getCurrentItem());
0960: pim.setCurrentItem(m.get(i + 1).toUpperCase());
0961: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0962: assertEquals("F", pim.getMask());
0963: assertEquals(2, pim.getMatchingItems().size());
0964: }
0965:
0966: public void testFragmentIgnoreCaseSetNotMatching() {
0967: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0968: true,
0969: new PredictiveInputModel.FragmentStrategy<String>(),
0970: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0971: "Utilities.java");
0972: pim.setMask("F");
0973: assertEquals("FileOps.java", pim.getCurrentItem());
0974: assertEquals("F", pim.getMask());
0975: assertEquals(2, pim.getMatchingItems().size());
0976:
0977: pim.setCurrentItem("AboutDialog.java");
0978: assertEquals("FileOps.java", pim.getCurrentItem());
0979: assertEquals("F", pim.getMask());
0980: assertEquals(2, pim.getMatchingItems().size());
0981:
0982: pim.setCurrentItem("Utilities.java");
0983: assertEquals("FileOpsTest.java", pim.getCurrentItem());
0984: assertEquals("F", pim.getMask());
0985: assertEquals(2, pim.getMatchingItems().size());
0986: }
0987:
0988: public void testFragmentIgnoreCaseSetNotInList() {
0989: PredictiveInputModel<String> pim = new PredictiveInputModel<String>(
0990: true,
0991: new PredictiveInputModel.FragmentStrategy<String>(),
0992: "AboutDialog.java", "FileOps.java", "FileOpsTest.java",
0993: "Utilities.java");
0994: pim.setMask("F");
0995: assertEquals("FileOps.java", pim.getCurrentItem());
0996: assertEquals("F", pim.getMask());
0997: assertEquals(2, pim.getMatchingItems().size());
0998:
0999: pim.setCurrentItem("BBBB");
1000: assertEquals("FileOps.java", pim.getCurrentItem());
1001: assertEquals("F", pim.getMask());
1002: assertEquals(2, pim.getMatchingItems().size());
1003:
1004: pim.setCurrentItem("FileOps.XXX");
1005: assertEquals("FileOps.java", pim.getCurrentItem());
1006: assertEquals("F", pim.getMask());
1007: assertEquals(2, pim.getMatchingItems().size());
1008:
1009: pim.setCurrentItem("XXX");
1010: assertEquals("FileOpsTest.java", pim.getCurrentItem());
1011: assertEquals("F", pim.getMask());
1012: assertEquals(2, pim.getMatchingItems().size());
1013: }
1014: }
|