routing_test_helpers

Trait RoutingTestModel

Source
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 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§

Source

type C: ComponentInstanceInterface + Debug + 'static

Required Methods§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn install_namespace_directory(&self, path: &str)

Installs a new directory at path in the test’s namespace.

Source

fn add_subdir_to_data_directory(&self, subdir: &str)

Creates a subdirectory in the outgoing dir’s /data directory.

Source

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.

Source

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.

Source

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.

Source

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,

Asserts that the tree in the test directory under path contains a file named expected.

Implementors§