Java Doc for TestUtils.java in  » JMX » je » com » sleepycat » je » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » je » com.sleepycat.je.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sleepycat.je.util.TestUtils

TestUtils
public class TestUtils (Code)


Field Summary
public static  StringDEST_DIR
    
final public static  StatsConfigFAST_STATS
    
final public static  StringLOG_FILE_NAME
    
public static  StringLONG_TEST
    
public static  StringNO_SYNC
    


Method Summary
public static  intalphaKey(int i)
     Generate a synthetic base 26 four byte alpha key from an int. The bytes of the key are between 'A' and 'Z', inclusive.
public static  byte[]byteArrayCopy(byte[] ba)
    
public static  voidcheckLatchCount()
    
public static  booleancheckTreeDepth(Database db, int desiredDepth)
     Assert if the tree is not this deep.
public static  voidclearIsolationLevel(EnvironmentConfig config)
     If a unit test needs to override the isolation level, it should call this method after calling initEnvConfig.
public static  voidcopyFiles(File fromDir, File toDir)
     Copies all files in fromDir to toDir.
public  voiddebugMsg(String message)
    
public static  StringdumpByteArray(byte[] b)
    
public static  voidgenerateRandomAlphaBytes(byte[] bytes)
    
public static  BINgetBIN(Cursor cursor)
     Returns the target BIN for the given cursor.
public static  INgetIN(BIN bin)
     Returns the parent IN of the given BIN.
public static  byte[]getTestArray(int val)
     Useful utility for generating byte arrays with a known order.
public static  intgetTestVal(byte[] testArray)
    
public static  EnvironmentConfiginitEnvConfig()
     Called by each unit test to enforce isolation level settings specified in the isolationLevel system property.
public static  voidloadLog(Class cls, String resourceName, File envHome)
     Loads the given resource relative to the given class, and copies it to log file zero in the given directory.
public static  voidlogBINAndIN(Environment env, Cursor cursor)
     Logs the BIN at the cursor provisionally and the parent IN non-provisionally.
public static  longlogIN(Environment env, IN in, boolean provisional, IN parent)
     Logs the given IN.
public static  voidprintLatchCount(String msg)
    
public static  voidprintLatches(String msg)
    
public static  voidputUnsignedInt(byte[] buf, long value)
     Marshall an unsigned int (long) into a four byte buffer.
public static  voidremoveFiles(String msg, File envFile, String suffix)
    
public static  voidremoveFiles(String msg, File envFile, String suffix, boolean checkRemove)
    
public static  voidremoveFiles(File envFile, FilenameFilter filter)
     Remove files with the pattern indicated by the filename filter from the environment home directory.
public static  voidremoveLogFiles(String msg, File envFile, boolean checkRemove)
     Remove je log files from the home directory.
public static  booleanrunLongTests()
    
public static  voidsetRandomSeed(int seed)
    
public static  StringskipVersion(Exception e)
     Skip over the JE version number at the start of the exception message for tests which are looking for a specific message.
public static  longtallyNodeMemUsage(EnvironmentImpl envImpl)
    
public static  longvalidateNodeMemUsage(EnvironmentImpl envImpl, boolean assertOnError)
    

Field Detail
DEST_DIR
public static String DEST_DIR(Code)



FAST_STATS
final public static StatsConfig FAST_STATS(Code)



LOG_FILE_NAME
final public static String LOG_FILE_NAME(Code)



LONG_TEST
public static String LONG_TEST(Code)



NO_SYNC
public static String NO_SYNC(Code)





Method Detail
alphaKey
public static int alphaKey(int i)(Code)
Generate a synthetic base 26 four byte alpha key from an int. The bytes of the key are between 'A' and 'Z', inclusive. 0 maps to 'AAAA', 1 to 'AAAB', etc.



byteArrayCopy
public static byte[] byteArrayCopy(byte[] ba)(Code)
a copy of the passed in byte array



checkLatchCount
public static void checkLatchCount()(Code)



checkTreeDepth
public static boolean checkTreeDepth(Database db, int desiredDepth) throws DatabaseException(Code)
Assert if the tree is not this deep. Use to ensure that data setups are as expected.



