Wednesday, October 24, 2012
Cleaning Scans with Photoshop
If you want to scan more than one photo at a time, you can do it with some help from Photoshop's crop and straighten feature. You can automate this, and use a script to clean up multiple scans. However, this process sometimes creates a large number of "pieces" - more than you want. If you know you have only a single image, you can use Photoshop's trim instead to remove excess whitespace.
Saturday, August 4, 2012
Testing an ant Task
I had to test the SchemaCrawler ant task. Some research shows
- Include the ant testunit jar - in a Maven project you can add a dependency such as
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-testutil</artifactId>
<version>1.8.4</version>
<scope>test</scope>
</dependency>
- Extend your test case from org.apache.tools.ant.BuildFileTest
- Write a setup like
@Override
public void setUp()
throws Exception
{
configureProject(
"./build.xml" );
}
- Write your test cases, with the methods starting with "test" (as in the classic JUnit)
public void testAntTask()
throws Exception
{
final File testOutputFile = File.createTempFile("schemacrawler.",
".test");
setAntProjectProperty("outputfile", testOutputFile.getAbsolutePath());
executeTarget("ant_task_test");
System.out.println(getFullLog());
System.out.println(getOutput());
// some asserts here
}
- You can set properties with the utility method
private void setAntProjectProperty(final String name, final String value)
{
final Project antProject = getProject();
antProject.setProperty(name, value);
}
Subscribe to:
Posts (Atom)