Package org.sonatype.nexus.proxy.attributes

Examples of org.sonatype.nexus.proxy.attributes.DefaultAttributes.asMap()


    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    marshaller.marshal(attributes1, bos);
    final ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
    final Attributes attributes2 = marshaller.unmarshal(bis);
    // size same
    assertThat(attributes2.asMap().size(), equalTo(attributes1.asMap().size()));
    // as maps are equal
    assertThat(attributes2.asMap(), equalTo(attributes1.asMap()));
    // but we deal with two different instances
    assertThat(System.identityHashCode(attributes2), not(equalTo(System.identityHashCode(attributes1))));
  }
View Full Code Here


    final ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
    final Attributes attributes2 = marshaller.unmarshal(bis);
    // size same
    assertThat(attributes2.asMap().size(), equalTo(attributes1.asMap().size()));
    // as maps are equal
    assertThat(attributes2.asMap(), equalTo(attributes1.asMap()));
    // but we deal with two different instances
    assertThat(System.identityHashCode(attributes2), not(equalTo(System.identityHashCode(attributes1))));
  }

  protected void doTestUnparseableRoundtrip(final Marshaller marshaller)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.