diff --git a/numass-main/src/main/java/inr/numass/Main.java b/numass-main/src/main/java/inr/numass/Main.java index 5d4dcd0f..08b4b40f 100644 --- a/numass-main/src/main/java/inr/numass/Main.java +++ b/numass-main/src/main/java/inr/numass/Main.java @@ -17,6 +17,7 @@ package inr.numass; import hep.dataforge.actions.ActionUtils; import hep.dataforge.context.Context; +import hep.dataforge.context.Global; import hep.dataforge.data.FileDataFactory; import hep.dataforge.io.IOManager; import hep.dataforge.io.MetaFileReader; @@ -48,8 +49,10 @@ public class Main { run(context, args); } - @SuppressWarnings("deprecation") public static void run(Context context, String[] args) throws Exception { + if(context == null){ + context = Global.instance(); + } Logger logger = LoggerFactory.getLogger("numass-main"); Options options = prepareOptions(); diff --git a/numass-main/src/test/java/inr/numass/MainTest.java b/numass-main/src/test/java/inr/numass/MainTest.java deleted file mode 100644 index a21b2e90..00000000 --- a/numass-main/src/test/java/inr/numass/MainTest.java +++ /dev/null @@ -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."); - } - -} diff --git a/numass-main/src/test/java/inr/numass/NumassTest.java b/numass-main/src/test/java/inr/numass/NumassTest.java index 7750926d..dde49118 100644 --- a/numass-main/src/test/java/inr/numass/NumassTest.java +++ b/numass-main/src/test/java/inr/numass/NumassTest.java @@ -7,7 +7,6 @@ package inr.numass; import hep.dataforge.context.Context; import hep.dataforge.maths.MathPlugin; -import hep.dataforge.plots.PlotUtils; import org.junit.Test; /** @@ -24,10 +23,8 @@ public class NumassTest { */ @Test public void testBuildContext() { - Context context = Numass.buildContext(); MathPlugin.buildFrom(context); - PlotUtils.getPlotManager(context); } }