public void Upgrade() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments += " -buildwsp false -install " + PACKAGENAME; wspBuilder.Build(); string packageFullname = wspBuilder.ProjectPath + @"\" + PACKAGENAME; Assert.IsTrue(Installer.IsAlreadyInstalledByPackage(packageFullname), "The package is not installed into sharepoint"); }
public void Build() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments = @" -cleanup false"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); }
public void Build() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); Assert.IsNotNull(manifestHandler.Manifest.Assemblies); Assert.IsNotNull(manifestHandler.Manifest.Assemblies[0].SafeControls); }
public void Uninstall() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); string packageFullname = wspBuilder.ProjectPath + @"\" + PACKAGENAME; if (!Installer.IsAlreadyInstalledByPackage(packageFullname)) { this.Install(); } wspBuilder.Arguments += " -buildwsp false -uninstall " + PACKAGENAME; wspBuilder.Build(); Assert.IsFalse(Installer.IsAlreadyInstalledByPackage(packageFullname), "The package is still installed in the sharepoint server."); }
public void Retract() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); string packageFullname = wspBuilder.ProjectPath + @"\" + PACKAGENAME; if (!Installer.IsAlreadyInstalledByPackage(packageFullname)) { this.Deploy(); } wspBuilder.Arguments += " -buildwsp false -retract true -wspname " + PACKAGENAME; wspBuilder.Build(); Assert.IsTrue(Installer.IsAlreadyInstalledByPackage(packageFullname), "The package is not installed into sharepoint"); }
public void ShowHelp() { // Setup WSPBuilderHandler wspBuilder = new WSPBuilderHandler(""); wspBuilder.Arguments = "-help"; // Run int error = wspBuilder.Build(); // Run First test //string[] args = new string[] { "help" }; //int error = wspBuilder.BuildCommand(args); // Test Assert.IsTrue(error == 0); }
public void AssemblyFullName() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments = @" -cleanup false -projectassembly ""GAC\\Dummy.dll"""; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); //ManifestHandler manifestHandler = new ManifestHandler(filename); //AssemblyFileReference[] assemblies = manifestHandler.Manifest.Assemblies; //Assert.IsNotNull(assemblies); //Assert.IsTrue(DoMultiAssemblyExists(assemblies, @"Dummy.DLL") == 1, "There can not be more than one assembly in the same folder!"); }
public void Build() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments = "-createfolders true"; wspBuilder.Build(); string folder12Path = wspBuilder.ProjectPath + @"\12"; string folder80Path = wspBuilder.ProjectPath + @"\80"; string folderGACPath = wspBuilder.ProjectPath + @"\GAC"; string folderTemplatePath = folder12Path + @"\Template"; Assert.IsTrue(Directory.Exists(folder12Path)); Assert.IsTrue(Directory.Exists(folder80Path)); Assert.IsTrue(Directory.Exists(folderGACPath)); Assert.IsTrue(Directory.Exists(folderTemplatePath)); }
public void Build() { // Setup WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); // Run wspBuilder.Build(); // Test string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); Assert.AreEqual("TitleTest", manifestHandler.Manifest.Title); Assert.AreEqual("DescriptionTest", manifestHandler.Manifest.Description); Assert.AreEqual("Dummy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5", manifestHandler.Manifest.ReceiverAssembly); Assert.AreEqual("Keutmann.Demo.Dummy.DummyControl", manifestHandler.Manifest.ReceiverClass); Assert.AreEqual(ResetWebServerModeOnUpgradeAttr.Recycle, manifestHandler.Manifest.ResetWebServerModeOnUpgrade); Assert.IsNotNull(manifestHandler.Manifest.Assemblies); Assert.AreEqual(manifestHandler.Manifest.Assemblies.Length, 1); Assert.IsNotNull(manifestHandler.Manifest.Assemblies[0].BindingRedirects); Assert.AreEqual(manifestHandler.Manifest.Assemblies[0].BindingRedirects.Length, 3); //int countWPResources = 0; //int countGlobalResouces = 0; //ApplicationResourceFileDefinitions defs = manifestHandler.Manifest.ApplicationResourceFiles; //foreach (object item in defs.Items) //{ // if (item is App_GlobalResourceFileDefinition) // { // App_GlobalResourceFileDefinition globalItem = item as App_GlobalResourceFileDefinition; // countGlobalResouces++; // } // else // { // ApplicationResourceFileDefinition appResourceFileDef = item as ApplicationResourceFileDefinition; // countWPResources++; // } //} //Assert.AreEqual(countGlobalResouces, 3); //Assert.AreEqual(countWPResources, 1); }
public void Build() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; //wspBuilder.Arguments = ""; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); Assert.IsNotNull(manifestHandler.Manifest.Assemblies); Assert.IsTrue(manifestHandler.Manifest.Assemblies.Length == 1, "There should only be one assembly reference in the manifest.xml file!"); Assert.IsTrue(manifestHandler.Manifest.Assemblies[0].Location.Equals("Unmanaged.Dll", StringComparison.InvariantCultureIgnoreCase)); }
public void BuildWithArguments() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments += @" -BuildSolution true -GACPath Project1\GAC -12Path Project2\12 -80Path Project1\80 -BinPath Project1\80\bin"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); AssemblyFileReference[] assemblies = manifestHandler.Manifest.Assemblies; Assert.IsNotNull(assemblies); Assert.IsTrue(DoMultiAssemblyExists(assemblies, @"Dummy.DLL") == 1, "There can not be more than one assembly in the same folder!"); }
public void BuildExpandTrue() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments += " -ExpandTypes true"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); Assert.IsTrue(TestUtil.FileSize(filename) > 1000, "Manifest.xml is too small, please check!"); ManifestHandler manifestHandler = new ManifestHandler(filename); Assert.IsNotNull(manifestHandler.Manifest.Assemblies); Assert.IsNotNull(manifestHandler.Manifest.Assemblies[0].SafeControls); Assert.IsNotNull(manifestHandler.Manifest.Assemblies[0].SafeControls.Length >= 9); }
public void Build() { // Setup WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); // Run wspBuilder.Build(); // Test string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); Assert.IsNotNull(manifestHandler.Manifest.ApplicationResourceFiles); Assert.IsNotNull(manifestHandler.Manifest.ApplicationResourceFiles.Items); Assert.AreEqual(manifestHandler.Manifest.ApplicationResourceFiles.Items.Length, 4); int countWPResources = 0; int countGlobalResouces = 0; ApplicationResourceFileDefinitions defs = manifestHandler.Manifest.ApplicationResourceFiles; foreach (object item in defs.Items) { if (item is App_GlobalResourceFileDefinition) { App_GlobalResourceFileDefinition globalItem = item as App_GlobalResourceFileDefinition; countGlobalResouces++; } else { ApplicationResourceFileDefinition appResourceFileDef = item as ApplicationResourceFileDefinition; countWPResources++; } } Assert.AreEqual(countGlobalResouces, 3); Assert.AreEqual(countWPResources, 1); }
public void Build() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments = "-cleanup false -buildcab true -TraceLevel Verbose"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); Assert.IsTrue(TestUtil.FileSize(filename) > 1000, "Manifest.xml is too small, please check!"); ManifestHandler manifestHandler = new ManifestHandler(filename); AssemblyFileReference[] assemblies = manifestHandler.Manifest.Assemblies; Assert.IsNotNull(assemblies); Assert.IsTrue(DoAssemblyExists(assemblies, @"Dummy.DLL")); Assert.IsTrue(DoAssemblyExists(assemblies, @"WSPDemo.DLL")); Assert.IsTrue(DoAssemblyExists(assemblies, @"da-Dk\WSPDemo.Resources.DLL")); Assert.IsTrue(DoAssemblyExists(assemblies, @"en-GB\WSPDemo.Resources.DLL")); }
public void BuildSimple() { // Setup WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments = @" -cleanup false"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; // Run wspBuilder.Build(); // Test string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); AssemblyFileReference[] assemblies = manifestHandler.Manifest.Assemblies; Assert.IsNotNull(assemblies); foreach (AssemblyFileReference assmRef in assemblies) { if ("Dummy.dll".EndsWith(assmRef.Location, StringComparison.OrdinalIgnoreCase)) { if (assmRef.SafeControls != null && assmRef.SafeControls.Length > 0) { throw new ApplicationException("Dummy.dll should not have SafeControls in manifest!"); } } if ("WSPDemo.dll".EndsWith(assmRef.Location, StringComparison.OrdinalIgnoreCase)) { if (assmRef.SafeControls == null && assmRef.SafeControls.Length == 0) { throw new ApplicationException("WSPDemo.dll should have SafeControls in manifest!"); } } } }
public void BuildSimple() { // Setup WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments = @" -cleanup false -TraceLevel Verbose"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; // Run wspBuilder.Build(); // Test string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); ManifestHandler manifestHandler = new ManifestHandler(filename); AssemblyFileReference[] assemblies = manifestHandler.Manifest.Assemblies; Assert.IsNull(assemblies, "There should not be any dlls in the manifest.xml!"); }
public void BuildExpandFalse() { WSPBuilderHandler wspBuilder = new WSPBuilderHandler(PROJECTNAME); wspBuilder.Arguments += " -ExpandTypes false"; wspBuilder.ProjectPath = TestInvironment.ProjectsPath + @"\" + PROJECTNAME; wspBuilder.Build(); string filename = wspBuilder.ProjectPath + @"\manifest.xml"; Assert.IsTrue(File.Exists(filename)); //Assert.IsTrue(TestUtil.FileSize(filename) > 1000, "Manifest.xml is too small, please check!"); ManifestHandler manifestHandler = new ManifestHandler(filename); Assert.IsNotNull(manifestHandler.Manifest.Assemblies); Assert.IsNotNull(manifestHandler.Manifest.Assemblies[0].SafeControls); foreach (SafeControlDefinition safeControl in manifestHandler.Manifest.Assemblies[0].SafeControls) { if (safeControl.TypeName.Equals("AbstractDummyControl", StringComparison.InvariantCultureIgnoreCase)) { throw new ApplicationException("The SafeControl AbstractDummyControl should not be in manifest: " + safeControl.TypeName); } if (safeControl.TypeName.Equals("InterfaceDummy", StringComparison.InvariantCultureIgnoreCase)) { throw new ApplicationException("The SafeControl should not be in manifest: " + safeControl.TypeName); } if (safeControl.TypeName.Equals("WindowsUserControl", StringComparison.InvariantCultureIgnoreCase)) { throw new ApplicationException("The SafeControl should not be in manifest: " + safeControl.TypeName); } if (safeControl.TypeName.Equals("FormControl", StringComparison.InvariantCultureIgnoreCase)) { throw new ApplicationException("The SafeControl should not be in manifest: " + safeControl.TypeName); } } }