Package org.sonatype.security.model.io.xpp3

Examples of org.sonatype.security.model.io.xpp3.SecurityConfigurationXpp3Reader


  @Test
  public void modifyConfiguration()
      throws Exception
  {
    final Configuration configuration = new SecurityConfigurationXpp3Reader().read(
        new FileInputStream(util.resolveFile("target/test-classes/security.xml"))
    );

    modifier.apply(configuration);
View Full Code Here


  }

  protected void resultIsFine(String path, Configuration configuration)
      throws Exception
  {
    SecurityConfigurationXpp3Writer w = new SecurityConfigurationXpp3Writer();

    StringWriter sw = new StringWriter();

    w.write(sw, configuration);

    String shouldBe = IOUtils.toString(getClass().getResourceAsStream(path + ".result"));
    shouldBe = shouldBe.replace("\r\n", "\n");

    assertEquals(shouldBe, sw.toString());
View Full Code Here

  }

  protected void resultIsFine(String path, Configuration configuration)
      throws Exception
  {
    SecurityConfigurationXpp3Writer w = new SecurityConfigurationXpp3Writer();

    StringWriter sw = new StringWriter();

    w.write(sw, configuration);

    String shouldBe = IOUtils.toString(getClass().getResourceAsStream(path + ".result"));
    shouldBe = shouldBe.replace("\r\n", "\n");

    assertEquals(shouldBe, sw.toString());
View Full Code Here

    {
      @Override
      public void write(final BufferedOutputStream output)
          throws IOException
      {
        new SecurityConfigurationXpp3Writer().write(output, configuration);
      }
    });
  }
View Full Code Here

    try (FileWriter fileWriter = new FileWriter(securityXML)) {
      config.getUsers().get(0).setEmail("testLoadConfigWithInvalidEmail");
      userId = config.getUsers().get(0).getId();

      SecurityConfigurationXpp3Writer writer = new SecurityConfigurationXpp3Writer();
      writer.write(fileWriter, config);
    }

    // FIXME: unsure about the intent of this test...
    // now restart the security
    // this.getSecuritySystem().start();
View Full Code Here

    );

    modifier.apply(configuration);

    final File modified = util.resolveFile("target/modified-security.xml");
    new SecurityConfigurationXpp3Writer().write(
        new FileOutputStream(modified),
        configuration
    );
    assertThat(
        normalizeLineEndings(readFileToString(modified)),
View Full Code Here

    try {
      // reading without interpolation to preserve user settings as variables
      fr = new FileReader(file);

      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      return reader.read(fr);
    }
    catch (XmlPullParserException e) {
      throw new ConfigurationIsCorruptedException(file.getAbsolutePath(), e);
    }
    finally {
View Full Code Here

    try {
      // reading without interpolation to preserve user settings as variables
      fr = new FileReader(file);

      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      return reader.read(fr);
    }
    catch (XmlPullParserException e) {
      throw new ConfigurationIsCorruptedException(file.getAbsolutePath(), e);
    }
    finally {
View Full Code Here

    try {
      // reading without interpolation to preserve user settings as variables
      fr = new FileReader(file);

      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      return reader.read(fr);
    }
    catch (XmlPullParserException e) {
      throw new ConfigurationIsCorruptedException(file.getAbsolutePath(), e);
    }
    finally {
View Full Code Here

    try {
      // reading without interpolation to preserve user settings as variables
      fr = new FileReader(file);

      SecurityConfigurationXpp3Reader reader = new SecurityConfigurationXpp3Reader();

      return reader.read(fr);
    }
    catch (XmlPullParserException e) {
      throw new ConfigurationIsCorruptedException(file.getAbsolutePath(), e);
    }
    finally {
View Full Code Here

TOP

Related Classes of org.sonatype.security.model.io.xpp3.SecurityConfigurationXpp3Reader

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.