Skip to content

Commit

Permalink
Improved: Turn ‘MiscTests’ into a unit test class
Browse files Browse the repository at this point in the history
(OFBIZ-11067)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859982 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed May 25, 2019
1 parent 6580e07 commit d0a1dde
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*******************************************************************************
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Expand All @@ -15,8 +15,12 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.base.conversion.test;
*/
package org.apache.ofbiz.base.conversion;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import java.math.BigDecimal;
import java.net.URL;
Expand All @@ -28,21 +32,11 @@
import org.apache.ofbiz.base.conversion.Converter;
import org.apache.ofbiz.base.conversion.ConverterLoader;
import org.apache.ofbiz.base.conversion.Converters;
import org.apache.ofbiz.base.lang.SourceMonitored;
import org.apache.ofbiz.base.test.GenericTestCaseBase;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.base.util.UtilMisc;
import org.junit.Test;

@SourceMonitored
public class MiscTests extends GenericTestCaseBase {

public MiscTests(String name) {
super(name);
}

public void testStaticHelperClass() throws Exception {
assertStaticHelperClass(Converters.class);
}
public class MiscTests {

public static class ConverterLoaderImpl implements ConverterLoader {
@Override
Expand All @@ -51,6 +45,7 @@ public void loadConverters() {
}
}

@Test
public void testLoadContainedConvertersIgnoresException() {
Converters.loadContainedConverters(MiscTests.class);
}
Expand All @@ -70,6 +65,7 @@ public static <S> void assertPassThru(Object wanted, Class<S> sourceClass, Class
assertEquals("pass thru target class", targetClass, converter.getTargetClass());
}

@Test
public void testPassthru() throws Exception {
String string = "ofbiz";
BigDecimal bigDecimal = new BigDecimal("1.234");
Expand Down
1 change: 0 additions & 1 deletion framework/base/testdef/basetests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<junit-test-suite class-name="org.apache.ofbiz.base.util.collections.test.FlexibleMapAccessorTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.util.test.TimeDurationTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.util.cache.test.UtilCacheTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.conversion.test.MiscTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.conversion.test.TestBooleanConverters"/>
<junit-test-suite class-name="org.apache.ofbiz.base.conversion.test.TestJSONConverters"/>
<!--junit-test-suite class-name="org.apache.ofbiz.base.util.test.UtilIOTests"/-->
Expand Down

0 comments on commit d0a1dde

Please sign in to comment.