Source Code Cross Referenced for TestVersionCompatibility.java in  » JMX » je » com » sleepycat » persist » test » 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.persist.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*-
002:         * See the file LICENSE for redistribution information.
003:         *
004:         * Copyright (c) 2000,2008 Oracle.  All rights reserved.
005:         *
006:         * $Id: TestVersionCompatibility.java,v 1.1.2.5 2008/01/07 15:14:35 cwl Exp $
007:         */
008:        package com.sleepycat.persist.test;
009:
010:        import java.io.IOException;
011:        import java.util.Enumeration;
012:
013:        import junit.framework.Test;
014:        import junit.framework.TestSuite;
015:
016:        /**
017:         * Test that the catalog and data records created with a different version of
018:         * the DPL are compatible with this version.  This test is run as follows:
019:         *
020:         * 1) Run EvolveTest with version X of JE.  For example:
021:         *
022:         *    cd /jeX
023:         *    ant -Dtestcase=com.sleepycat.persist.test.EvolveTest test
024:         * or
025:         *    ant -Dsuite=persist/test test
026:         * or
027:         *    ant test
028:         *
029:         * Step (1) leaves the log files from all tests in the testevolve directory.
030:         *
031:         * 2) Run TestVersionCompatibility with version Y of JE, passing the JE
032:         * testevolve directory from step (1).  For example:
033:         *
034:         *    cd /jeY
035:         *    ant -Dtestcase=com.sleepycat.persist.test.TestVersionCompatibility \
036:         *        -Dunittest.testevolvedir=/jeX/build/test/testevolve \
037:         *        test
038:         *
039:         * Currently there are 2 sets of X and Y that can be tested, one set for the
040:         * CVS branch and one for the CVS trunk:
041:         *
042:         *  CVS     Version X   Version Y
043:         *  branch  je-3_2_56   je-3_2_57 or greater
044:         *  trunk   je-3_3_41   je-3_3_42 or greater 
045:         *
046:         * This test is not run along with the regular JE test suite run, because the
047:         * class name does not end with Test.  It must be run separately as described
048:         * above.
049:         *
050:         * @author Mark Hayes
051:         */
052:        public class TestVersionCompatibility extends EvolveTestBase {
053:
054:            public static Test suite() throws Exception {
055:
056:                /*
057:                 * Run TestVersionCompatibility tests first to check previously evolved
058:                 * data without changing it.  Then run the EvolveTest to try evolving
059:                 * it.
060:                 */
061:                TestSuite suite = new TestSuite();
062:                Enumeration e = getSuite(TestVersionCompatibility.class)
063:                        .tests();
064:                while (e.hasMoreElements()) {
065:                    EvolveTestBase test = (EvolveTestBase) e.nextElement();
066:                    if (test.getTestInitHome(true /*evolved*/).exists()) {
067:                        suite.addTest(test);
068:                    }
069:                }
070:                e = getSuite(EvolveTest.class).tests();
071:                while (e.hasMoreElements()) {
072:                    EvolveTestBase test = (EvolveTestBase) e.nextElement();
073:                    if (test.getTestInitHome(true /*evolved*/).exists()) {
074:                        suite.addTest(test);
075:                    }
076:                }
077:                return suite;
078:            }
079:
080:            boolean useEvolvedClass() {
081:                return true;
082:            }
083:
084:            @Override
085:            public void setUp() throws IOException {
086:
087:                envHome = getTestInitHome(true /*evolved*/);
088:            }
089:
090:            public void testPreviouslyEvolved() throws Exception {
091:
092:                /* If the store cannot be opened, this test is not appropriate. */
093:                if (caseObj.getStoreOpenException() != null) {
094:                    return;
095:                }
096:
097:                /* The update occurred previously. */
098:                caseObj.updated = true;
099:
100:                openEnv();
101:
102:                /* Open read-only and double check that everything is OK. */
103:                openStoreReadOnly();
104:                caseObj
105:                        .checkEvolvedModel(store.getModel(), env, true /*oldTypesExist*/);
106:                caseObj.readObjects(store, false /*doUpdate*/);
107:                caseObj
108:                        .checkEvolvedModel(store.getModel(), env, true /*oldTypesExist*/);
109:                closeStore();
110:
111:                /* Check raw objects. */
112:                openRawStore();
113:                caseObj
114:                        .checkEvolvedModel(rawStore.getModel(), env, true /*oldTypesExist*/);
115:                caseObj
116:                        .readRawObjects(rawStore, true /*expectEvolved*/, true /*expectUpdated*/);
117:                closeRawStore();
118:
119:                closeAll();
120:            }
121:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.