Are there any books or articles that show you how to use NUnit to test entire features of a program? Is there a name for this type of testing?
This is different from the typical use of NUnit for unit testing where you test individual classes. This is similar to acceptance testing except that it is written by the developer to discern that the program does what they interpreted as being what the customer wants the program to do. I don't need it to be readable by non-programmers or to produce a readable specification for non-programmers.
The problem I am having is keeping this feature testing code maintainable. I need help in organizing my feature testing code. I also need help organizing the program code to be drivable in this way. I am having a hard time being able to issue commands to the program while still having good code design.
I have an LCDS server sitting behind a corporate proxy/firewall.
I need to use a configured HTTPProxyService on the LCDS server to make requests out to beyond the firewall (can't go directly from the client because of crossdomain.xml issues)
How do I configure LCDS to use the corporate proxy on it's outbound requests?
Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird.
So, What is the best way you mock sealed classes?
Java answers are more than welcome. In fact, I would anticipate that the Java community has been dealing with this longer and has a great deal to offer.
But here are some of the .NET opinions:
Why Duck Typing Matters for C#
Develoepers
Creating wrappers
for sealed and other types for
mocking
Unit tests for WCF (and Moq)
I would like to add an additional class path to the exec-maven-plugin.
Besides the %classpath, I would like to add an extra path to a directory containing resources (/Users/kornp/resources).
Currently, my pom looks like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<executable>java</executable>
<classpathScope>runtime</classpathScope>
<arguments>
<argument>%classpath:/Users/kornp/resources</argument>
<argument>org.drrabbit.maventest.App</argument>
</arguments>
</configuration>
</plugin>
How should I configure this?
I want to make a program that takes as user input a website address. The program then goes to that website, downloads it, and then parses the information inside. It outputs a new html file using the information from the website.
Specifically, what this program will do is take certain links from the website, and put the links in the output html file, and it will discard everything else.
Right now I just want to make it for websites that don't require a login, but later on I want to make it work for sites where you have to login, so it will have to be able to deal with cookies.
I'll also want to later on have the program be able to explore certain links and download information from those other sites.
What are the best programming languages or tools to do this?
hi friends.
i want to create a color progress bar in delphi language within use by XPMan component (it is : with win xp style).
what do i do?
what code using?
I recently updated an application from VS2003 to VS2008 and I knew I would be dealing with a host of "Cross-thread operation not valid: Control 'myControl' accessed from a thread other than the thread it was created on" I am handling this in what I beleive is the correct way (see code sample below). I am running into numerous controls that are going to need a similar fix. Not wanting to have similar code for every label, textbox etc.. that are being accessed by a non UI thread. What are the ramifications of just setting the CheckForIllegalCrossThreadCalls = false for the entire app?
I found a CodeProject article with various workarounds and a warning at the bottom to NOT set the property. I am looking for other opinions/experiences on this issue.
private void ShowStatus(string szStatus)
{
try
{
if (this.statusBar1.InvokeRequired) { BeginInvoke(new MethodInvoker(delegate() { ShowStatus(szStatus); })); }
else { statusBar1.Panels[0].Text = szStatus; }
}
catch (Exception ex)
{
LogStatus.WriteErrorLog(ex, "Error", "frmMNI.ShowStatus()");
}
}
I have a Document class that loads variables from Facebook with the use of stage.loaderInfo
var connect:FacebookConnectObject = new FacebookConnectObject( facebook, API_KEY, this.stage.loaderInfo );
But when I change the Document class (with another one responsible for the layout of my app), and try call the above from a movieclip that exists in my application with the use:
var facebook_class:FacebookAp = new FaceBppkApp
addChild(facebook_class) I get error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
I believe the error comes fro this line
this.stage.loaderInfo
since I changed the scope...
How I am supposed to fix that?
Does anyone know any good JavaScript alternatives to mxGraph (http://www.jgraph.com/mxgraph.html) that allows the user to draw Visio style diagrams on a canvas and add/edit/remove properties of elements?
Hi,
I want to make my php page just can be accessed by another page redirect, and want to prevent my user directly access to it.
i mean, lets say i have a page called "main.php" and other php file that i want to prevent direct access called "noaccess.php".
I want to make noaccess.php file accessible if i only redirect from main.php
any suggestion?
Thnx
I have this little snapgear firewall. It's a little purpose built box running a custom linux, SH4 processor @240 Mhz, 64MB of ram.
Basically how close we are to capacity is a mystery to me. I know I can run top and see the status of all the processes, but how can I see just how much of the processor is going to passing data... and how to estimate when I'm going to need to upgrade, and by tweaking iptables rules, how does that help/hurt the processor.
suggestions?
I use Outlook 2007, and have a Hotmail/Live webmail account. Using Outlook Connector, I want them to be synced to Outlook 2007 on my Windows 7 HP machine, however when I click on the folder name (e.g. [email protected]) in the 'Navigation Pane' under all the usual folders such as 'Inbox', 'Deleted Items', etc, it just shows a blank inbox stating that there are no items to be shown.
Des vulnérabiltés découvertes dans Java, déjà patchées par Oracle
Le CERTA (Centre d'Expertise Gouvernemental de
Réponse et de Traitement des Attaques informatiques) vient d'émettre un avis de sécurité révelant la présence de vulnérabilités dans la machine virtuelle Oracle Java (appelée ainsi depuis le récent rachat de Sun Microsystems par Oracle).
D'après le document officiel de l'alerte, les vulnérabilités sont :
- Une erreur dans le code de la classe HeadspaceSoundbank peut provoquer un débordement de mémoire par le biais d'un fichier Soundbank spécialement conçu ;
- Une erreur dans le traitement des images peut provoquer un débordement de mémoire par le biais d'une applet Java spécialement conçu...
What is the real diference between each one?
I think auto inc is easy to hack vs uuid
Uuid is slow than autoincrement in a query with to many records, but is there a huge difference in it?
I am trying to see a list of tables from Adventureworks DB from "Person" schema in Sql Server 2008. I developed teh following SP, but after running it as follows it gives me error "Incorrect syntax near ')'". Do you know how I can revise this SP or exec statement?
CREATE PROCEDURE [getTableNames]
@SchemaName VARCHAR(50)
AS
BEGIN
SET NOCOUNT ON;
SET @SchemaName = 'PERSON'
DECLARE @cmd AS VARCHAR(max)
SET @SchemaName = RTRIM(@SchemaName)
SET @cmd = N'SELECT TABLE_NAME ' +
'FROM information_schema.Tables ' +
'WHERE TABLE_TYPE = ''BASE TABLE'' AND TABLE_SCHEMA = @SchemaName'
END
exec sp_executesql getTableNames, N'@SchemaName NVARCHAR(50), @SchemaName'
I notice my query doesn't behave correctly if one of the like variables is empty:
SELECT name
FROM employee
WHERE name LIKE '%a%'
AND color LIKE '%A%'
AND city LIKE '%b%'
AND country LIKE '%B%'
AND sport LIKE '%c%'
AND hobby LIKE '%C%'
Now when a and A are not empty it works but when a, A and c are not empty the c part is not excuted so it seems?
How can I fix this?
Example:
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public int Add(int x, int y)
{
string request = getRawSOAPRequest();//How could you implement this part?
//.. do something with complete soap request
int sum = x + y;
return sum;
}
}
thanks!
In my Rails project I'm using Formtastic to manage my forms. I have a model, Tags, with a column, "group". The group column is just a simple hardcoded way to organize my tags. I will post my Tag model class so you can see how it's organized
class Tag < ActiveRecord::Base
class Group
BRAND = 1
SEASON = 2
OCCASION = 3
CONDITION = 4
SUBCATEGORY = 5
end
has_many :taggings, :dependent => :destroy
has_many :plaggs, :through => :taggings
has_many :monitorings, :as => :monitorizable
validates_presence_of :name, :group
validates_uniqueness_of :name, :case_sensitive => false
def self.brands(options = {})
self.all({ :conditions => { :group => Group::BRAND } }.merge(options))
end
def self.seasons(options = {})
self.all({ :conditions => { :group => Group::SEASON } }.merge(options))
end
def self.occasions(options = {})
self.all({ :conditions => { :group => Group::OCCASION } }.merge(options))
end
def self.conditions(options = {})
self.all({ :conditions => { :group => Group::CONDITION } }.merge(options))
end
def self.subcategories(options = {})
self.all({ :conditions => { :group => Group::SUBCATEGORY } }.merge(options))
end
def self.non_brands(options = {})
self.all({ :conditions => [ "`group` != ? AND `group` != ?", Tag::Group::SUBCATEGORY, Tag::Group::BRAND] }.merge(options))
end
end
My goal is to use Formtastic to provide a grouped multiselect box, grouped by the column, "group" with the tags that are returned from the non_brands method. I have tried the following:
= f.input :tags, :required => false, :as => :select, :input_html => { :multiple => true }, :collection => tags, :selected => sel_tags, :group_by => :group, :prompt => false
But I receive the following error:
(undefined method `klass' for
nil:NilClass)
Any ideas where I'm going wrong?
Thanks for looking :]
I have a table in SQL that links to itself through parentID. I want to find the children and their children and so forth until I find all the child objects. I have a recursive function that does this but it seems very ineffective.
Is there a way to get sql to find all child objects? If so how?
hi
i made a class that make registration to my WinCE program.
how i can from the class draw pannel + textbox, and catch the enter press
from the textbox ?
i try to do this:
TextBox tb=new TextBox();
tb.Location=new Point(10,10);
Panel pn=new Panel();
pn.Dock=DockStyle.Fill;
pn.Controls.Add(tb);
this.Controls.Add(pn);
but i got error in: this.Controls.Add(pn);
is there any simple sample code for this ?
thank's in advance
So if I was to take a an access form, and embed either an excel spreadsheet into it, or a powerpoint slide/pres, how would I reference it in VBA code?
So I know I have to set the libraries, name the frame of the OLE object, and use applicable syntax to whatever I want to do, with whatever I stick in the form, however the only things I have ever done with excel and/or powerpoint is automate the opening of a seperate window/application from access, not within the access form....so I am not sure??
if I said its a new Excel.Application, then set xls = to (the ss in the file, and not some file path of another excel file somewhere)?
does that make sense?
We would like to enumerate all strings in a resource file in .NET (resx file). We want this to generate a javascript object containing all these key-value pairs. We do this now for satellite assemblies with code like this (this is VB.NET, but any example code is fine):
Dim rm As ResourceManager
rm = New ResourceManager([resource name], [your assembly])
Dim Rs As ResourceSet
Rs = rm.GetResourceSet(Thread.CurrentThread.CurrentCulture, True, True)
For Each Kvp As DictionaryEntry In Rs
[Write out Kvp.Key and Kvp.Value]
Next
However, we haven't found a way to do this for .resx files yet, sadly. How can we enumerate all localization strings in a resx file?
UPDATE:
Following Dennis Myren's comment and the ideas from here, I built a ResXResourceManager. Now I can do the same with .resx files as I did with the embedded resources. Here is the code. Note that Microsoft made a needed constructor private, so I use reflection to access it. You need full trust when using this.
Imports System.Globalization
Imports System.Reflection
Imports System.Resources
Imports System.Windows.Forms
Public Class ResXResourceManager
Inherits ResourceManager
Public Sub New(ByVal BaseName As String, ByVal ResourceDir As String)
Me.New(BaseName, ResourceDir, GetType(ResXResourceSet))
End Sub
Protected Sub New(ByVal BaseName As String, ByVal ResourceDir As String, ByVal UsingResourceSet As Type)
Dim BaseType As Type = Me.GetType().BaseType
Dim Flags As BindingFlags = BindingFlags.NonPublic Or BindingFlags.Instance
Dim Constructor As ConstructorInfo = BaseType.GetConstructor(Flags, Nothing, New Type() { GetType(String), GetType(String), GetType(Type) }, Nothing)
Constructor.Invoke(Me, Flags, Nothing, New Object() { BaseName, ResourceDir, UsingResourceSet }, Nothing)
End Sub
Protected Overrides Function GetResourceFileName(ByVal culture As CultureInfo) As String
Dim FileName As String
FileName = MyBase.GetResourceFileName(culture)
If FileName IsNot Nothing AndAlso FileName.Length > 10 Then
Return FileName.Substring(0, FileName.Length - 10) & ".resx"
End If
Return Nothing
End Function
End Class
Normally we can specify a target in the link or use javascript window.open to open a new window.
But when I access this site
www.wenxuecity.com (It is a chinese site)
I could't find out how it opens each news in a new window.
no target in the link.
debug javascript doesn't show any call to window.open
Could someone tell me how it is implemented?
Thanks