All test fix

This commit is contained in:
Alexander Nozik 2017-04-10 11:01:15 +03:00
parent 4c5f946d27
commit d65da491da
3 changed files with 4 additions and 64 deletions

View File

@ -17,6 +17,7 @@ package inr.numass;
import hep.dataforge.actions.ActionUtils; import hep.dataforge.actions.ActionUtils;
import hep.dataforge.context.Context; import hep.dataforge.context.Context;
import hep.dataforge.context.Global;
import hep.dataforge.data.FileDataFactory; import hep.dataforge.data.FileDataFactory;
import hep.dataforge.io.IOManager; import hep.dataforge.io.IOManager;
import hep.dataforge.io.MetaFileReader; import hep.dataforge.io.MetaFileReader;
@ -48,8 +49,10 @@ public class Main {
run(context, args); run(context, args);
} }
@SuppressWarnings("deprecation")
public static void run(Context context, String[] args) throws Exception { public static void run(Context context, String[] args) throws Exception {
if(context == null){
context = Global.instance();
}
Logger logger = LoggerFactory.getLogger("numass-main"); Logger logger = LoggerFactory.getLogger("numass-main");
Options options = prepareOptions(); Options options = prepareOptions();

View File

@ -1,60 +0,0 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package inr.numass;
import hep.dataforge.context.Context;
import org.apache.commons.cli.CommandLine;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Alexander Nozik
*/
public class MainTest {
public MainTest() {
}
/**
* Test of main method, of class Main.
*/
@Test
public void testMain() throws Exception {
System.out.println("main");
String[] args = null;
Main.main(args);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of run method, of class Main.
*/
@Test
public void testRun() throws Exception {
System.out.println("run");
Context context = null;
String[] args = null;
Main.run(context, args);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of applyCLItoContext method, of class Main.
*/
@Test
public void testApplyCLItoContext() throws Exception {
System.out.println("applyCLItoContext");
CommandLine line = null;
Context context = null;
Main.applyCLItoContext(line, context);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}

View File

@ -7,7 +7,6 @@ package inr.numass;
import hep.dataforge.context.Context; import hep.dataforge.context.Context;
import hep.dataforge.maths.MathPlugin; import hep.dataforge.maths.MathPlugin;
import hep.dataforge.plots.PlotUtils;
import org.junit.Test; import org.junit.Test;
/** /**
@ -24,10 +23,8 @@ public class NumassTest {
*/ */
@Test @Test
public void testBuildContext() { public void testBuildContext() {
Context context = Numass.buildContext(); Context context = Numass.buildContext();
MathPlugin.buildFrom(context); MathPlugin.buildFrom(context);
PlotUtils.getPlotManager(context);
} }
} }