Package org.apache.wicket.core.util.objects.checker

Examples of org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker


        {
          try
          {
            // trigger serialization again, but this time gather some more info
            CheckingObjectOutputStream checkingObjectOutputStream =
              new CheckingObjectOutputStream(outputStream, new ObjectSerializationChecker(nsx));
            checkingObjectOutputStream.writeObject(obj);
          }
          catch (Exception x)
          {
            if (x instanceof CheckingObjectOutputStream.ObjectCheckException)
View Full Code Here


   */
  @Test
  public void valueMap() throws IOException
  {
    CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(),
        new ObjectSerializationChecker(new NotSerializableException()));
    checker.writeObject(new ValueMap());
  }
View Full Code Here

   */
  @Test
  public void nonSerializableTypeDetection() throws IOException
  {
    CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(),
      new ObjectSerializationChecker(new NotSerializableException()));
    String exceptionMessage = null;
    try
    {
      checker.writeObject(new TestType2());
    }
View Full Code Here

   */
  @Test
  public void valueMap() throws IOException
  {
    CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(),
        new ObjectSerializationChecker(new NotSerializableException()));
    checker.writeObject(new ValueMap());
  }
View Full Code Here

    Logger logger = LogManager.getLogger(CheckingObjectOutputStream.class);
    logger.setLevel(Level.WARN);
    Log4jEventHistory logHistory = new Log4jEventHistory();
    logger.addAppender(logHistory);
    CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(),
        new ObjectSerializationChecker(new NotSerializableException()));
    try
    {
      checker.writeObject(new TestType1());
      String expectedMessage = "Wasn't possible to check the object 'class org.apache.wicket.util.io.SerializableCheckerTest$ProblematicType' possible due an problematic implementation of equals method";
      assertTrue(logHistory.contains(Level.WARN, expectedMessage));
View Full Code Here

   */
  @Test
  public void nonSerializableTypeDetection() throws IOException
  {
    CheckingObjectOutputStream checker = new CheckingObjectOutputStream(new ByteArrayOutputStream(),
      new ObjectSerializationChecker(new NotSerializableException()));
    String exceptionMessage = null;
    try
    {
      checker.writeObject(new TestType2());
    }
View Full Code Here

      {
        if (CheckingObjectOutputStream.isAvailable())
        {
          // trigger serialization again, but this time gather some more info
          CheckingObjectOutputStream checkingObjectOutputStream =
              new CheckingObjectOutputStream(outputStream, new ObjectSerializationChecker(nsx));
          checkingObjectOutputStream.writeObject(obj);

          // if we get here, we didn't fail, while we should
          throw nsx;
        }
View Full Code Here

TOP

Related Classes of org.apache.wicket.core.util.objects.checker.ObjectSerializationChecker

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.