Tabnine Logo
TestRemote.getGreeting
Code IndexAdd Tabnine to your IDE (free)

How to use
getGreeting
method
in
ch.inftec.ju.ee.test.TestRemote

Best Java code snippets using ch.inftec.ju.ee.test.TestRemote.getGreeting (Showing top 8 results out of 315)

origin: ch.inftec.ju/ju-ee

/**
 * Note that the remote naming tests were not really using the properties submitted to them
 * by the Properties instance. Instead, the file jboss-ejb-client.properties was read, same as
 * with the EJB Client API...
 * @throws Exception
 */
@Ignore("PR-285 Not working with WildFly 10, didn't investigate further. We probably don't need this...")
@Test
public void canLookup_testFacadeBean_usingRemoteNaming() throws Exception {
  // https://docs.jboss.org/author/display/AS72/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project
  
  Properties jndiProps = new Properties();
  jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
  jndiProps.put(Context.PROVIDER_URL, "remote://localhost:14447");
  // jndiProps.put("remote.connection.default.port", "8080");
  // create a context passing these properties
  Context ctx = new InitialContext(jndiProps);
  // Important: We can either use 'java:' as prefix or none
  TestRemote testRemote = (TestRemote) ctx.lookup("test/TestRemoteInterfaceBean!" + TestRemote.class.getName());
  Assert.assertEquals("TestRemoteBean says hello to RemoteNamingWithoutPrefix", testRemote.getGreeting("RemoteNamingWithoutPrefix"));
  
  testRemote = (TestRemote) ctx.lookup("java:ee-ear-ear/ee-ear-ejb/TestRemoteBean!" + TestRemote.class.getName());
  Assert.assertEquals("TestRemoteBean says hello to RemoteNaming", testRemote.getGreeting("RemoteNaming"));
}

origin: ch.inftec.ju/ju-ee-testing

/**
 * Note that the remote naming tests were not really using the properties submitted to them
 * by the Properties instance. Instead, the file jboss-ejb-client.properties was read, same as
 * with the EJB Client API...
 * @throws Exception
 */
@Ignore("PR-285 Not working with WildFly 10, didn't investigate further. We probably don't need this...")
@Test
public void canLookup_testFacadeBean_usingRemoteNaming() throws Exception {
  // https://docs.jboss.org/author/display/AS72/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project
  
  Properties jndiProps = new Properties();
  jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
  jndiProps.put(Context.PROVIDER_URL, "remote://localhost:14447");
  // jndiProps.put("remote.connection.default.port", "8080");
  // create a context passing these properties
  Context ctx = new InitialContext(jndiProps);
  // Important: We can either use 'java:' as prefix or none
  TestRemote testRemote = (TestRemote) ctx.lookup("test/TestRemoteInterfaceBean!" + TestRemote.class.getName());
  Assert.assertEquals("TestRemoteBean says hello to RemoteNamingWithoutPrefix", testRemote.getGreeting("RemoteNamingWithoutPrefix"));
  
  testRemote = (TestRemote) ctx.lookup("java:ee-ear-ear/ee-ear-ejb/TestRemoteBean!" + TestRemote.class.getName());
  Assert.assertEquals("TestRemoteBean says hello to RemoteNaming", testRemote.getGreeting("RemoteNaming"));
}

origin: ch.inftec.ju/ju-ee

Assert.assertEquals("TestRemoteBean says hello to EjbClientApi", testRemote.getGreeting("EjbClientApi"));
origin: ch.inftec.ju/ju-ee

  @Test
  public void canLookup_testFacadeBean_usingEjbClientApi_withoutFile() throws Exception {
    // Set EJB Client API properties programmatically instead of using
    // jboss-ejb-client.properties file
    Properties clientProp = new Properties();
    clientProp.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
    clientProp.put("remote.connections", "default");
    clientProp.put("remote.connection.default.port", "18080");
    clientProp.put("remote.connection.default.host", "localhost");
//        clientProp.put("remote.connection.default.username", "ejbUser");
//        clientProp.put("remote.connection.default.password", "ejbPassword");
    clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

    // Set selector (avoiding usage of jboss-ejb-client.properties file)
    EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(clientProp);
    ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
    EJBClientContext.setSelector(selector);
         final Hashtable<String, String> jndiProperties = new Hashtable<>();
//        jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:14447");
    jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
    final Context context = new InitialContext(jndiProperties);
    
    // Important: We need to use the 'ejb:' prefix...
    TestRemote testRemote = (TestRemote) context.lookup("ejb:/test//TestRemoteInterfaceBean!" + TestRemote.class.getName());
    Assert.assertEquals("TestRemoteBean says hello to EjbClientApi", testRemote.getGreeting("EjbClientApi"));
  }
  
