Skip to content

Commit

Permalink
ttools: inform stilts of new plot2 tasks
Browse files Browse the repository at this point in the history
Add entries to the Stilts task factory for the new plot2 tasks.
Note these may change name or sequence in the task list at some
point in the future.

Additionally make some logging tweaks to some of the build machinery,
since with the inclusion of these new task the build process invokes
some code which makes unwanted INFO-level reports through the logging
system at build and test time.
  • Loading branch information
mbtaylor authored and mmpcn committed Nov 27, 2014
1 parent db1bd65 commit 4abaafa
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ttools/src/main/uk/ac/starlink/ttools/Stilts.java
Expand Up @@ -120,6 +120,13 @@ private static void init() {
taskFactory_.register( "votcopy", taskPkg + "VotCopy" );
taskFactory_.register( "votlint", taskPkg + "VotLint" );

String plot2Pkg = "uk.ac.starlink.ttools.plot2.task.";
taskFactory_.register( "plot2plane", plot2Pkg + "PlanePlot2Task" );
taskFactory_.register( "plot2sky", plot2Pkg + "SkyPlot2Task" );
taskFactory_.register( "plot2cube", plot2Pkg + "CubePlot2Task" );
taskFactory_.register( "plot2sphere", plot2Pkg + "SpherePlot2Task" );
taskFactory_.register( "plot2time", plot2Pkg + "TimePlot2Task" );

modeFactory_ =
new ObjectFactory<ProcessingMode>( ProcessingMode.class );
String modePkg = "uk.ac.starlink.ttools.mode.";
Expand Down
4 changes: 4 additions & 0 deletions ttools/src/main/uk/ac/starlink/ttools/build/JyStilts.java
Expand Up @@ -13,6 +13,8 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.xml.sax.SAXException;
import uk.ac.starlink.table.ColumnInfo;
import uk.ac.starlink.table.MultiStarTableWriter;
Expand Down Expand Up @@ -1358,6 +1360,8 @@ public void writeModule( Writer writer )
*/
public static void main( String[] args )
throws IOException, LoadException, SAXException {
Logger.getLogger( "uk.ac.starlink.ttools.plot2" )
.setLevel( Level.WARNING );
new JyStilts( new Stilts() )
.writeModule( new OutputStreamWriter(
new BufferedOutputStream( System.out ) ) );
Expand Down
@@ -1,5 +1,7 @@
package uk.ac.starlink.ttools.build;

import java.util.logging.Logger;
import java.util.logging.Level;
import uk.ac.starlink.task.Task;
import uk.ac.starlink.ttools.Stilts;
import uk.ac.starlink.util.LoadException;
Expand All @@ -13,6 +15,7 @@
*/
public class PurposeWriter {
public static void main( String[] args ) throws LoadException {
Logger.getLogger( "uk.ac.starlink.ttools" ).setLevel( Level.WARNING );
ObjectFactory<Task> taskFactory = Stilts.getTaskFactory();
String[] taskNames = taskFactory.getNickNames();
for ( int i = 0; i < taskNames.length; i++ ) {
Expand Down
3 changes: 3 additions & 0 deletions ttools/src/main/uk/ac/starlink/ttools/build/UsageWriter.java
Expand Up @@ -8,6 +8,8 @@
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import uk.ac.starlink.task.Parameter;
import uk.ac.starlink.task.Task;
import uk.ac.starlink.ttools.Stilts;
Expand Down Expand Up @@ -233,6 +235,7 @@ private void outln() throws IOException {
* surrounding XML boilerplate.
*/
public static void main( String[] args ) throws IOException, LoadException {
Logger.getLogger( "uk.ac.starlink.ttools" ).setLevel( Level.WARNING );
if ( args.length == 0 ) {
String[] taskNames = Stilts.getTaskFactory().getNickNames();
File dir = new File( "." );
Expand Down
4 changes: 4 additions & 0 deletions ttools/src/testcases/uk/ac/starlink/ttools/FactoryTest.java
@@ -1,5 +1,7 @@
package uk.ac.starlink.ttools;

import java.util.logging.Level;
import java.util.logging.Logger;
import junit.framework.TestCase;
import uk.ac.starlink.task.Task;
import uk.ac.starlink.ttools.filter.BasicFilter;
Expand All @@ -12,6 +14,8 @@ public class FactoryTest extends TestCase {

public FactoryTest( String name ) {
super( name );
Logger.getLogger( "uk.ac.starlink.ttools" )
.setLevel( Level.WARNING );
}

public void testFilterFactory() throws Exception {
Expand Down
3 changes: 3 additions & 0 deletions ttools/src/testcases/uk/ac/starlink/ttools/cea/CeaTest.java
Expand Up @@ -6,6 +6,8 @@
import java.io.IOException;
import java.io.PrintStream;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.XMLConstants;
import javax.xml.transform.sax.SAXSource;
import javax.xml.validation.Schema;
Expand All @@ -31,6 +33,7 @@ public class CeaTest extends TestCase {

public CeaTest( String name ) {
super( name );
Logger.getLogger( "uk.ac.starlink.ttools" ).setLevel( Level.WARNING );
}

public void setUp() throws LoadException {
Expand Down
Expand Up @@ -6,6 +6,8 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import junit.framework.TestCase;
import org.xml.sax.SAXException;
import uk.ac.starlink.task.Parameter;
Expand Down Expand Up @@ -39,11 +41,13 @@ public class ParameterTest extends TestCase {
"legend",
"xdataN", "ydataN", "zdataN", "auxdataN",
"subsetNS", "colourNS", "shapeNS", "transparencyNS",
"layerN",
"end",
} ) );

public ParameterTest( String name ) {
super( name );
Logger.getLogger( "uk.ac.starlink.ttools" ).setLevel( Level.WARNING );
}

public void testParams() throws LoadException, SAXException {
Expand Down

0 comments on commit 4abaafa

Please sign in to comment.