Skip to content

Commit

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

Keep it disabled since it is failing for obscure reasons.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860015 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed May 25, 2019
1 parent 94c60ee commit aa87484
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 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,25 +15,31 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.base.util.test;
*/
package org.apache.ofbiz.base.util;

import static org.apache.ofbiz.base.test.GenericTestCaseBase.useAllMemory;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import java.util.HashSet;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.TimeUnit;

import org.apache.ofbiz.base.lang.SourceMonitored;
import org.apache.ofbiz.base.test.GenericTestCaseBase;
import org.apache.ofbiz.base.util.ReferenceCleaner;
import org.junit.Ignore;
import org.junit.Test;

@SourceMonitored
public class ReferenceCleanerTests extends GenericTestCaseBase {
public ReferenceCleanerTests(String name) {
super(name);
}
public class ReferenceCleanerTests {

// XXX: This test has been disabled since 2014 in revision
// 1648403, so it is not evident if it is still relevant. Maybe
// we should simply remove it.
@Ignore("Failing test")
@Test
public void testReferenceCleaner() throws Exception {
assertStaticHelperClass(ReferenceCleaner.class);
final SynchronousQueue<String> queue = new SynchronousQueue<>();
Object obj = new Object();
ReferenceCleaner.Soft<Object> soft = new ReferenceCleaner.Soft<Object>(obj) {
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 @@ -23,7 +23,6 @@
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
<test-group case-name="basetests">
<junit-test-suite class-name="org.apache.ofbiz.base.util.test.AssertTests"/>
<!--junit-test-suite class-name="org.apache.ofbiz.base.util.test.ReferenceCleanerTests"/-->
<junit-test-suite class-name="org.apache.ofbiz.base.util.test.UtilMiscTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.util.test.UtilObjectTests"/>
<junit-test-suite class-name="org.apache.ofbiz.base.util.test.UtilHttpTests"/>
Expand Down

0 comments on commit aa87484

Please sign in to comment.