From d65da491daf3431415623aab2aa0e4d09e9ffbea Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Mon, 10 Apr 2017 11:01:15 +0300 Subject: [PATCH] All test fix --- .../src/main/java/inr/numass/Main.java | 5 +- .../src/test/java/inr/numass/MainTest.java | 60 ------------------- .../src/test/java/inr/numass/NumassTest.java | 3 - 3 files changed, 4 insertions(+), 64 deletions(-) delete mode 100644 numass-main/src/test/java/inr/numass/MainTest.java 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); } }