nesstar.test.functional
Class ACUTestBase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by nesstar.test.NesstarTestCase
              extended by nesstar.test.functional.ACUTestBase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ACUTest, HCACUTest

public class ACUTestBase
extends NesstarTestCase

A test class for the Nesstar ACU.


Field Summary
static String CUBE_TO_PUBLISH
           
static String DEFAULT_EXTENSION
           
static String DEFAULT_POLICY
           
static String EXT_SERVER_PATH
           
static String OLD_DEFAULT_POLICY
           
 String POLICY_ACU_FILE
           
static String TEST_ACUEXT_5
           
static String TEST_DEFAULT_POLICY_1
           
static String TEST_DEFAULT_POLICY_2
           
static String TEST_DEFAULT_POLICY_3
           
static String TEST_POLICY_1
           
static String TEST_POLICY_2
           
static String TEST_POLICY_3
           
static String TEST_POLICY_4
           
static String TEST_POLICY_5
           
static String TEST_POLICY_6
           
static String TEST_POLICY_7
           
static String TEST_POLICY_8
           
 
Fields inherited from class nesstar.test.NesstarTestCase
ALL, CATALOG_HOME, CUBE_CUBE, DATAFILE_2568_F1, DATAFILE_4176_F1, DATAFILE_4213_F1, DATAFILE_44871_F1, DATAFILE_Cube_C1, DATAFILE_Mergetest_F2, DATAFILE_UnpopulatedElementsTest_F1, emWindow, HC_VAR_HOME, ID_2568, ID_2981, ID_3690, ID_4176, ID_4213, ID_4396, ID_44871, ID_4638, ID_CAMEROON, ID_CIRCULATORY, ID_CUBE, ID_HIERARCHY, ID_LANDET, ID_MERGE, ID_NOGROUPS, ID_NSD50, ID_PUBLISH, ID_UPElements, LICENSE, localIP, NESSTAR2_SERVER_URL, NESSTAR2_URL, NONE, ROOT_CATALOG, SECTION_MERGE_VG10, SECTION_MERGE_VG7, SECTION_MERGE_VG8, SERVER, SOME, SPSS_FORMAT, STAT_ENGINE, STATEMENT_HOME, STATEMENT1, STUDY_2568, STUDY_2981, STUDY_4176, STUDY_4213, STUDY_44871, STUDY_CAMEROON, STUDY_CIRCULATORY, STUDY_CUBE, STUDY_HIERARCHY, STUDY_HOME, STUDY_LANDET, STUDY_MERGE, STUDY_NOGROUPS, STUDY_NSD50, STUDY_UPElements, STUDY2_2568, STUDY2_4638, STUDY2_UPElements, TEST_PROTOCOL, VAR_HOME, VARIABLE_2568_V1, VARIABLE_2568_V13, VARIABLE_2568_V16, VARIABLE_2568_V17, VARIABLE_2568_V18, VARIABLE_2568_V3, VARIABLE_2568_V354, VARIABLE_2568_V77, VARIABLE_44871_V1, VARIABLE_CAMEROON_V238, VARIABLE_CAMEROON_V355, VARIABLE_LANDET_V1, VARIABLE_LANDET_V2, VARIABLE_MERGE_V22, VARIABLE_MERGE_V23, VARIABLE_MERGE_V26, VARIABLE_MERGE_V41, VID_2568_V1, VID_2568_V13, VID_2568_V16, VID_2568_V17, VID_2568_V18, VID_2568_V3, VID_2568_V354, VID_2568_V77, VID_44871_V1, VID_CAMEROON_V238, VID_CAMEROON_V355, VID_LANDET_V1, VID_LANDET_V2, VID_MERGE_V22, VID_MERGE_V23, VID_MERGE_V26, VID_MERGE_V41, WebDataURL
 
Constructor Summary
ACUTestBase(String testName)
          Constructor for the ACUTestBase object
 
Method Summary
 void assertAccessDenied(String message, Object msg)
          assert access denied to a method
static void cancel(com.meterware.httpunit.WebConversation web, com.meterware.httpunit.WebResponse resp)
           
 void checkPolicy(String policy)
           
 boolean compare(File policy)
           
static boolean compare(File file_a, File file_b)
           
static void err(Throwable ex)
           
 String Frequency(Study st, int v)
           
static CubeHome getCubeHome()
           
 String GetDDISkeleton(Study st)
           
 String getObjects(Vector objs)
           
 String[] getPolicyFromReport()
           
 String getPolicyName(File policy)
           
 boolean isAccessDenied(Object msg)
          check if access to a method is denied
static boolean isAgreement(com.meterware.httpunit.WebResponse resp)
           
