1 package org.apache.jcs.auxiliary.disk.jdbc.mysql;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.jcs.auxiliary.disk.jdbc.TableState;
23
24 import junit.framework.TestCase;
25
26 /***
27 * Hand run tests for the MySQL table optimizer.
28 * <p>
29 * @author Aaron Smuts
30 */
31 public class MySQLTableOptimizerManualTester
32 extends TestCase
33 {
34
35 /***
36 * Run the optimization against live a table.
37 */
38 public void testBasicOptimization()
39 {
40 MySQLDiskCacheAttributes attributes = new MySQLDiskCacheAttributes();
41 attributes.setUserName( "java" );
42 attributes.setPassword( "letmein" );
43 attributes.setUrl( "jdbc:mysql://10.19.98.43:3306/flight_option_cache" );
44 attributes.setDriverClassName( "org.gjt.mm.mysql.Driver" );
45 String tableName = "JCS_STORE_FLIGHT_OPTION_ITINERARY";
46 attributes.setTableName( tableName );
47 TableState tableState = new TableState( tableName);
48
49 MySQLTableOptimizer optimizer = new MySQLTableOptimizer( attributes, tableState );
50
51 optimizer.optimizeTable();
52 }
53
54 /***
55 * Run the optimization against live a table.
56 */
57 public void testBasicOptimizationUnknownTable()
58 {
59 MySQLDiskCacheAttributes attributes = new MySQLDiskCacheAttributes();
60 attributes.setUserName( "java" );
61 attributes.setPassword( "letmein" );
62 attributes.setUrl( "jdbc:mysql://10.19.98.43:3306/flight_option_cache" );
63 attributes.setDriverClassName( "org.gjt.mm.mysql.Driver" );
64 String tableName = "DOESNTEXIST";
65 attributes.setTableName( tableName );
66 TableState tableState = new TableState( tableName);
67
68 MySQLTableOptimizer optimizer = new MySQLTableOptimizer( attributes, tableState );
69
70 optimizer.optimizeTable();
71 }
72
73 }