origin: ch.inftec.ju/ju-ee-testing

Assert.assertEquals("TestRemoteBean says hello to EjbClientApi", testRemote.getGreeting("EjbClientApi"));
origin: ch.inftec.ju/ju-ee-testing

  @Test
  public void canLookup_testFacadeBean_usingEjbClientApi_withoutFile() throws Exception {
    // Set EJB Client API properties programmatically instead of using
    // jboss-ejb-client.properties file
    Properties clientProp = new Properties();
    clientProp.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
    clientProp.put("remote.connections", "default");
    clientProp.put("remote.connection.default.port", "18080");
    clientProp.put("remote.connection.default.host", "localhost");
//        clientProp.put("remote.connection.default.username", "ejbUser");
//        clientProp.put("remote.connection.default.password", "ejbPassword");
    clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

    // Set selector (avoiding usage of jboss-ejb-client.properties file)
    EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(clientProp);
    ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
    EJBClientContext.setSelector(selector);
         final Hashtable<String, String> jndiProperties = new Hashtable<>();
//        jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:14447");
    jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
    final Context context = new InitialContext(jndiProperties);
    
    // Important: We need to use the 'ejb:' prefix...
    TestRemote testRemote = (TestRemote) context.lookup("ejb:/test//TestRemoteInterfaceBean!" + TestRemote.class.getName());
    Assert.assertEquals("TestRemoteBean says hello to EjbClientApi", testRemote.getGreeting("EjbClientApi"));
  }
  
origin: ch.inftec.ju/ju-ee

  @Test
  public void canLookup_testFacadeBean_usingServiceLocatorBuilder() throws Exception {
    JndiServiceLocator loc = ServiceLocatorBuilder.buildRemote()
        .remoteServer("localhost", 18080)
        .appName("")
        .moduleName("test")
      .createServiceLocator();
    
    // TestRemote testRemote = loc.lookup(TestRemote.class);
    TestRemote testRemote = loc.lookup("TestRemoteInterfaceBean!" + TestRemote.class.getName());
    Assert.assertEquals("TestRemoteBean says hello to ServiceLocatorBuilder", testRemote.getGreeting("ServiceLocatorBuilder"));
  }
}
origin: ch.inftec.ju/ju-ee-testing

  @Test
  public void canLookup_testFacadeBean_usingServiceLocatorBuilder() throws Exception {
    JndiServiceLocator loc = ServiceLocatorBuilder.buildRemote()
        .remoteServer("localhost", 18080)
        .appName("")
        .moduleName("test")
      .createServiceLocator();
    
    // TestRemote testRemote = loc.lookup(TestRemote.class);
    TestRemote testRemote = loc.lookup("TestRemoteInterfaceBean!" + TestRemote.class.getName());
    Assert.assertEquals("TestRemoteBean says hello to ServiceLocatorBuilder", testRemote.getGreeting("ServiceLocatorBuilder"));
  }
}
ch.inftec.ju.ee.testTestRemotegetGreeting

Javadoc

Gets a greeting containing the specified name and the simple name of the class.

Popular methods of TestRemote

    Popular in Java

    • Creating JSON documents from java classes using gson
    • setRequestProperty (URLConnection)
    • compareTo (BigDecimal)
    • startActivity (Activity)
    • FileReader (java.io)
      A specialized Reader that reads from a file in the file system. All read requests made by calling me
    • InputStream (java.io)
      A readable source of bytes.Most clients will use input streams that read data from the file system (
    • Random (java.util)
      This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
    • ResourceBundle (java.util)
      ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
    • JButton (javax.swing)
    • JTextField (javax.swing)
    • Top plugins for Android Studio
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now