static boolean isChallenge(com.meterware.httpunit.WebResponse resp)
           
static boolean isLogin(com.meterware.httpunit.WebResponse resp)
           
static boolean isSetProject(com.meterware.httpunit.WebResponse resp)
           
static boolean isSetRole(com.meterware.httpunit.WebResponse resp)
           
static com.meterware.httpunit.WebResponse login(com.meterware.httpunit.WebConversation web, com.meterware.httpunit.WebResponse resp, String username, String password)
           
static void main(String[] args)
          The main program for the ACUTestBase class
 int saveFile(String server_path, File file)
          Save a file on the server and check it.
 void setUpDatabase(String[] command)
           
 String Subset(Study st)
           
 String Subset(Study st, int v)
           
 String Subset(Study st, int v, int v1)
           
 String SubsetByName(Study st, int v)
           
static junit.framework.Test suite()
          Return the suite of all tests of this class *
 String Tabulation(Study st, int v)
           
 void testBasicSetup()
           
 void testCancel()
           
 void testCatalog()
          tests performed and challenge, if any: Query RemoveDataset --> Login --> Cancel
 void testLoadDefaultPolicy()
          load the default policy in the server
 void testRestoreDatabase()
           
 void testRestoreUsers()
           
 void testServer()
          tests performed and challenge, if any: GetReport --> Login GetServerHome GetFile --> Login
 void testUpgradeUsers()
           
 void testUser()
          A unit test for User UserHome.findAll UserHome.findByKey User.ChangePassword
 void updateDatabasePolicy_7()
           
 void updateDatabaseStatement()
           
 void updateDatabaseStatement(String subejct, String subejcttype, String object, String objecttype, int index)
           
 void updateServer(File zip)
          update the server
 void updateServerPolicy(File policy)
           
 void updateServerPolicy(File policy, File ext)
          save a new policy.acu in the server config directory and reboot
 void updateServerPolicy(File policy, File ext, boolean clean)
          save a new policy.acu in the server config directory and reboot
 void updateServerPolicy(File policy, int repetition)
           
 void updateServerPolicy(File policy, int repetition, File ext)
          update the server with a new policy and extension
 void updateServerPolicy(File policy, int repetition, File ext, boolean clean)
          update the server with a new policy and extension
 
Methods inherited from class nesstar.test.NesstarTestCase
addAllTests, addAllTests, addDatafile, addPath, adminLogin, assertBinary, assertContains, assertContains, assertDoesNotContain, assertDoesNotContain, assertDuration, assertEqualIgnoreOrder, assertEquals, assertMatches, assertMatches, assertNoAccess, assertNoAccess, assertNoAccess, assertNotEquals, assertNotEquals, assertObjDoesNotExists, assertObjDoesNotExists, assertObjExists, assertObjExists, assertWebAuthorisationRequired, assertWebAuthorisationRequired, basicSetup, cannotRun, catalogSetup, checkIllegalArgument, checkPaths, checkPathsTo, checkPathsTo, checkPerformance, compareWithFile, compareWithReferenceFile, compareWithTestFile, compareWithTestFile, createDerivedVariable, createDerivedVariable, createDerivedVariableUnprotected, cubeSetup, cvsAbstractName, cvsClientSetup, cvsCompare, cvsCompare, cvsFailIfDifferent, cvsFailIfDifferent, cvsFileRevision, cvsFileRevisions, cvsRootDir, dependsOn, dependsOn, equalToFile, equalToTestFile, equalToTestFile, executeRangeQuery, executeRangeQuery, executeRangeQuery, executeRangeQueryAdditivity, expectFalse, expectTrue, extractZipFile, factsheetSetup, findPosition, flirtWithTestFile, getBrowserPage, getBrowserPage, getCatalog, getCategoryStatistic, getCategoryStatisticFromVariable, getConcept, getCurrentBrowserPage, getCvsPropertiesFile, getDatafile, getDDITestFile, getDDITestFileContents, getDerivedVariableByName, getDimension, getDimensionFromCube, getEGMSResource, getEGMSResource2, getEvent, getExisting, getFailedDir, getFailedFile, getFilenames, getFilteredTestFile, getGeographicalUnit, getLocalFile, getMaxConcurrentOps, getMeasure, getNumberCompletedOps, getNumberHTTPConnections, getNumberStartedOps, getObj, getObjectsFrom, getObjURL, getOrganisation, getPage, getPage, getPartsOf, getPartsOf, getPartsOf, getPerson, getRawPage, getRDF, getReport, getResultDir, getResultFile, getSecureObjURL, getSecureServerURL, getServerDataDir, getServerDatafile, getServerIP, getServerLog, getServerName, getServerObjURL, getServerPage, getServerPageURL, getServerPassword, getServerPort, getServerSecurePort, getServerURL, getServerUsername, getStatementsOn, getStatementsOn, getTableFromStudy, getTerm, getTestDir, getTestFile, getTestFile, getVariable, getVariableFromStudy, getWebFile, getZipFile, hasWebData, HCSetup, isLocalServer, isNTService, isOnline, isQuickie, isReleaseTest, isWaitForSQLServerIndexer, loadCube, loadDDI, loadHashFromFile, loadStudy, loadStudy3, loadVariable, msg, msg, noDirectAccess, objExists, objsExists, openEMWindow, performRangeQuery, querySetup, read, rebootServer, rebootServer, reloadObj, removeAllVars, removeCreationDate, removeProperties, removeServerURL, repeatCheck, saveToTestFile, setNTService, setQuickie, setReleaseTest, setWaitForSQLServerIndexer, statementSetup, studyCleanup, studySetup, tableSetup, toMsg, toString, untested, updateChildren, variableSetup, waitForSQLServerIndexer, waitServer, warn, webclientSetup, write, xthesaurusSetup
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POLICY_ACU_FILE