clearIsolationLevel
public static void clearIsolationLevel(EnvironmentConfig config)(Code)
If a unit test needs to override the isolation level, it should call this method after calling initEnvConfig.



copyFiles
public static void copyFiles(File fromDir, File toDir) throws IOException(Code)
Copies all files in fromDir to toDir. Does not copy subdirectories.



debugMsg
public void debugMsg(String message)(Code)



dumpByteArray
public static String dumpByteArray(byte[] b)(Code)
length and data of a byte array, printed as decimal numbers



generateRandomAlphaBytes
public static void generateRandomAlphaBytes(byte[] bytes)(Code)



getBIN
public static BIN getBIN(Cursor cursor) throws DatabaseException(Code)
Returns the target BIN for the given cursor.



getIN
public static IN getIN(BIN bin) throws DatabaseException(Code)
Returns the parent IN of the given BIN.



getTestArray
public static byte[] getTestArray(int val)(Code)
Useful utility for generating byte arrays with a known order. Vary the length just to introduce more variability. a byte array of length val % 100 with the value of "val"



getTestVal
public static int getTestVal(byte[] testArray)(Code)
Return the value of a test data array generated with getTestArray as an int



initEnvConfig
public static EnvironmentConfig initEnvConfig()(Code)
Called by each unit test to enforce isolation level settings specified in the isolationLevel system property. Other system properties or default settings may be applied in the future.



loadLog
public static void loadLog(Class cls, String resourceName, File envHome) throws IOException(Code)
Loads the given resource relative to the given class, and copies it to log file zero in the given directory.



logBINAndIN
public static void logBINAndIN(Environment env, Cursor cursor) throws DatabaseException(Code)
Logs the BIN at the cursor provisionally and the parent IN non-provisionally. Used to simulate a partial checkpoint or eviction.



logIN
public static long logIN(Environment env, IN in, boolean provisional, IN parent) throws DatabaseException(Code)
Logs the given IN.



printLatchCount
public static void printLatchCount(String msg)(Code)



printLatches
public static void printLatches(String msg)(Code)



putUnsignedInt
public static void putUnsignedInt(byte[] buf, long value)(Code)
Marshall an unsigned int (long) into a four byte buffer.



removeFiles
public static void removeFiles(String msg, File envFile, String suffix) throws IOException(Code)
Remove files with this suffix from the je home directory
Parameters:
  msg - prefix to append to error messages
Parameters:
  envFile - environment directory
Parameters:
  suffix - files with this suffix will be removed



removeFiles
public static void removeFiles(String msg, File envFile, String suffix, boolean checkRemove) throws IOException(Code)
Remove files with this suffix from the je home directory
Parameters:
  msg - prefix to append to error messages
Parameters:
  envFile - environment directory
Parameters:
  suffix - files with this suffix will be removed
Parameters:
  checkRemove - if true, check the -DremoveLogFiles systemproperty before removing.



removeFiles
public static void removeFiles(File envFile, FilenameFilter filter) throws IOException(Code)
Remove files with the pattern indicated by the filename filter from the environment home directory. Note that BadFileFilter looks for this pattern: NNNNNNNN.bad.# InfoFileFilter looks for this pattern: je.info.#
Parameters:
  envFile - environment directory



removeLogFiles
public static void removeLogFiles(String msg, File envFile, boolean checkRemove) throws IOException(Code)
Remove je log files from the home directory. Will be disabled if the unit test is run with -DremoveLogFiles=false
Parameters:
  msg - prefix to append to error messages
Parameters:
  envFile - environment directory



runLongTests
public static boolean runLongTests()(Code)
true if long running tests are enabled.



setRandomSeed
public static void setRandomSeed(int seed)(Code)



skipVersion
public static String skipVersion(Exception e)(Code)
Skip over the JE version number at the start of the exception message for tests which are looking for a specific message.



tallyNodeMemUsage
public static long tallyNodeMemUsage(EnvironmentImpl envImpl) throws DatabaseException(Code)



validateNodeMemUsage
public static long validateNodeMemUsage(EnvironmentImpl envImpl, boolean assertOnError) throws DatabaseException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.