Examples of CustomPrintStreamFactory


Examples of org.jboss.forge.classloader.mock.CustomPrintStreamFactory

      catch (ClassCastException e)
      {
      }

      Object delegate = foreignType.newInstance();
      CustomPrintStreamFactory enhancedFactory = (CustomPrintStreamFactory) ClassLoaderAdapterBuilder
               .callingLoader(thisLoader)
               .delegateLoader(dep1Loader).enhance(delegate);

      Assert.assertTrue(Proxies.isForgeProxy(enhancedFactory));
      PrintStream result = enhancedFactory.getPrintStream();
      Assert.assertFalse(Proxies.isForgeProxy(result));

      File file = File.createTempFile("furnace", "printStream");
      file.deleteOnExit();
      enhancedFactory.usePrintStream(new CustomPrintStream(file));

      try
      {
         @SuppressWarnings("unused")
         CustomPrintStream customResult = enhancedFactory.getCustomPrintStream();
         Assert.fail("Should have received a classcast exception");
      }
      catch (ClassCastException e)
      {
      }
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.