CODEFETCH™
            Examples
Cache of PJUI/com/marinilli/b1/c8/cakes/test/delivery/content/DeliveryPanelAcceptTest.java from
http://www.marinilli.com/books/b1/PJUI.zip
Source code below from:
Professional Java User Interfaces
By Mauro Marinilli
Published 26 May, 2006
Average rating

      Powells     Alibris


/*
 * Created on 18-mag-2005
 *
 */
package com.marinilli.b1.c8.cakes.test.delivery.content;

import javax.swing.JFrame;

import com.marinilli.b1.c8.cakes.delivery.content.DeliveryPanel0;

import junit.extensions.jfcunit.JFCTestHelper;
import junit.extensions.jfcunit.TestHelper;
import junit.extensions.xml.XMLTestSuite;
import junit.extensions.xml.XMLUtil;
import junit.framework.Test;
import junit.swingui.TestRunner;

/**
 * @author Mauro
 *
 */
public class DeliveryPanelAcceptTest extends XMLTestSuite {
    private DeliveryPanel0 dp;
    
        public static final String DOCUMENT_FACTORY =
             "javax.xml.parsers.DocumentBuilderFactory";

        public DeliveryPanelAcceptTest() throws Exception {
            super("DeliveryPanelAcceptTest.xml",
//                XMLUtil.readFileFromClassContext(
//                      DeliveryPanelAcceptTest.class, "testSwingSet.xml"));
                  XMLUtil.readFileFromClasspath("testSwingSet.xml"));
//          DeliveryPanelAcceptTest.main(new String[] {});
        }

        public static Test suite() throws Exception {
            return new DeliveryPanelAcceptTest();
        }

        public static void main(String[] args) throws Exception {
            DeliveryPanel0 dp = new DeliveryPanel0();
            JFrame f = new JFrame();
            f.getContentPane().add(dp);
            f.pack();
            f.setVisible(true);
            

            if (System.getProperty(DOCUMENT_FACTORY) == null) {
                System.setProperty(DOCUMENT_FACTORY,
                "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
            }
            Test t = (Test) DeliveryPanelAcceptTest.suite();
            TestRunner.run(t.getClass());
//          junit.swingui.TestRunner.run(DeliveryPanelAcceptTest.class);
        }

//      protected void setUp( ) throws Exception {
//          super.setUp();
//          dp = new DeliveryPanel0();
//          JFrame f = new JFrame();
//          f.getContentPane().add(dp);
//          f.pack();
//          f.setVisible(true);
//      }
//
//      protected void tearDown( ) throws Exception {
//          dp = null;
//          TestHelper.cleanUp( this );
//          super.tearDown( );
//      }
}