+++ /dev/null
-/* Copyright (c) 2009 Peter Troshin\r
- * \r
- * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 \r
- * \r
- * This library is free software; you can redistribute it and/or modify it under the terms of the\r
- * Apache License version 2 as published by the Apache Software Foundation\r
- * \r
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
- * License for more details.\r
- * \r
- * A copy of the license is in apache_license.txt. It is also available here:\r
- * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
- * \r
- * Any republication or derived work distributed in source code form\r
- * must include this copyright and license notice.\r
- */\r
-\r
-package compbio.engine.cluster.drmaa;\r
-\r
-import static org.testng.AssertJUnit.assertEquals;\r
-import static org.testng.AssertJUnit.assertNotNull;\r
-import static org.testng.AssertJUnit.fail;\r
-\r
-import java.text.ParseException;\r
-\r
-import org.testng.annotations.Test;\r
-\r
-import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
-\r
-public class UtilTester {\r
-\r
- @Test\r
- public void testParser() {\r
- try {\r
- Number n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("11.0000");\r
- assertNotNull(n);\r
- int t = n.intValue();\r
- assertEquals(11, t);\r
- n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("11.2300");\r
- assertNotNull(n);\r
- t = n.intValue();\r
- assertEquals(11, t);\r
- float f = n.floatValue();\r
- assertEquals(11.23f, f);\r
- n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("0.0310");\r
- assertNotNull(n);\r
- f = n.floatValue();\r
- assertEquals(0.031f, f);\r
- } catch (ParseException e) {\r
- e.printStackTrace();\r
- fail("Parsing failed: " + e.getMessage());\r
- }\r
-\r
- }\r
-}\r