Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .sdk_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"bigSegments": { "introduced": "1.0" },
"contexts": { "introduced": "4.0" },
"experimentation": { "introduced": "2.9" },
"fdv2": { "introduced": "5.13" },
"flagChanges": { "introduced": "1.0" },
"hooks": { "introduced": "5.8" },
"inlineContextCustomEvents": { "introduced": "5.7" },
Expand Down
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,11 @@ run-contract-tests:
@echo "Running SDK contract test v2..."
@curl $${GITHUB_TOKEN:+ -H "Authorization: Token $${GITHUB_TOKEN}"} \
-s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \
| VERSION=v2 PARAMS="-url http://localhost:8001 -host 10.0.2.2 -debug -stop-service-at-end -skip-from $(SUPPRESSION_FILE) $(TEST_HARNESS_PARAMS_V2)" sh

# Uncomment this, update v3 version, and replace existing run-contract-tests once sdk-test-harness releases a version that includes FDv2 client contract tests.
#
# run-contract-tests:
# @echo "Running SDK contract test v2..."
# @curl $${GITHUB_TOKEN:+ -H "Authorization: Token $${GITHUB_TOKEN}"} \
# -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \
# | VERSION=v2 PARAMS="-url http://localhost:8001 -host 10.0.2.2 -debug -skip-from $(SUPPRESSION_FILE) $(TEST_HARNESS_PARAMS_V2)" sh
# @echo "Running SDK contract test v3..."
# @curl $${GITHUB_TOKEN:+ -H "Authorization: Token $${GITHUB_TOKEN}"} \
# -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v3.0.0-alpha.4/downloader/run.sh \
# | VERSION=v3.0.0-alpha.4 PARAMS="-url http://localhost:8001 -host 10.0.2.2 -debug -stop-service-at-end -skip-from $(SUPPRESSION_FILE_FDV2) $(TEST_HARNESS_PARAMS_V3)" sh
| VERSION=v2 PARAMS="-url http://localhost:8001 -host 10.0.2.2 -debug -skip-from $(SUPPRESSION_FILE) $(TEST_HARNESS_PARAMS_V2)" sh
@echo "Running SDK contract test v3..."
@curl $${GITHUB_TOKEN:+ -H "Authorization: Token $${GITHUB_TOKEN}"} \
-s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v3.1.0-alpha.6/downloader/run.sh \
| VERSION=v3.1.0-alpha.6 PARAMS="-url http://localhost:8001 -host 10.0.2.2 -debug -stop-service-at-end -skip-from $(SUPPRESSION_FILE_FDV2) $(TEST_HARNESS_PARAMS_V3)" sh

contract-tests: build-contract-tests start-emulator start-contract-test-service run-contract-tests

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.launchdarkly.sdk.android.ConnectionMode;
import com.launchdarkly.sdk.android.DataSystemComponents;
import com.launchdarkly.sdk.android.LaunchDarklyException;
import com.launchdarkly.sdk.android.InternalDataSystemAccess;
import com.launchdarkly.sdk.android.LDClient;
import com.launchdarkly.sdk.android.LDConfig;

Expand Down Expand Up @@ -394,13 +393,13 @@ private LDConfig buildSdkConfig(SdkConfigParams params, LDLogAdapter logAdapter,

private void configureDataSystem(LDConfig.Builder builder, SdkConfigDataSystemParams dataSystem) {
if (Boolean.TRUE.equals(dataSystem.useDefaultDataSystem)) {
InternalDataSystemAccess.applyToConfig(builder, InternalDataSystemAccess.newBuilder());
builder.dataSystem(Components.dataSystem());
return;
}

SdkConfigConnectionModeConfig connModeConfig = dataSystem.connectionModeConfig;

DataSystemBuilder dsBuilder = InternalDataSystemAccess.newBuilder();
DataSystemBuilder dsBuilder = Components.dataSystem();

// at the time of writing this, we did not have contract tests that could test platform state changes,
// disabling automatic mode simplifies the behavior being tested
Expand All @@ -425,7 +424,7 @@ private void configureDataSystem(LDConfig.Builder builder, SdkConfigDataSystemPa
dsBuilder.customizeConnectionMode(ConnectionMode.STREAMING, buildConnectionModeBuilder(topLevel));
}

InternalDataSystemAccess.applyToConfig(builder, dsBuilder);
builder.dataSystem(dsBuilder);
}

private static boolean hasTopLevelDataSystemPipelines(SdkConfigDataSystemParams dataSystem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public static PluginsConfigurationBuilder plugins() {
* @see DataSystemComponents
* @see LDConfig.Builder#dataSystem(DataSystemBuilder)
*/
static DataSystemBuilder dataSystem() {
public static DataSystemBuilder dataSystem() {
return new DataSystemBuilder();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public Builder dataSource(ComponentConfigurer<DataSource> dataSourceConfigurer)
* @see Components#dataSystem()
* @see DataSystemBuilder
*/
Builder dataSystem(DataSystemBuilder dataSystemBuilder) {
public Builder dataSystem(DataSystemBuilder dataSystemBuilder) {
this.dataSystemBuilder = dataSystemBuilder;
this.dataSource = null;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
* This type is part of the early-access data system API and is not stable.
*/
public abstract class InitializerEntry {

InitializerEntry() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
* This type is part of the early-access data system API and is not stable.
*/
public abstract class SynchronizerEntry {

SynchronizerEntry() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ public void cacheInitializer_buildWithPlainInputs_emptyChangeSet() throws Except
assertEquals(ChangeSetType.None, result.getChangeSet().getType());
}

@Test
public void unsupportedInitializer_throwsIllegalArgumentException() {
InitializerEntry unsupported = new InitializerEntry() {};
try {
FDv2EntryConverter.toInitializerBuilder(unsupported);
org.junit.Assert.fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().contains("Unsupported InitializerEntry"));
assertTrue(e.getMessage().contains(unsupported.getClass().getName()));
}
}

@Test
public void pollingSynchronizer_converts() {
DataSourceBuilder<Synchronizer> builder = FDv2EntryConverter.toSynchronizerBuilder(
Expand All @@ -91,18 +79,6 @@ public void streamingSynchronizer_converts() {
assertNotNull(builder);
}

@Test
public void unsupportedSynchronizer_throwsIllegalArgumentException() {
SynchronizerEntry unsupported = new SynchronizerEntry() {};
try {
FDv2EntryConverter.toSynchronizerBuilder(unsupported);
org.junit.Assert.fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().contains("Unsupported SynchronizerEntry"));
assertTrue(e.getMessage().contains(unsupported.getClass().getName()));
}
}

@Test
public void toInitializerBuilders_preservesOrderAndKinds() {
List<InitializerEntry> entries = Arrays.asList(
Expand Down
Loading