Changeset 2500
- Timestamp:
- 10/06/08 16:22:45 (3 months ago)
- Location:
- trunk/otis/src/org/bandit/otis
- Files:
-
- 6 added
- 4 removed
- 6 modified
-
server/EntityHandler.java (modified) (2 diffs)
-
server/OtisServlet.java (modified) (1 diff)
-
test/OTISRunner.java (modified) (6 diffs)
-
test/junit/AllTests.java (modified) (2 diffs)
-
test/junit/AuthSessionBaseTest.java (modified) (2 diffs)
-
test/junit/DeployOTIS.java (added)
-
test/junit/DeployOTISAnd.java (added)
-
test/junit/DeployOTISOr.java (added)
-
test/junit/GlassfishShutdown.java (added)
-
test/junit/GlassfishStartup.java (added)
-
test/junit/OTISShutdown.java (deleted)
-
test/junit/OTISStartup.java (deleted)
-
test/junit/OTISStartupAnd.java (deleted)
-
test/junit/OTISStartupOr.java (deleted)
-
test/junit/SampleDeployment.java (modified) (2 diffs)
-
test/junit/UndeployOTIS.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/otis/src/org/bandit/otis/server/EntityHandler.java
r2490 r2500 553 553 try 554 554 { 555 m_log.debug( "Calling getEntitites"); 555 556 entityIter = localAuthSession.getEntities( null, (attrList != null) ? attrList.iterator() : null); 557 m_log.debug( "Start iterating through results"); 558 int iAttrCnt = 0; 556 559 while (entityIter.hasNext()) 557 560 { … … 566 569 567 570 List entityAttrList; 571 iAttrCnt++; 572 m_log.debug( "Getting attr #" + iAttrCnt); 568 573 if ((entityAttrList = queryAttributes( strSessionID, "Entity='" + strEntityID + "'", entity, attrList, responseMap)) != null) 569 574 { 570 575 entityMap.put( Constants.TEMPLATE_ATTR_LIST, entityAttrList); 571 576 } 577 m_log.debug( "Got attr #" + iAttrCnt); 572 578 entityList.add( entityMap); 573 579 } 580 m_log.debug( "Done iterating through results"); 574 581 } 575 582 catch (IdASException e) -
trunk/otis/src/org/bandit/otis/server/OtisServlet.java
r2483 r2500 1163 1163 StringWriter strOut = new StringWriter( 1024); 1164 1164 Template template = m_templateCfg.getTemplate( strTemplateFile); 1165 1165 1166 m_log.debug( "Processing template " + strTemplateFile + " ...."); 1166 1167 template.process( responseMap, strOut); 1168 m_log.debug( "Done processing template " + strTemplateFile); 1167 1169 1168 1170 // Now output over HTTP. -
trunk/otis/src/org/bandit/otis/test/OTISRunner.java
r2499 r2500 20 20 private static int port = 9997; 21 21 private static Integer sync = new Integer( 0); 22 23 public static void startGlassfish() 24 { 25 try 26 { 27 synchronized( sync) 28 { 29 glassfish = new AppServer(port); 30 } 31 } 32 catch (Throwable e) 33 { 34 System.out.println( e.getMessage()); 35 e.printStackTrace(); 36 } 37 } 38 39 public static void stopGlassfish() 40 { 41 try 42 { 43 synchronized( sync) 44 { 45 glassfish.stop(); 46 glassfish = null; 47 } 48 } 49 catch (Throwable e) 50 { 51 System.out.println( e.getMessage()); 52 e.printStackTrace(); 53 } 54 } 22 55 23 56 private static void copyFile( … … 89 122 } 90 123 91 public static void start(124 public static void deployWar( 92 125 String strServerConfigFile, 93 126 String strServerLocalConfigFile) throws IOException { … … 97 130 { 98 131 otisUseCount++; 99 System.out.println( "start, count = " + otisUseCount); 100 if (otisUseCount == 1) { 101 System.out.println( "Allocating glassfish"); 102 glassfish = new AppServer(port); 132 if (otisUseCount == 1) 133 { 134 if (glassfish == null) 135 { 136 glassfish = new AppServer(port); 137 } 103 138 otis = glassfish.deploy(new File("build/otis-test.war")); 104 139 byte [] copyBuf = new byte [2048]; 105 if (strServerConfigFile != null) { 140 if (strServerConfigFile != null) 141 { 106 142 // Copy over otis-config.server.xml 107 143 copyFile( "otis-config.server.xml", strServerConfigFile, copyBuf); 108 144 } 109 if (strServerLocalConfigFile != null) { 145 if (strServerLocalConfigFile != null) 146 { 110 147 // Copy over otis-config.client.local.xml 111 148 copyFile( "otis-config.client.local.xml", strServerLocalConfigFile, copyBuf); … … 129 166 } 130 167 131 public static void stop() { 168 public static void undeployWar() 169 { 132 170 try 133 171 { … … 135 173 { 136 174 otisUseCount--; 137 System.out.println( "stop, count = " + otisUseCount);138 if (otisUseCount == 0){175 if (otisUseCount == 0) 176 { 139 177 otis.undeploy(); 140 glassfish.stop();141 glassfish = null;142 System.out.println( "UNDEPLOY");143 178 } 144 179 } … … 150 185 } 151 186 } 152 153 187 } 188 -
trunk/otis/src/org/bandit/otis/test/junit/AllTests.java
r2499 r2500 10 10 { 11 11 TestSuite suite = new TestSuite("Test for org.bandit.otis.test"); 12 12 13 //$JUnit-BEGIN$ 13 // OTISStartup - use around tests that don't have to manipulate server startup 14 suite.addTestSuite(OTISStartup.class); 14 suite.addTestSuite(GlassfishStartup.class); 15 // Deploy the default OTIS war file for the following tests 16 suite.addTestSuite(DeployOTIS.class); 15 17 suite.addTestSuite(UriBuilderTest.class); 16 18 suite.addTestSuite(AttributeTest.class); … … 21 23 suite.addTestSuite(PropertiesTest.class); 22 24 // suite.addTestSuite(IDMSessionTest.class); 23 // OTISShutdown will force OTIS server to go down24 suite.addTestSuite( OTISShutdown.class);25 // Undeploy the default OTIS war file 26 suite.addTestSuite(UndeployOTIS.class); 25 27 26 // These tests do their own thing with OTIS server - different config. 27 /* Commented out for now because the startup/shutdown of the OTIS server has problems. 28 suite.addTestSuite(OTISStartupAnd.class); 28 // These tests slightly modify the OTIS war configuration 29 suite.addTestSuite(DeployOTISAnd.class); 29 30 suite.addTestSuite(CustomAuthMethodTestAnd.class); 30 suite.addTestSuite( OTISShutdown.class);31 suite.addTestSuite(UndeployOTIS.class); 31 32 32 suite.addTestSuite( OTISStartupOr.class);33 suite.addTestSuite(DeployOTISOr.class); 33 34 suite.addTestSuite(CustomAuthMethodTestOr.class); 34 suite.addTestSuite(OTISShutdown.class); 35 */ 35 suite.addTestSuite(UndeployOTIS.class); 36 37 suite.addTestSuite(GlassfishShutdown.class); 36 38 37 39 //$JUnit-END$ -
trunk/otis/src/org/bandit/otis/test/junit/AuthSessionBaseTest.java
r2499 r2500 55 55 { 56 56 try { 57 OTISRunner. start( strServerConfigFile, strLocalConfigFile);57 OTISRunner.deployWar( strServerConfigFile, strLocalConfigFile); 58 58 } catch (IOException e) { 59 59 m_log.error(e); … … 89 89 protected void tearDown() 90 90 { 91 OTISRunner. stop();91 OTISRunner.undeployWar(); 92 92 // ldapServer.shutdownTool(); 93 93 ldapServer ls = ldapSrv.getServer(); -
trunk/otis/src/org/bandit/otis/test/junit/SampleDeployment.java
r2499 r2500 16 16 super.setUp(); 17 17 18 OTISRunner. start( null, null);18 OTISRunner.deployWar( null, null); 19 19 20 20 String[] args = … … 36 36 protected void tearDown() 37 37 { 38 OTISRunner. stop();38 OTISRunner.undeployWar(); 39 39 // ldapServer.shutdownTool(); 40 40 ldapServer ls = ldapSrv.getServer();