|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ /* * Main.java * * Created on 04 December 2003, 18:23 */ package org.netbeans.jmi.javamodel.regenerator; import java.beans.PropertyVetoException; import java.io.File; import java.io.IOException; import junit.textui.TestRunner; import org.netbeans.jmi.javamodel.codegen.Utility; import org.netbeans.jmi.javamodel.codegen.Utility; import org.netbeans.junit.NbTestCase; import org.netbeans.junit.NbTestSuite; import org.openide.filesystems.FileSystem; import org.openide.filesystems.LocalFileSystem; /** * * @author Jan Becicka */ public class Main extends NbTestCase { /** Need to be defined because of JUnit */ public Main(String name) { super(name); } /** * @param args the command line arguments */ public static void main(String[] args) { TestRunner.run(suite()); } public static NbTestSuite suite() { NbTestSuite suite = new NbTestSuite(); suite.addTest(new Main("testRegenerateFileSystem")); return suite; } /** * test can be customized using system properties: * org.netbeans.javacore.fsname: name of filesystem to duplicate * e.g. -Dorg.netbeans.javacore.fsname=/tmp/myfs * * org.netbeans.javacore.useJavadoc: true = copy javadoc using model elements * false = copy javadoc textually * e.g. -Dorg.netbeans.javacore.useJavadoc=false * * org.netbeans.javacore.useBody: true = copy bodies using model elements * false = copy bodies textually * e.g. -Dorg.netbeans.javacore.useBody=true * * org.netbeans.javacore.useInitialValue true = copy initial values using model elements * false = copy initial values textually * e.g. -Dorg.netbeans.javacore.useInitialValue=true */ public void testRegenerateFileSystem () { String fsName = System.getProperty("org.netbeans.javacore.fsname"); FileSystem fs = null; if (fsName == null) { fs = Utility.findFileSystem("sampledir"); } else { try { fs = new LocalFileSystem(); ((LocalFileSystem) fs).setRootDirectory(new File(fsName)); } catch (PropertyVetoException e) { fail(e.toString()); } catch (IOException e) { fail(e.toString()); } } Regenerator regenerator = new Regenerator(); regenerator.setSourceFileSystem(fs); regenerator.setTargetFileSystem(Utility.findFileSystem("testsrc")); regenerator.regenerateAll(); } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.