001: package org.netbeans.modules.visualweb.jsfsupport.converter;
002:
003: import com.sun.rave.faces.converter.CalendarConverter;
004: import org.netbeans.junit.NbTestCase;
005:
006: /*
007: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
008: *
009: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
010: *
011: * The contents of this file are subject to the terms of either the GNU
012: * General Public License Version 2 only ("GPL") or the Common
013: * Development and Distribution License("CDDL") (collectively, the
014: * "License"). You may not use this file except in compliance with the
015: * License. You can obtain a copy of the License at
016: * http://www.netbeans.org/cddl-gplv2.html
017: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
018: * specific language governing permissions and limitations under the
019: * License. When distributing the software, include this License Header
020: * Notice in each file and include the License file at
021: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
022: * particular file as subject to the "Classpath" exception as provided
023: * by Sun in the GPL Version 2 section of the License file that
024: * accompanied this code. If applicable, add the following below the
025: * License Header, with the fields enclosed by brackets [] replaced by
026: * your own identifying information:
027: * "Portions Copyrighted [year] [name of copyright owner]"
028: *
029: * If you wish your version of this file to be governed by only the CDDL
030: * or only the GPL Version 2, indicate your decision by adding
031: * "[Contributor] elects to include this software in this distribution
032: * under the [CDDL or GPL Version 2] license." If you do not indicate a
033: * single choice of license, a recipient has the option to distribute
034: * your version of this file under either the CDDL, the GPL Version 2 or
035: * to extend the choice of license to its licensees as provided above.
036: * However, if you add GPL Version 2 code and therefore, elected the GPL
037: * Version 2 license, then the option applies only if the new code is
038: * made subject to such option by the copyright holder.
039: *
040: * Contributor(s):
041: *
042: * Portions Copyrighted 2007 Sun Microsystems, Inc.
043: */
044:
045: import org.netbeans.junit.NbTestCase;
046: import org.netbeans.junit.NbTestSuite;
047:
048: /**
049: * A Test based on NbTestCase. It is a NetBeans extension to JUnit TestCase
050: * which among othres allows to compare files via assertFile methods, create
051: * working directories for testcases, write to log files, compare log files
052: * against reference (golden) files, etc.
053: *
054: * More details here http://xtest.netbeans.org/NbJUnit/NbJUnit-overview.html.
055: *
056: * @author dongmeic
057: */
058: public class CalendarConverterTest extends NbTestCase {
059:
060: private CalendarConverter calendarConverter1;
061:
062: /** Default constructor.
063: * @param testName name of particular test case
064: */
065: public CalendarConverterTest(String testName) {
066: super (testName);
067: }
068:
069: /** Creates suite from particular test cases. You can define order of testcases here. */
070: public static NbTestSuite suite() {
071: NbTestSuite suite = new NbTestSuite();
072: suite.addTest(new CalendarConverterTest("test1"));
073: suite.addTest(new CalendarConverterTest("test2"));
074: return suite;
075: }
076:
077: /* Method allowing test execution directly from the IDE. */
078: public static void main(java.lang.String[] args) {
079: // run whole suite
080: junit.textui.TestRunner.run(suite());
081: // run only selected test case
082: //junit.textui.TestRunner.run(new FacesConatainerTest("test1"));
083: }
084:
085: /** Called before every test case. */
086: public void setUp() {
087: System.out.println("######## " + getName() + " #######");
088: calendarConverter1 = new CalendarConverter();
089: }
090:
091: /** Called after every test case. */
092: public void tearDown() {
093: calendarConverter1 = null;
094: }
095:
096: // Add test methods here, they have to start with 'test'.
097: /** Test case 1. */
098: public void test1() {
099: }
100:
101: /** Test case 2. */
102: public void test2() {
103: }
104: }
|