pub trait RoutingTestModel {
type C: ComponentInstanceInterface + Debug + 'static;
// Required methods
fn check_use<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_use_exposed_dir<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_exposed_to_framework<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn look_up_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
moniker: &'life1 Moniker,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::C>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_open_node<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
path: Path,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_static_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
contents: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn install_namespace_directory(&self, path: &str);
fn add_subdir_to_data_directory(&self, subdir: &str);
fn check_test_subdir_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: Vec<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_namespace_subdir_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: Vec<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_test_subdir_contains<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_test_dir_tree_contains<'life0, 'async_trait>(
&'life0 self,
expected: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
A RoutingTestModel
attempts to use capabilities from instances in a component model
and checks the result of the attempt against an expectation.
Required Associated Types§
Required Methods§
Sourcefn check_use<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_use<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks a use
declaration at moniker
by trying to use capability
.
Sourcefn check_use_exposed_dir<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_use_exposed_dir<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks using a capability from a component’s exposed directory.
Sourcefn check_exposed_to_framework<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_exposed_to_framework<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
check: CheckUse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if the capability name referred to in the first element of the path in the
CheckUse
can successfully be routed from the capabilities exposed to framework. Panics if
path.split()
is longer than one element. Yes it’s hacky to use the path to carry a name
here, but since this is such a small edge case it doesn’t seem worth the refactor.
Sourcefn look_up_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
moniker: &'life1 Moniker,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::C>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn look_up_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
moniker: &'life1 Moniker,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self::C>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Looks up a component instance by its moniker.
Sourcefn check_open_node<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
path: Path,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_open_node<'life0, 'async_trait>(
&'life0 self,
moniker: Moniker,
path: Path,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks that a use declaration of path
at moniker
can be opened with
Fuchsia file operations.
Sourcefn create_static_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
contents: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_static_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
contents: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a file with the given contents in the test dir, along with any subdirectories required.
Sourcefn install_namespace_directory(&self, path: &str)
fn install_namespace_directory(&self, path: &str)
Installs a new directory at path
in the test’s namespace.
Sourcefn add_subdir_to_data_directory(&self, subdir: &str)
fn add_subdir_to_data_directory(&self, subdir: &str)
Creates a subdirectory in the outgoing dir’s /data directory.
Sourcefn check_test_subdir_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: Vec<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_test_subdir_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: Vec<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asserts that the subdir given by path
within the test directory contains exactly the
filenames in expected
.
Sourcefn check_namespace_subdir_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: Vec<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_namespace_subdir_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: Vec<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asserts that the directory at absolute path
contains exactly the filenames in expected
.
Sourcefn check_test_subdir_contains<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_test_subdir_contains<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
expected: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asserts that the subdir given by path
within the test directory contains a file named expected
.