1 package hero.client.test; 2 3 24 25 import hero.interfaces.BnUserLightValue; 26 import hero.interfaces.Constants; 27 import hero.interfaces.ProjectSession; 28 import hero.interfaces.ProjectSessionHome; 29 import hero.interfaces.ProjectSessionUtil; 30 import hero.interfaces.UserSession; 31 import hero.interfaces.UserSessionHome; 32 import hero.interfaces.UserSessionUtil; 33 34 import javax.security.auth.login.LoginContext ; 35 36 46 47 48 public class TestRmi { 49 50 public TestRmi() { 51 try{ 52 UserSessionHome userh=UserSessionUtil.getHome(); 53 UserSession userSession = userh.create(); 54 userSession.getUser(); 55 System.out.println("getUser"); 56 userSession.getUserPassword(); 57 System.out.println("getPassword"); 58 BnUserLightValue ulv = userSession.getUserLightValue(); 59 System.out.println("getUserLightValue"); 60 61 ProjectSessionHome projecth=ProjectSessionUtil.getHome(); 62 String projectName= "BnProject-"+System.currentTimeMillis(); 63 ProjectSession projectSession = projecth.create(); 64 projectSession.initProject(projectName); 65 System.out.println("initProject"); 66 String node1=projectName+"-node1-"+System.currentTimeMillis(); 67 projectSession.addNode(node1,Constants.Nd.AND_JOIN_NODE); 68 System.out.println("addNode"); 69 String node2=projectName+"-node2-"+System.currentTimeMillis(); 70 projectSession.addNode(node2,Constants.Nd.AND_JOIN_NODE); 71 System.out.println("addNode"); 72 projectSession.addEdge(node1,node2); 73 System.out.println("addEdge"); 74 userSession.startActivity(projectName,node1); 75 System.out.println("startActivity"); 76 77 78 }catch(Exception e){e.printStackTrace();} 79 } 80 81 82 static public void main(String [] args) 83 { 84 try{ 85 char[] password={'t','o','t','o'}; 86 SimpleCallbackHandler handler = new SimpleCallbackHandler("admin",password); 87 LoginContext lc = new LoginContext ("TestClient", handler); 88 lc.login(); 89 TestRmi tr = new TestRmi(); 90 }catch(Exception e){e.printStackTrace();} 91 92 } 93 } 94 | Popular Tags |