Skip to content

Instantly share code, notes, and snippets.

@koduki
Created February 5, 2015 23:18
Show Gist options
  • Save koduki/e062b91a9aea99abca4b to your computer and use it in GitHub Desktop.
Save koduki/e062b91a9aea99abca4b to your computer and use it in GitHub Desktop.
Stateless session bean Test
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.javaee.simpletester.resources;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
/**
*
* @author koduki
*/
@Path("/ejbtest")
@Stateless
public class EJBExample {
@EJB
private SimpleBean simpleBean1;
@EJB
private SimpleBean simpleBean2;
@GET
public String get() {
String msg = "";
if (simpleBean1.equals(simpleBean1)) {// this test returns true
msg += "s1 == s1 is true \n";
}
if (simpleBean1.equals(simpleBean2)) {// this test returns true
msg += "s1 == s1 is true \n";
}
return msg;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment