]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/TestDataUtils.java
Move SLC Core
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / test / TestDataUtils.java
diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/TestDataUtils.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/TestDataUtils.java
deleted file mode 100644 (file)
index b32da38..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *         http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.test;\r
-\r
-import org.argeo.slc.UnsupportedException;\r
-import org.argeo.slc.test.TestData;\r
-import org.argeo.slc.test.TestDataProvider;\r
-\r
-/** Utilities for dealing with test datas. */\r
-public class TestDataUtils {\r
-       /** Extracts the test data from the given provider. */\r
-       public static <T extends TestData> T getFromProvider(Object obj,\r
-                       Class<T> clss, String key) {\r
-               if (obj instanceof TestDataProvider) {\r
-                       TestDataProvider testDataProvider = (TestDataProvider) obj;\r
-                       return testDataProvider.getTestData(clss, key);\r
-               } else {\r
-                       throw new UnsupportedException("test data provider", obj);\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Extracts the test data from the given provider using <code>null</code>\r
-        * as key.\r
-        */\r
-       public static <T extends TestData> T getFromProvider(Object obj,\r
-                       Class<T> clss) {\r
-               return getFromProvider(obj, clss, null);\r
-       }\r
-\r
-       /**\r
-        * Returns it self after making the proper checks. Used for test data being\r
-        * their own data providers.\r
-        */\r
-       @SuppressWarnings("unchecked")\r
-       public static <T extends TestData> T getItSelf(Class<T> clss,\r
-                       TestData testDataObject) {\r
-               if (clss.isAssignableFrom(testDataObject.getClass())) {\r
-                       return (T) testDataObject;\r
-               } else {\r
-                       throw new UnsupportedException("test data", testDataObject);\r
-               }\r
-\r
-       }\r
-\r
-       /** Makes sure this is an utility class. */\r
-       private TestDataUtils() {\r
-\r
-       }\r
-}\r