I am "translating" a NUnit test to Visual Studios unit testing and I am wondering if the attribute [ClassInitialize()] in VS is equivalent to [SetUp()] in NUnit?
I have to build an application using Maven for PHP that has multiple modules.
The scenario in which the maven seems to not work is this: I have a common module and a client module depending on the first one.
When doing "mvn site" on the client module which depends on the common module, the test fails to see the paths to the common module. Is there a flow in my build or this is just not possible?
if I have a class called Person.
var Person = function(fname, lname){
this.fname = fname;
this.lname = lname;
}
Person.prototype.mname = "Test";
var p = new Person('Alice','Bob');
Now, p.proto refers to prototype of Person but, when I try to do Person.proto , it points to function(), and Person.constructor points to Function().
can some1 explain what is the difference between function() and Function() and why prototype of a Function() class is a function()
i need to find empty directories for given list of directories
some directories have directories inside it
if inside directories also empty
i can say main directory is empty otherwise it's not empty
how can i test this
for example
A>A1(file1),A2 this is not empty beacuse of file1
B>B1(no file) this is empty
C>C1,C2 this is empty
thanks
When indenting java code with annotations, vim insists on indenting like this:
@Test
public void ...
I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together with regular cindent.
edit: The filetype plugin was already turned on I just got a bit confused about indenting plugins. The accepted answer may be a bit hackish but works for me as well.
Hi, I developed a ws using netbeans using annotations:
@WebService MyWS()
public class MyWS {
@WebMethod(operationName="MyWebMethod")
public MyWebMethod(@WebParam(name="str") StringHolder str){
...
}
}
The applicaction's context root is /WSTests
Based on this information how can I deduce what's the .wsdl associated with my project to test it with - for instance - soapui ?
Thanks
Hi Guys,
I'm looking to test some code I've written and to do so I need to construct a variable of type Location and to give it a long / lat value but I'm unsure how I would do so. Any ideas?
I searched a while and found no extension that can compete with Firebug. Perhaps combination of several extensions can provide similar feature set of Firebug.
Anybody develop web app and unit test mainly in Chrome can share some knowledge?
How can I easily create a fractional y-value when using ggplot?
t <- as.factor(test=sample(seq(0,100,10),1000,rep=T))
d <- as.factor(sample(c(0,1),1000,rep=T)
p <- data.frame(t,d)
My best shot was:
ggplot(p,aes(x=t,y=prop.table(table(t,d),1)[,1])) + geom_point()
However this doesnt work and I guess there is an easier way around this...
First I show some code.
library: axis.jar, dom4j.jar
jdk1.5, windowsXP
T.java
import java.io.StringWriter;
import org.apache.axis.utils.StringUtils;
import org.dom4j.DocumentHelper;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
public class T {
public T() {
System.out.println("constructor");
}
public void test() {
System.out.println(StringUtils.unescapeNumericChar("1"));
}
public String getPrettyXML(String xml) throws Exception {
System.out.println("getPrettyXML");
StringWriter sw = new StringWriter();
XMLWriter writer = null;
try {
OutputFormat format = OutputFormat.createPrettyPrint();
org.dom4j.Document document = DocumentHelper.parseText(xml);
writer = new XMLWriter(sw, format);
writer.write(document);
} catch (Exception e) {
throw e;
} finally {
if (writer != null) {
try {
writer.close();
} catch (Exception e) {
}
}
}
return sw.toString();
}
public void a() {
System.out.println("a");
}
public static void main(String[] args) {
new T().test();
}
}
T2.java
public class T2 {
public static void main(String[] args) throws Exception {
System.out.println("T2");
T t = (T) Class.forName("T").newInstance();
}
}
Ok, here we go... run as (Of course, I'm run at the directory where T.class, T1.class is)
java T2
as you can see, not exist class path.
==console==
T2
constructor
OK...
Now delete
throw e
line at the catch block on the "getPrettyXML" method of T.
Ok, here we go.. run one more time without classpath
java T2
You can see below...
==console==
T2
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/io/OutputFormat
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at T2.main(T2.java:5)
I know that it's not very important for my life or your life.
But it's so mysterisou to me, and my all curiosity.
thanks.. ^^
UPDATE polls_options SET `votes`=`votes`+1, `percent`=ROUND((`votes`+1) / (SELECT voters FROM polls WHERE poll_id=? LIMIT 1) * 100,1)
WHERE option_id=?
AND poll_id=?
Don't have table data yet, to test it properly. :)
And by the way, in what type % integers should be stored in database?
Thanks for the help!
Hi everybody,
I need to do a test in a DataView to check if at least one row contains one cell with a null value. What is the best way to do it in your opinion ?
Thanks in advance.
I have program that runs fast enough. I want to see the number of threads created by the program.
ldd test
shows use of library pthread. but how to find out number of threads created by the program. I only have command line access to the PC on which the program is run.
The platform is linux.
How can I set the background-image css property of say a div using jquery? will something like this work?
$("#div").css("backgroundImage", "url('test.jpg')");
When i execute my code i am getting this error
LPTSTR lpBuffer;
::GetLogicalDriveStrings(1024,lpBuffer);
while(*lpBuffer != NULL)
{
printf("%s\n", lpBuffer); // or MessageBox(NULL, temp, "Test", 0); or whatever
lpBuffer += lstrlen(lpBuffer)+1;
printf("sizeof(lpBuffer) %d\n",lstrlen(lpBuffer));
}
OutPut
C
sizeof(lpBuffer) 3
D
sizeof(lpBuffer) 3
E
sizeof(lpBuffer) 3
F
sizeof(lpBuffer) 0
I am using Firefox's native JSON.parse() to parse some JSON strings that include regular expressions as values, for example:
var test = JSON.parse('{"regex":"/\\d+/"}');
The '\d' in the above throws an exception with JSON.parse(), but works fine when I use eval (which is what I'm trying to avoid).
What I want is to preserve the '\' in the regex - is there some other JSON-friendly way to escape it?
Hi All,
I am implementing bluepay payment gateway in my PHP project, I couldn't find any integration document for bluepay, Plaese any one tell me the basic steps for posting data to bluepay, ie in which format i have to post data to "https://bluepay.onlinedatacorp.com/test/bluepaylitetest.asp" Please help me!!!
If I have magic_quotes switched on and I use mysql_real_escape_string, will the tring be double escaped? Will it cause problems? I assume so based on the get_magic_quotes() function but just seeking confirmation. (PS it's easier to ask this question than test it in my office with all the security we have in place - It takes me 10-15 to configure everything to get a useable envirnment)
I have two hyperlinks on a page. I'm happy with the css on 'link1' (white text / red rollover) however I want to have a different styling for 'link2'.
I've created a seperate css for this section and have managed to colour it green but I can't get rid of the red rollover effect?
Does anyone know how to override the red rollover effect just on 'link2'?
http://www.signport.co.uk/test/testsize3.html
Thanks!
I need to hide an element if certain values are present in the JSP
The values are stored in a List so I tried:
<c:if test="${ mylist.contains( myValue ) }">style='display:none;'</c:if>
But, it doesn't work.
How can I evaluate if a list contains a value in JSTL, the list and the values are strings.
The urlconf and view is as follows:
url(r'^register/$',
register,
{ 'backend': 'registration.backends.default.DefaultBackend' },
name='registration_register'),
def register(request, backend, success_url=None, form_class=None,
disallowed_url='registration_disallowed',
template_name='registration/registration_form.html',
extra_context=None):
What i want to do is redirect users to the register page and specify a success_url. I tried reverse('registration.views.register', kwargs={'success_url':'/test/' }) but that doesn't seem to work. I've been trying for hours and can't get my mind around getting it right. Thanks
We are having a problem with our selenium tests which run in IE on a virtual machine. Whenever there is a javascript error, a popup shows up and puts our system into a 'stuck' state - a user has to go clear that and restart the selenium test run. Is there a way to prevent the javascript error popup from putting the system into its stuck state? Would setting window.error be of any help here?
I need to remove this string if found in my string:
<p><br/> </p>
Cant replace this:
<p><br/>Test. </p>
The whitespace expression I am using wasn't working for that, thank you for your help!
When I link Boost.Thread to my boost_test executable, it gives me
make[2]: *** No rule to make target `/usr/lib64/libboost_thread-mt.so', needed by `gogo/test/test_boost'. Stop.
when I make it. Here's the offending CMake code, what am I doing wrong?
add_executable(boost_test boost_test.cpp)
add_test(boost_test boost_test)
# Boost auto-links for MSVC, so we exclude it.
if(CMAKE_COMPILER_IS_GNUCXX)
target_link_libraries(test_boost #LINK_INTERFACE_LIBRARIES
${Boost_THREAD_LIBRARY}
)
endif()
I just had a test on java and we had to give the definition of
1) Static:
2) IOExcepion:
What I said for static was...a static method is used to define a method as a class method. And I got it wrong so I asked my teacher and he said he wants the actually definition of static not a static method, class or variable just static. Can someone tell me the definition of this and for IOException please Thanks.