Skip to content

Commit 3b674ea

Browse files
committed
Only set the 'ds.service.changecount.timeout' system property within the Felix6778Test
1 parent e3453e2 commit 3b674ea

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ public abstract class ComponentTestBase
142142

143143
protected static final String PROP_NAME_FACTORY = ComponentTestBase.PROP_NAME + ".factory";
144144

145-
protected static long DS_SERVICE_CHANGECOUNT_TIMEOUT = ScrConfiguration.DEFAULT_SERVICE_CHANGECOUNT_TIMEOUT_MILLISECONDS;
146-
147145
static
148146
{
149147
theConfig = new Hashtable<>();
@@ -202,8 +200,7 @@ public static Option[] configuration()
202200
systemProperty( "ds.loglevel" ).value( DS_LOGLEVEL ),
203201
systemProperty( "ds.cache.metadata" ).value( Boolean.toString(CACHE_META_DATA) ),
204202
systemProperty( "logback.configurationFile" ).value( "src/test/resources/logback-test.xml" ),
205-
systemProperty( EXAM_FAIL_ON_UNRESOLVED_KEY ).value( "true" ),
206-
systemProperty( "ds.service.changecount.timeout" ).value( Long.toString(DS_SERVICE_CHANGECOUNT_TIMEOUT) )
203+
systemProperty( EXAM_FAIL_ON_UNRESOLVED_KEY ).value( "true" )
207204

208205
);
209206
final Option vmOption = ( paxRunnerVmOption != null )? CoreOptions.vmOption( paxRunnerVmOption ): null;

scr/src/test/java/org/apache/felix/scr/integration/Felix6778Test.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
import org.junit.Before;
2323
import org.junit.Test;
2424
import org.junit.runner.RunWith;
25+
import org.ops4j.pax.exam.Configuration;
26+
import org.ops4j.pax.exam.Option;
27+
import org.ops4j.pax.exam.OptionUtils;
2528
import org.ops4j.pax.exam.junit.PaxExam;
2629
import org.osgi.framework.BundleException;
2730
import org.osgi.framework.Constants;
@@ -35,15 +38,17 @@
3538

3639
import static org.junit.Assert.assertEquals;
3740
import static org.junit.Assert.assertSame;
41+
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
3842

3943
@RunWith(PaxExam.class)
4044
public class Felix6778Test extends ComponentTestBase implements ServiceListener
4145
{
4246

47+
private static final long DS_SERVICE_CHANGECOUNT_TIMEOUT = 1000;
48+
4349
static
4450
{
4551
descriptorFile = "/integration_test_simple_components.xml";
46-
DS_SERVICE_CHANGECOUNT_TIMEOUT = 1000;
4752
}
4853

4954
class RecordedScrChangeCount
@@ -58,6 +63,13 @@ class RecordedScrChangeCount
5863
}
5964
}
6065

66+
@Configuration
67+
public static Option[] configuration()
68+
{
69+
return OptionUtils.combine(ComponentTestBase.configuration(),
70+
systemProperty( "ds.service.changecount.timeout" ).value( Long.toString(DS_SERVICE_CHANGECOUNT_TIMEOUT) ));
71+
}
72+
6173
private List<RecordedScrChangeCount> recordedEvents = new CopyOnWriteArrayList<>();
6274

6375
@Before

0 commit comments

Comments
 (0)