Author: mturk Date: Thu Mar 24 10:44:39 2011 New Revision: 1084894 URL: http://svn.apache.org/viewvc?rev=1084894&view=rev Log: Add bare testng case
Added: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java (with props) Modified: commons/sandbox/runtime/trunk/build.xml Modified: commons/sandbox/runtime/trunk/build.xml URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/build.xml?rev=1084894&r1=1084893&r2=1084894&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/build.xml (original) +++ commons/sandbox/runtime/trunk/build.xml Thu Mar 24 10:44:39 2011 @@ -367,7 +367,8 @@ The Apache Software Foundation (http://w <!-- Junit tests --> <!-- =================================================================== --> <target name="test" depends="tests"> - <testng outputdir="${build.dir}/out"> + <testng outputdir="${build.dir}/out/report" + workingdir="${build.dir}/out"> <classpath refid="test.classpath"/> <classfileset dir="${build.dest}/test" includes="**/*.class"/> <env key="PATH" path="${runtime.library.path}${path.separator}${java.library.path}"/> Added: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java?rev=1084894&view=auto ============================================================================== --- commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java (added) +++ commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java Thu Mar 24 10:44:39 2011 @@ -0,0 +1,51 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.runtime; + +import org.testng.annotations.*; +import org.testng.Assert; +import java.io.IOException; +import java.io.File; + +import org.apache.commons.runtime.util.Utils; + +public class TestUtils +{ + + @BeforeClass + public void setUp() + { + // code that will be invoked when this test is instantiated + } + + @Test(groups = { "utils" }) + public void getTempPathTest() + { + Assert.assertNotNull(Utils.getTempPath()); + } + + @Test(groups = { "utils" }) + public void createTempDirectoryTest() + throws IOException + { + File tmp = Utils.createTempDirectory("t1"); + Assert.assertNotNull(tmp); + System.out.println("Created directory " + tmp.getPath()); + Assert.assertTrue(Utils.deleteDirectory(tmp)); + } + +} Propchange: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestUtils.java ------------------------------------------------------------------------------ svn:eol-style = native