01: package com.sun.portal.fabric.upgrade.test;
02:
03: import junit.framework.*;
04: import com.sun.portal.fabric.upgrade.PSUpgrade;
05: import com.sun.portal.fabric.upgrade.PortalServerUpgrade;
06: import com.sun.portal.fabric.upgrade.PSUpgradeFactory;
07: import com.sun.portal.fabric.upgrade.UpgradeUtils;
08:
09: import java.io.File;
10:
11: public class PSUpgradeTest extends TestCase {
12: PSUpgrade psUpgrade;
13:
14: public PSUpgradeTest(String s) {
15: super (s);
16: }
17:
18: protected void setUp() {
19: // psUpgrade = (PSUpgrade)PSUpgradeFactory.getPSUpgradeImplInstance("6.3");
20: }
21:
22: protected void tearDown() {
23: }
24:
25: public void testCreateJESSilentInstallFile() throws Exception {
26: //assertEquals(2,3);
27: String s = "ak";
28: assertEquals("ak", s);
29: fail("Test is not implementedqw");
30: }
31:
32: public void testGenerateConfigFile() throws Exception {
33: fail("Test is not implemented");
34: }
35:
36: public void testResourceDir631() throws Exception {
37: System.out.println("Resource Directories for 6.3.1 : ");
38: String rd = UpgradeUtils.getResourceDir("6.3.1");
39: String rds[] = UpgradeUtils.getResourceDirs("6.3.1");
40: System.out.println("RESOURCE DIR=" + rd);
41: for (int i = 0; i < rds.length; i++)
42: System.out.println("RESOURCE DIRS[" + i + "]= " + rds[i]);
43: //fail("Test is not implemented");
44: }
45:
46: public void testResourceDir70() throws Exception {
47: System.out.println("Resource Directories for 7.0");
48: String rd = UpgradeUtils.getResourceDir("7.0");
49: String rds[] = UpgradeUtils.getResourceDirs("7.0");
50: System.out.println("RESOURCE DIR=" + rd);
51: for (int i = 0; i < rds.length; i++)
52: System.out.println("RESOURCE DIRS[" + i + "]= " + rds[i]);
53: //fail("Test is not implemented");
54: }
55:
56: /**
57: * Running this test case on PS6.3.x -->PS7.1 upgraded setup will verify that the updateSearch
58: * is functioning correctly.
59: * Steps to follow:
60: * 1. ln -s /var/opt/SUNWportal/searchservers/UpgradeSearch/conf/SearchLogConfig.properties /var/opt/SUNWps.bak/https-<serverinstance>/portal/config
61: * 2. Index sample docs on old portal with
62: * /var/opt/SUNWportal/searchservers/UpgradeSearch/run-cs-cli rdmgr -c /var/opt/SUNWps.bak/https-<serverinstance>/portal/config/search.conf -y discussion /opt/SUNWps.bak/samples/discussions/discussions.soif
63: * /var/opt/SUNWportal/searchservers/UpgradeSearch/run-cs-cli rdmgr -c /var/opt/SUNWps.bak/https-<serverinstance>/portal/config/search.conf -y discussion /opt/SUNWps.bak/samples/search/ps-help.soif
64: * At this point you should have content in the old portal
65: * 3. clean up the taxonomy and reindexing portal template taxonomy
66: * cp /var/opt/SUNWportal/searchservers/UpgradedSearch/config/taxonomy.rdm /var/opt/SUNWportal/searchservers/UpgradedSearch/config/taxonomy.rdm.$$
67: * /var/opt/SUNWps/searchservers/search1/run-cs-cli rdmgr -TI
68: * 4. clean up the existing DBs
69: * For each DB $DBNAME(Exclude DB named "root")
70: * /var/opt/SUNWps/searchservers/search1/run-cs-cli rdmgr -X -y $DBNAME
71: * At this point upgraded search DBs should be empty.
72: * Try the following for each DB (Exclude DB named "root")
73: * /var/opt/SUNWps/searchservers/search1/run-cs-cli rdmgr -U -y $DBNAME
74: * You shoud see nothing back.
75: * /var/opt/SUNWps/searchservers/search1/run-cs-cli rdmgr -n -y $DBNAME
76: * You should get 0 RDs
77: * Finally Run this unit test from ps/fabric directory.
78: * ant upgrade-test -lib /share/builds/components/junit/3.8.1/junit.jar:/share/builds/components/jdom/1.0/build/jdom.jar:../admin/lib/ps_util.jar
79: * Repeat the content verification steps just above :
80: * For ex: you should get 73 RDs for
81: * /var/opt/SUNWps/searchservers/UpgradedSearch/run-cs-cli rdmgr -n -y default
82: */
83: public void testUpdateSearchPS631() throws Exception {
84: PSUpgrade ps = new PSUpgrade("6.3.1");
85: String PS_DATA_DIR_OLD = "/var/opt/SUNWps";//Change the value accd to your actual installation.
86: String fs = File.separator;
87: String PS_DEPLOY_INSTANCE = "<PS_Server_Instance_name>"; //"xyz.abc.com";
88: String PS_70_DATA_DIR = "/var/opt/SUNWportal";
89: ps.updateSearch(PS_DATA_DIR_OLD + fs + "https-"
90: + PS_DEPLOY_INSTANCE + fs + "portal", PS_70_DATA_DIR
91: + fs + "searchservers" + fs + "UpgradedSearch");
92:
93: }
94: }
|