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

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


  private Dirs dirs;

  @Override
  public Global build() {
    return new Global(this);
  }
View Full Code Here


  public void write() {
    Global.FILE.delete();
    String expected = EtcFiles.readLines("/model/global-usera.yaml");

    Global global = FakeGlobals.GLOBAL_USER_A;
    etcs.write(global);

    String res = EtcFiles.readLines(Global.FILE);
    assertThat(res, equalTo(expected));
  }
View Full Code Here

  }

  public void writeProperty() {
    Global.FILE.delete();

    Global global = FakeGlobals.GLOBAL_USER_A;
    etcs.write(global);

    Global read = etcs.read(Global.class);
    assertThat(read.getString(), equalTo(global.getString()));
    assertThat(read.getInteger(), equalTo(global.getInteger()));

    etcs.writeProperty("global.string", "xyz");
    etcs.writeProperty("global.integer", "789");

    Global res = etcs.read(Global.class);
    assertThat(res.getString(), equalTo("xyz"));
    assertThat(res.getInteger(), equalTo(789));
  }
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

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.