Example #1
0
        // This constructor is needed for API level tests.
        public MockConnection(string siteId, string protocol, bool updateRpc = false) : base(null)
        {
            this.DataSource          = new DataSource();
            this.DataSource.SiteId   = new SiteId(siteId, "Mock");
            this.DataSource.Protocol = protocol;

            //DP 3/24/2011
            //I commented out the line below, the pid should not be set to
            //"0" as the default, as all of the other subclasses of
            //AbstractCollection do not set it.  This was causing conflicts
            //b/w the MockConnection.XML file and the DaoX tests.

            //I will fix the affected tests (14 now fail as the exception
            //message has changed).

            //this.Pid = "0";

            setXmlSource(siteId, updateRpc);

            this.Account   = new VistaAccount(this);
            this.updateRpc = updateRpc;

            AbstractCredentials credentials = new VistaCredentials();

            credentials.AccountName     = "AccessCode";
            credentials.AccountPassword = "******";
            AbstractPermission permission = new MenuOption(VistaConstants.MDWS_CONTEXT);

            permission.IsPrimary = true;
            this.Account.Permissions.Add(permission.Name, permission);
            //permission = new MenuOption(VistaConstants.DDR_CONTEXT);
            //this.Account.Permissions.Add(permission.Name, permission);
            sysFileHandler = new VistaSystemFileHandler(this);
        }
Example #2
0
 public VistaConnection(DataSource dataSource) : base(dataSource)
 {
     Account = new VistaAccount(this);
     if (ConnectTimeout == 0)
     {
         ConnectTimeout = CONNECTION_TIMEOUT;
     }
     if (ReadTimeout == 0)
     {
         ReadTimeout = READ_TIMEOUT;
     }
     port           = (dataSource.Port == 0) ? DEFAULT_PORT : dataSource.Port;
     sysFileHandler = new VistaSystemFileHandler(this);
 }
 public VistaConnection(DataSource dataSource)
     : base(dataSource)
 {
     Account = new VistaAccount(this);
     if (ConnectTimeout == 0)
     {
         ConnectTimeout = CONNECTION_TIMEOUT;
     }
     if (ReadTimeout == 0)
     {
         ReadTimeout = READ_TIMEOUT;
     }
     port = (dataSource.Port == 0) ? DEFAULT_PORT : dataSource.Port;
     sysFileHandler = new VistaSystemFileHandler(this);
 }
Example #4
0
        // This constructor is needed for API level tests.
        public MockConnection(string siteId, string protocol, bool updateRpc = false)
            : base(null)
        {
            this.DataSource = new DataSource();
            this.DataSource.SiteId = new SiteId(siteId, "Mock");
            this.DataSource.Protocol = protocol;

            //DP 3/24/2011
            //I commented out the line below, the pid should not be set to
            //"0" as the default, as all of the other subclasses of
            //AbstractCollection do not set it.  This was causing conflicts
            //b/w the MockConnection.XML file and the DaoX tests.

            //I will fix the affected tests (14 now fail as the exception
            //message has changed).

            //this.Pid = "0";

            setXmlSource(siteId, updateRpc);

            this.Account = new VistaAccount(this);
            this.updateRpc = updateRpc;

            AbstractCredentials credentials = new VistaCredentials();
            credentials.AccountName = "AccessCode";
            credentials.AccountPassword = "******";
            AbstractPermission permission = new MenuOption(VistaConstants.MDWS_CONTEXT);
            permission.IsPrimary = true;
            this.Account.Permissions.Add(permission.Name, permission);
            //permission = new MenuOption(VistaConstants.DDR_CONTEXT);
            //this.Account.Permissions.Add(permission.Name, permission);
            sysFileHandler = new VistaSystemFileHandler(this);
        }