public final String POLICY_ACU_FILE

EXT_SERVER_PATH

public static final String EXT_SERVER_PATH

DEFAULT_POLICY

public static final String DEFAULT_POLICY

DEFAULT_EXTENSION

public static final String DEFAULT_EXTENSION
See Also:
Constant Field Values

TEST_DEFAULT_POLICY_1

public static final String TEST_DEFAULT_POLICY_1

TEST_DEFAULT_POLICY_2

public static final String TEST_DEFAULT_POLICY_2

TEST_DEFAULT_POLICY_3

public static final String TEST_DEFAULT_POLICY_3

OLD_DEFAULT_POLICY

public static final String OLD_DEFAULT_POLICY
See Also:
Constant Field Values

TEST_POLICY_1

public static final String TEST_POLICY_1
See Also:
Constant Field Values

TEST_POLICY_2

public static final String TEST_POLICY_2
See Also:
Constant Field Values

TEST_POLICY_3

public static final String TEST_POLICY_3
See Also:
Constant Field Values

TEST_POLICY_4

public static final String TEST_POLICY_4
See Also:
Constant Field Values

TEST_POLICY_5

public static final String TEST_POLICY_5
See Also:
Constant Field Values

TEST_POLICY_6

public static final String TEST_POLICY_6
See Also:
Constant Field Values

TEST_POLICY_7

public static final String TEST_POLICY_7
See Also:
Constant Field Values

TEST_POLICY_8

public static final String TEST_POLICY_8
See Also:
Constant Field Values

TEST_ACUEXT_5

public static final String TEST_ACUEXT_5
See Also:
Constant Field Values

CUBE_TO_PUBLISH

public static final String CUBE_TO_PUBLISH
See Also:
Constant Field Values
Constructor Detail

ACUTestBase

public ACUTestBase(String testName)
Constructor for the ACUTestBase object

Parameters:
testName -
Method Detail

isChallenge

public static boolean isChallenge(com.meterware.httpunit.WebResponse resp)
                           throws Exception
Throws:
Exception

isLogin

public static boolean isLogin(com.meterware.httpunit.WebResponse resp)
                       throws Exception
Throws:
Exception

isAgreement

public static boolean isAgreement(com.meterware.httpunit.WebResponse resp)
                           throws Exception
Throws:
Exception

isSetRole

public static boolean isSetRole(com.meterware.httpunit.WebResponse resp)
                         throws Exception
Throws:
Exception

isSetProject

public static boolean isSetProject(com.meterware.httpunit.WebResponse resp)
                            throws Exception
Throws:
Exception

main

public static void main(String[] args)
The main program for the ACUTestBase class

Parameters:
args - The command line arguments

suite

public static junit.framework.Test suite()
Return the suite of all tests of this class *

Returns:
The test suite

login

public static com.meterware.httpunit.WebResponse login(com.meterware.httpunit.WebConversation web,
                                                       com.meterware.httpunit.WebResponse resp,
                                                       String username,
                                                       String password)
                                                throws Exception
Throws:
Exception

cancel

public static void cancel(com.meterware.httpunit.WebConversation web,
                          com.meterware.httpunit.WebResponse resp)

getPolicyFromReport

public String[] getPolicyFromReport()
                             throws Exception
Throws:
Exception

getPolicyName

public String getPolicyName(File policy)
                     throws Exception
Throws:
Exception

compare

public boolean compare(File policy)
                throws Exception
Throws:
Exception

updateServerPolicy

