Package org.sonatype.plexus.components.sec.dispatcher.model.io.xpp3

Examples of org.sonatype.plexus.components.sec.dispatcher.model.io.xpp3.SecurityConfigurationXpp3Writer


       
        try
        {
            in = toStream( location );
           
            SettingsSecurity sec = new SecurityConfigurationXpp3Reader().read( in );
           
            in.close();
           
            if( cycle && sec.getRelocation() != null )
                return read( sec.getRelocation(), true );
View Full Code Here


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

  }

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

    StringWriter sw = new StringWriter();

    w.write(sw, configuration);

    String actual = sw.toString();
    actual = actual.replace("\r\n", "\n");

    String shouldBe = IOUtils.toString(getClass().getResourceAsStream(path + ".result"));
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

TOP

Related Classes of org.sonatype.plexus.components.sec.dispatcher.model.io.xpp3.SecurityConfigurationXpp3Writer

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.