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.openide.filesystems;
043:
044: import junit.framework.*;
045: import org.netbeans.junit.*; //import org.openide.filesystems.hidden.*;
046:
047: import java.io.*;
048: import java.beans.PropertyVetoException;
049:
050: /**
051: *
052: * @author rmatous
053: * @version
054: */
055: public class MultiFileSystem1Test extends FileSystemFactoryHid {
056:
057: /** Creates new MultiFileSystemTest */
058: public MultiFileSystem1Test(Test test) {
059: super (test);
060: }
061:
062: public static void main(String args[]) throws Exception {
063: junit.textui.TestRunner.run(suite());
064: }
065:
066: public static Test suite() {
067: NbTestSuite suite = new NbTestSuite();
068: suite.addTestSuite(RepositoryTestHid.class);
069: suite.addTestSuite(FileSystemTestHid.class);
070: suite.addTestSuite(AttributesTestHidden.class);
071: suite.addTestSuite(FileObjectTestHid.class);
072: suite.addTestSuite(MultiFileObjectTestHid.class);
073: /*failing tests*/
074: suite.addTestSuite(URLMapperTestHidden.class);
075: suite.addTestSuite(URLMapperTestInternalHidden.class);
076: suite.addTestSuite(FileUtilTestHidden.class);
077:
078: return new MultiFileSystem1Test(suite);
079: }
080:
081: /**
082: *
083: * @param testName name of test
084: * @return array of FileSystems that should be tested in test named: "testName" */
085: protected FileSystem[] createFileSystem(String testName,
086: String[] resources) throws IOException {
087: FileSystem lfs = TestUtilHid.createLocalFileSystem("mfs1"
088: + testName, resources);
089: FileSystem xfs = TestUtilHid.createXMLFileSystem(testName,
090: new String[] {});
091: FileSystem mfs = new MultiFileSystem(new FileSystem[] { lfs,
092: xfs });
093: try {
094: mfs.setSystemName("mfs1test");
095: } catch (PropertyVetoException e) {
096: e.printStackTrace(); //To change body of catch statement use Options | File Templates.
097: }
098: return new FileSystem[] { mfs, lfs, xfs };
099: }
100:
101: protected void destroyFileSystem(String testName)
102: throws IOException {
103: }
104: }
|