public void updateServerPolicy(File policy,
                               File ext,
                               boolean clean)
                        throws Exception
save a new policy.acu in the server config directory and reboot

Parameters:
policy -
Throws:
Exception

updateServerPolicy

public void updateServerPolicy(File policy,
                               File ext)
                        throws Exception
save a new policy.acu in the server config directory and reboot

Parameters:
policy -
Throws:
Exception

updateServerPolicy

public void updateServerPolicy(File policy)
                        throws Exception
Throws:
Exception

updateServerPolicy

public void updateServerPolicy(File policy,
                               int repetition)
                        throws Exception
Throws:
Exception

updateServerPolicy

public void updateServerPolicy(File policy,
                               int repetition,
                               File ext)
                        throws Exception
update the server with a new policy and extension

Parameters:
policy - the new policy to be loaded in the server
repetition - the number of reboot to be repeated
ext - the extension file to be updated
Throws:
Exception

updateServerPolicy

public void updateServerPolicy(File policy,
                               int repetition,
                               File ext,
                               boolean clean)
                        throws Exception
update the server with a new policy and extension

Parameters:
policy - the new policy to be loaded in the server
repetition - the number of reboot to be repeated
ext - the extension file to be updated
Throws:
Exception

updateServer

public void updateServer(File zip)
                  throws Exception
update the server

Parameters:
zip - the zip file containing the files to be updated
Throws:
Exception

saveFile

public int saveFile(String server_path,
                    File file)
             throws Exception
Save a file on the server and check it.

Parameters:
server_path - the path on the server
file - the file to be saved
Returns:
NO_UPDATE if the file was already on the server, UPDATE on the contrary
Throws:
Exception

testLoadDefaultPolicy

public void testLoadDefaultPolicy()
                           throws Exception
load the default policy in the server

Throws:
Exception

testBasicSetup

public void testBasicSetup()
                    throws Exception
Throws:
Exception

testServer

public void testServer()
                throws Exception
tests performed and challenge, if any: GetReport --> Login GetServerHome GetFile --> Login

Throws:
Exception

testCatalog

public void testCatalog()
                 throws Exception
tests performed and challenge, if any: Query RemoveDataset --> Login --> Cancel

Throws:
Exception

testCancel

public void testCancel()
                throws Exception
Throws:
Exception

testUser

public void testUser()
              throws Exception
A unit test for User UserHome.findAll UserHome.findByKey User.ChangePassword

Throws:
Exception

isAccessDenied

public boolean isAccessDenied(Object msg)
                       throws Exception
check if access to a method is denied

Throws:
Exception

assertAccessDenied

public void assertAccessDenied(String message,
                               Object msg)
                        throws Exception
assert access denied to a method

Throws:
Exception

GetDDISkeleton

public String GetDDISkeleton(Study st)
                      throws Exception
Throws:
Exception

Frequency

public String Frequency(Study st,
                        int v)
                 throws Exception
Throws:
Exception

Tabulation

public String Tabulation(Study st,
                         int v)
                  throws Exception
Throws:
Exception

Subset

public String Subset(Study st,
                     int v)
              throws Exception
Throws:
Exception

Subset

public String Subset(Study st,
                     int v,
                     int v1)
              throws Exception
Throws:
Exception

Subset

public String Subset(Study st)
              throws Exception
Throws:
Exception

SubsetByName

public String SubsetByName(Study st,
                           int v)
                    throws Exception
Throws:
Exception

compare

public static boolean compare(File file_a,
                              File file_b)
                       throws Exception
Throws:
Exception

getObjects

public String getObjects(Vector objs)

setUpDatabase

public void setUpDatabase(String[] command)
                   throws Exception
Throws:
Exception

getCubeHome

public static CubeHome getCubeHome()
                            throws Exception
Throws:
Exception

checkPolicy

public void checkPolicy(String policy)
                 throws Exception
Throws:
Exception

testRestoreDatabase

public void testRestoreDatabase()
                         throws Exception
Throws:
Exception

updateDatabasePolicy_7

public void updateDatabasePolicy_7()
                            throws Exception
Throws:
Exception

updateDatabaseStatement

public void updateDatabaseStatement(String subejct,
                                    String subejcttype,
                                    String object,
                                    String objecttype,
                                    int index)
                             throws Exception
Throws:
Exception

updateDatabaseStatement

public void updateDatabaseStatement()
                             throws Exception
Throws:
Exception

testUpgradeUsers

public void testUpgradeUsers()
                      throws Exception
Throws:
Exception

testRestoreUsers

public void testRestoreUsers()
                      throws Exception
Throws:
Exception

err

public static void err(Throwable ex)

Nesstar SDK

Copyright©2003 NSD - All Rights Reserved