|
What this is
This file is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn
Java by Example" TM.
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-2004 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.spi.project.support.ant;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
import org.openide.filesystems.FileUtil;
import org.openide.util.Utilities;
/**
* Test functionality of PropertyUtils.
* @author Jesse Glick
*/
public class PropertyUtilsTest extends NbTestCase {
public PropertyUtilsTest(String name) {
super(name);
}
static {
PropertyUtilsTest.class.getClassLoader().setDefaultAssertionStatus(true);
System.setProperty("netbeans.user", System.getProperty("java.io.tmpdir"));
assertEquals("correct build.properties location",
FileUtil.normalizeFile(new File(System.getProperty("java.io.tmpdir"), "build.properties")),
PropertyUtils.USER_BUILD_PROPERTIES);
}
protected void setUp() throws Exception {
super.setUp();
if (PropertyUtils.USER_BUILD_PROPERTIES.exists() && !PropertyUtils.USER_BUILD_PROPERTIES.delete()) {
throw new IOException("Deleting: " + PropertyUtils.USER_BUILD_PROPERTIES);
}
}
private static PropertyEvaluator evaluator(Map/**/ predefs, List/*
|