Examples of FakeService


Examples of org.jboss.arquillian.core.impl.loadable.util.FakeService

   public void shouldBeAbleToLoadOnlyOne() throws Exception
   {
      ServiceRegistry registry = new ServiceRegistry(injector.get());
      registry.addService(FakeService.class, ShouldBeIncluded.class);
     
      FakeService service = registry.getServiceLoader().onlyOne(FakeService.class);
     
      Assert.assertNotNull(service);
      Assert.assertTrue(
            "Verify service is of expected type",
            service instanceof ShouldBeIncluded);
View Full Code Here

Examples of org.jboss.arquillian.core.impl.loadable.util.FakeService

   {
      ServiceRegistry registry = new ServiceRegistry(injector.get());
     
      Assert.assertNull(registry.getServiceLoader().onlyOne(FakeService.class));
     
      FakeService service = registry.getServiceLoader().onlyOne(FakeService.class, ShouldBeIncluded.class);
      Assert.assertNotNull(service);
      Assert.assertTrue(
            "Verify service is of expected type",
            service instanceof ShouldBeIncluded);
   }
View Full Code Here

Examples of org.jboss.arquillian.core.impl.loadable.util.FakeService

      bind(ApplicationScoped.class, String.class, "TEST");
     
      ServiceRegistry registry = new ServiceRegistry(injector.get());
      registry.addService(FakeService.class, ShouldBeIncluded.class);
     
      FakeService service = registry.getServiceLoader().onlyOne(FakeService.class);
      Assert.assertTrue(
            "Verify service has been statically injected",
            service.isValid());
   }
View Full Code Here

Examples of org.jboss.arquillian.core.impl.loadable.util.FakeService

     
      ServiceRegistry registry = new ServiceRegistry(injector.get());

      Assert.assertNull(registry.getServiceLoader().onlyOne(FakeService.class));

      FakeService service = registry.getServiceLoader().onlyOne(FakeService.class, ShouldBeIncluded.class);
      Assert.assertTrue(
            "Verify service has been statically injected",
            service.isValid());
   }
View Full Code Here

Examples of org.jboss.arquillian.core.impl.loadable.util.FakeService

   public void shouldBeAbleToLoadProtectedServices() throws Exception {
      ServiceRegistry registry = new ServiceRegistry(injector.get());
      registry.addService(
            FakeService.class, (Class<FakeService>)Class.forName("org.jboss.arquillian.core.impl.loadable.util.PackageProtectedService"));
  
      FakeService service = registry.getServiceLoader().onlyOne(FakeService.class);
      Assert.assertNotNull("Could load package protected service", service);
   }
View Full Code Here

Examples of org.teiid.transport.TestSocketRemoting.FakeService

    assertEquals(1, stats.maxSockets);
  }

  @Test public void testLobs() throws Exception {
    SocketServerConnection conn = helpEstablishConnection(false);
    FakeService fs = conn.getService(FakeService.class);
    assertEquals(150, fs.lobMethod(new ByteArrayInputStream(new byte[100]), new StringReader(new String(new char[50]))));
    assertEquals(2, storageManager.getCreated());
    assertEquals(2, storageManager.getRemoved());
    assertEquals(0, fs.lobMethod(new ByteArrayInputStream(new byte[0]), new StringReader(new String(new char[0]))));
    assertEquals(4, storageManager.getCreated());
    assertEquals(4, storageManager.getRemoved());
    assertEquals((1 << 17) + 50, fs.lobMethod(new ByteArrayInputStream(new byte[1 << 17]), new StringReader(new String(new char[50]))));
    assertEquals(6, storageManager.getCreated());
    assertEquals(6, storageManager.getRemoved());
  }
View Full Code Here

Examples of org.teiid.transport.TestSocketRemoting.FakeService

    assertEquals(6, storageManager.getRemoved());
  }
 
  @Test public void testServerRemoteStreaming() throws Exception {
    SocketServerConnection conn = helpEstablishConnection(false);
    FakeService fs = conn.getService(FakeService.class);
    assertEquals("hello world", ObjectConverterUtil.convertToString(fs.getReader()));
    assertTrue(Serializable.class.isAssignableFrom(fs.getReader().getClass()));
  }
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.