Package br.com.objectos.way.etc.model

Examples of br.com.objectos.way.etc.model.Global


    assertThat(res.get(1).getPath(), equalTo("/tmp/wetc/resources/file1.txt"));
    assertThat(res.get(2).getPath(), equalTo("/tmp/wetc/resources/file2.txt"));
  }

  public void filter_contents() {
    Global global = FakeGlobals.GLOBAL_USER_A;

    WayEtc.resourcesAt()
        .add("/tmpl/etc/user")
        .evalWith(global)
        .copyTo(dir);
View Full Code Here


    assertThat(r0.getPath(), equalTo("/tmp/wetc/resources/tmpl/etc/user"));
    assertThat(r0, hasContentsEqualTo("/eval/etc/user"));
  }

  public void filter_contents_with_list() {
    Global global = FakeGlobals.GLOBAL_USER_A;

    WayEtc.resourcesAt()
        .addFromListAt("/resources-file-list.txt")
        .evalWith(global)
        .only("/tmpl/etc/host")
View Full Code Here

    assertThat(res.get(1).getPath(), equalTo("/tmp/wetc/resources/file1.txt"));
    assertThat(res.get(2).getPath(), equalTo("/tmp/wetc/resources/file2.txt"));
  }

  public void filter_contents() {
    Global global = FakeGlobals.GLOBAL_USER_A;

    WayEtc.resourcesAt()
        .add("/tmpl/etc/user")
        .evalWith(global)
        .copyTo(dir);
View Full Code Here

    assertThat(r0.getPath(), equalTo("/tmp/wetc/resources/tmpl/etc/user"));
    assertThat(r0, hasContentsEqualTo("/eval/etc/user"));
  }

  public void filter_contents_with_list() {
    Global global = FakeGlobals.GLOBAL_USER_A;

    WayEtc.resourcesAt()
        .addFromListAt("/resources-file-list.txt")
        .evalWith(global)
        .only("/tmpl/etc/host")
View Full Code Here

    assertThat(res.get(1).getPath(), equalTo("/tmp/wetc/resources/etc/host"));
    assertThat(res.get(2).getPath(), equalTo("/tmp/wetc/resources/etc/user"));
  }

  public void filter_contents() {
    Global global = FakeGlobals.GLOBAL_USER_A;

    WayEtc.resourcesAt()
        .add("/tmpl/etc/user")
        .evalWith(global)
        .copyTo(dir);
View Full Code Here

    assertThat(r0.getPath(), equalTo("/tmp/wetc/resources/tmpl/etc/user"));
    assertThat(r0, hasContentsEqualTo("/eval/etc/user"));
  }

  public void filter_contents_with_list() {
    Global global = FakeGlobals.GLOBAL_USER_A;

    WayEtc.resourcesAt()
        .addFromListAt("/resources-file-list.txt")
        .evalWith(global)
        .only("/tmpl/etc/host")
View Full Code Here

  @Inject
  private Provider<Config> configProvider;

  public void global_dump() throws IOException {
    Global global = FakeGlobals.GLOBAL_USER_A;

    String expect = EtcFiles.readLines("/model/global-usera.yaml");
    System.out.println(expect);

    Config config = configProvider.get();
View Full Code Here

  public void global_read() throws IOException {
    String text = EtcFiles.readLines("/model/global-usera.yaml");

    Config config = configProvider.get();
    Global res = config.load(text, Global.class);

    User user = res.getUser();
    assertThat(user.getName(), equalTo(USER_A.getName()));
    assertThat(user.getEmail(), equalTo(USER_A.getEmail()));
  }
View Full Code Here

  @Inject
  private Provider<Config> configProvider;

  public void global_dump() throws IOException {
    Global global = FakeGlobals.GLOBAL_USER_A;

    String expect = EtcFiles.readLines("/model/global-usera.yaml");
    System.out.println(expect);

    Config config = configProvider.get();
View Full Code Here

    assertThat(res, equalTo(expect));
  }

  public void global_read() {
    Global global = global()
        .user(USER_A)
        .build();

    Config config = configProvider.get();
    String data = config.toString(global);
    Global res = config.loadAs(data, Global.class);

    User user = res.getUser();
    assertThat(user.getName(), equalTo(USER_A.getName()));
    assertThat(user.getEmail(), equalTo(USER_A.getEmail()));
  }
View Full Code Here

TOP

Related Classes of br.com.objectos.way.etc.model.Global

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.