Ejemplo n.º 1
0
 public virtual Configuration.ConnectionStringSettings GetConnectionStringSettingsForProvider(AstoriaWebDataService service, string databaseConnectionString)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 2
0
        public override System.Configuration.ConnectionStringSettings GetConnectionStringSettingsForProvider(AstoriaWebDataService service, string databaseConnectionString)
        {
 	        return new System.Configuration.ConnectionStringSettings(this.ContextTypeName, databaseConnectionString, "System.Data.SqlClient");
        }
Ejemplo n.º 3
0
        public static AstoriaWebDataService CreateAstoriaDataWebService(Workspace workspace, string webDataServicePrefixName, AstoriaDatabase database, bool skipDataServiceVerify)
        {
            AstoriaWebDataService service = null;

            //Base the creation on the AstoriaTestProperties
            switch (AstoriaTestProperties.Host)
            {
            case Host.WebServiceHost:
            case Host.IDSH:
            case Host.IDSH2:
                service = new AstoriaServiceHost(workspace, webDataServicePrefixName, Environment.MachineName, database);
                break;

            case Host.WebServiceHostRemote:
                service = new AstoriaServiceHost(workspace, webDataServicePrefixName, GetMachineName(), database);
                break;

            default:
                service = new IISWebDataService(workspace, webDataServicePrefixName, GetMachineName(), database);
                break;
            }

            // write out helpful debugging URIs
            if (AstoriaTestProperties.Client == ClientEnum.SILVERLIGHT)
            {
                WriteUriToList(service.ServiceRootUri + "Monitor.aspx");
                WriteUriToList(service.ServiceRootUri + "SilverlightAstoriaTestPage.html");
                WriteUriToList(service.ServiceUri);
            }

            // if running locally in partial trust, ensure that the trusted methods are available
            if (AstoriaTestProperties.IsLocalHost &&
                AstoriaTestProperties.ServiceTrustLevel != TrustLevel.Full &&
                AstoriaTestProperties.RuntimeEnvironment == TestRuntimeEnvironment.Lab)
            {
                Assembly trustedAssembly = typeof(FullTrust.TrustedMethods).Assembly;
                //if (!trustedAssembly.GlobalAssemblyCache)
                //{
                //    AstoriaTestLog.FailAndThrow("Assembly containing fully trusted components must be in the GAC. " +
                //        "Run 'gacutil -if <dll>' on AstoriaTestFramework.FullTrust from a visual studio command prompt");
                //}

                if (!trustedAssembly.IsFullyTrusted)
                {
                    AstoriaTestLog.FailAndThrow("Assembly containing components requiring full trust is not trusted");
                }
            }

            try
            {
                // push the verification step down to the derived classes so that a failure there can be handled accordingly
                //
                service.CreateWebService(!skipDataServiceVerify);
            }
            catch (Exception e)
            {
                // we need to make sure that we don't 'leak' services that fail to start, as it can mean a process is left running that will
                // cause subsequent ArtClean's to fail. This has caused build failures at least once.
                //
                if (AstoriaTestProperties.IsLabRun || AstoriaTestProperties.RuntimeEnvironment == TestRuntimeEnvironment.CheckinSuites)
                {
                    service.Dispose();
                }
                throw new TestFailedException("Failed to create web service", null, null, e);
            }

            if (skipDataServiceVerify)
            {
                // for call logging, we need the directory to exist, and the service doesn't necessarily have permission to create it
                // TODO: find some better, common place to put this for IIS, WebServiceHost, etc. Right now this is the best spot
#if !ClientSKUFramework
                IOUtil.EnsureEmptyDirectoryExists(Path.Combine(service.DestinationFolder, CallOrder.APICallLog.DirectoryName));
#endif

                Thread.Sleep(5000);     //To allow time for the service to start running before requests get made
            }

            return(service);
        }
Ejemplo n.º 4
0
 public static AstoriaWebDataService CreateAstoriaDataWebService(Workspace workspace)
 {
     return(AstoriaWebDataService.CreateAstoriaDataWebService(workspace, workspace.WebServiceName, workspace.Database, workspace.Settings.SkipWorkspaceCheck));
 }
Ejemplo n.º 5
0
 public ConfigurationSettings(AstoriaWebDataService dataService)
 {
     _dataService            = dataService;
     this.maxProtocolVersion = dataService.Workspace.Settings.MaxProtocolVersion;
 }
Ejemplo n.º 6
0
        public override System.Configuration.ConnectionStringSettings GetConnectionStringSettingsForProvider(AstoriaWebDataService service, string databaseConnectionString)
        {
            string binFolder = Path.Combine(service.DestinationFolder_Local, "bin");

            if (this.Name == "Northwind" && AstoriaTestProperties.EdmObjectLayer == ServiceEdmObjectLayer.MultiNamespaces)
            {
                return new System.Configuration.ConnectionStringSettings(this.ContextTypeName,
                    "metadata=" + string.Join("|", new string[]
                        {
                            Path.Combine(binFolder, CsdlFileOutputFileName),
                            Path.Combine(binFolder, "Northwind_ext.csdl"),
                            Path.Combine(binFolder, SsdlFileOutputFileName),
                            Path.Combine(binFolder, MslFileOutputFileName)
                        }) + ";" +
                    "provider=System.Data.SqlClient;provider connection string=\"" + databaseConnectionString + "\"",
                    "System.Data.EntityClient");
            }

            return new System.Configuration.ConnectionStringSettings(this.ContextTypeName,
                "metadata=" + string.Join("|", new string[]
                    {
                        Path.Combine(binFolder, CsdlFileOutputFileName),
                        Path.Combine(binFolder, SsdlFileOutputFileName),
                        Path.Combine(binFolder, MslFileOutputFileName)
                    }) + ";" +
                "provider=System.Data.SqlClient;provider connection string=\"" + databaseConnectionString + "\"",
                "System.Data.EntityClient");
        }
 public ConfigurationSettings(AstoriaWebDataService dataService)
 {
     _dataService = dataService;
     this.maxProtocolVersion = dataService.Workspace.Settings.MaxProtocolVersion;
 }