001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Alexander T. Simbirtsev
019: * @version $Revision$
020: * Created on 03.03.2005
021:
022: */package javax.swing.text;
023:
024: import java.io.IOException;
025: import java.io.InputStream;
026: import java.io.OutputStream;
027: import java.io.Reader;
028: import java.io.Writer;
029: import javax.swing.Action;
030: import javax.swing.SwingTestCase;
031:
032: public class EditorKitTest extends SwingTestCase {
033: protected EditorKit kit = null;
034:
035: public static void main(final String[] args) {
036: junit.textui.TestRunner.run(EditorKitTest.class);
037: }
038:
039: /*
040: * @see TestCase#setUp()
041: */
042: @Override
043: protected void setUp() throws Exception {
044: super .setUp();
045: kit = new EditorKit() {
046: private static final long serialVersionUID = 1L;
047:
048: protected int i = 0;
049:
050: @Override
051: public Caret createCaret() {
052: return null;
053: }
054:
055: @Override
056: public Document createDefaultDocument() {
057: return null;
058: }
059:
060: @Override
061: public Action[] getActions() {
062: return null;
063: }
064:
065: @Override
066: public String getContentType() {
067: return i + "";
068: }
069:
070: @Override
071: public ViewFactory getViewFactory() {
072: i += 100;
073: return null;
074: }
075:
076: @Override
077: public void read(final InputStream in, final Document doc,
078: final int pos) throws IOException,
079: BadLocationException {
080: }
081:
082: @Override
083: public void read(final Reader in, final Document doc,
084: final int pos) throws IOException,
085: BadLocationException {
086: }
087:
088: @Override
089: public void write(final OutputStream out,
090: final Document doc, final int pos, final int len)
091: throws IOException, BadLocationException {
092: }
093:
094: @Override
095: public void write(final Writer out, final Document doc,
096: final int pos, final int len) throws IOException,
097: BadLocationException {
098: }
099: };
100: }
101:
102: /*
103: * Class under test for Object clone()
104: */
105: public void testClone() {
106: kit.getViewFactory();
107: assertTrue("cloned", kit.clone() != null);
108: assertEquals("cloned field", kit.getContentType(),
109: ((EditorKit) kit.clone()).getContentType());
110: }
111:
112: public void testDeinstall() {
113: }
114:
115: public void testInstall() {
116: }
117: }
|