Skip to content

Commit

Permalink
refactor(nextcloud_test): mark test targets as internal
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
  • Loading branch information
Leptopoda committed Jul 28, 2024
1 parent e112634 commit 9cffb7d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/nextcloud_test/lib/nextcloud_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export 'src/defaults.dart';
export 'src/fixtures.dart' hide appendFixture;
export 'src/presets.dart';
export 'src/test_target/test_target.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:nextcloud/nextcloud.dart';
import 'package:nextcloud_test/nextcloud_test.dart';
import 'package:nextcloud_test/src/models/models.dart';
import 'package:nextcloud_test/src/test_target/test_target.dart';
import 'package:version/version.dart';

/// Class that manages the creation of nextcloud api clients and the test environment.
Expand Down
1 change: 1 addition & 0 deletions packages/nextcloud_test/lib/src/presets.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:meta/meta.dart';
import 'package:nextcloud_test/nextcloud_test.dart';
import 'package:nextcloud_test/src/models/models.dart';
import 'package:nextcloud_test/src/test_target/test_target.dart';
import 'package:test/test.dart';

/// Signature for callback to [presets].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'dart:math';
import 'package:built_collection/built_collection.dart';
import 'package:glob/glob.dart';
import 'package:glob/list_local_fs.dart';
import 'package:meta/meta.dart';
import 'package:nextcloud_test/src/models/models.dart';
import 'package:nextcloud_test/src/test_target/test_target.dart';
import 'package:path/path.dart' as p;
Expand All @@ -14,7 +15,8 @@ import 'package:version/version.dart';
int _randomPort() => 1024 + Random().nextInt(65535 - 1024);

/// Factory for spawning docker containers as test targets.
class DockerContainerFactory extends TestTargetFactory<DockerContainerInstance> {
@internal
final class DockerContainerFactory extends TestTargetFactory<DockerContainerInstance> {
/// Creates a new docker container and returns its representation.
@override
Future<DockerContainerInstance> spawn(Preset preset) async {
Expand Down Expand Up @@ -83,7 +85,8 @@ class DockerContainerFactory extends TestTargetFactory<DockerContainerInstance>
}

/// Test target representing a docker container.
class DockerContainerInstance extends TestTargetInstance {
@internal
final class DockerContainerInstance extends TestTargetInstance {
/// Creates a new Docker container instance.
DockerContainerInstance({
required this.id,
Expand Down
9 changes: 5 additions & 4 deletions packages/nextcloud_test/lib/src/test_target/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import 'dart:async';
import 'dart:convert';

import 'package:built_collection/built_collection.dart';
import 'package:nextcloud_test/nextcloud_test.dart';
import 'package:meta/meta.dart';
import 'package:nextcloud_test/src/models/models.dart';
import 'package:nextcloud_test/src/test_target/test_target.dart';
import 'package:process_run/process_run.dart';
import 'package:version/version.dart';

/// Factory for running tests against a local instance.
class LocalFactory extends TestTargetFactory<LocalInstance> {
@internal
final class LocalFactory extends TestTargetFactory<LocalInstance> {
/// Creates a new test factory for a local server.
LocalFactory({
required String dir,
Expand Down Expand Up @@ -86,7 +86,8 @@ class LocalFactory extends TestTargetFactory<LocalInstance> {
}

/// Test target representing a local instance.
class LocalInstance extends TestTargetInstance {
@internal
final class LocalInstance extends TestTargetInstance {
/// Creates a new test instance for a local server.
LocalInstance({
required Uri url,
Expand Down
3 changes: 2 additions & 1 deletion packages/nextcloud_test/lib/src/test_target/test_target.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:nextcloud_test/src/test_target/local.dart';
import 'package:version/version.dart';

/// Factory for creating [TestTargetInstance]s.
@internal
abstract class TestTargetFactory<T extends TestTargetInstance> {
/// The instance of the [TestTargetFactory].
static final TestTargetFactory instance = TestTargetFactory._create();
Expand Down Expand Up @@ -49,6 +49,7 @@ abstract class TestTargetFactory<T extends TestTargetInstance> {
}

/// Instance of a test target.
@internal
abstract class TestTargetInstance {
/// Destroys the instance.
FutureOr<void> destroy();
Expand Down

0 comments on commit 9cffb7d

Please sign in to comment.