Hi,
By default nunit tests run alphabetically. Does anyone know of any way to set the execution order? Does an attribute exist for this?
Any help would be greatly appreciated.
Thanks
Zaps
There is a java table in my application which has 1 column & 5 rows. Contents of rows are as below. These contents are arranged in descending order
172-18-zfs
MKTLAB
NFSVOL
datastore1
datastore1(1)
after clicking on column header it get sort in asceding order & order is like this
datastore1(1)
datastore1
NFSVOL
MKTLAB
172-18-zfs
Through QTP i want to check whether this sortig is correct or not.
I have used sort() method of dictionary but it doesnt give expected result. It just sort according to alphabatical order.
In expected sorting order 1st priority should be to small letter then to capital letter then to number.
I have created a web application. One of the feature is text search which perform the boolean operator ( NOT, AND, OR) as well. However, I have no idea on calculating the search's accuracy and efficiency.
For example:
1 . Probe identification system for a measurement instrument
2 . Pulse-based impedance measurement instrument
3 . Millimeter with filtered measurement mode
when the user key in will return the result as below
input :measurement instrument
Result: 1,2
input : measurement OR instrument NOT milimeter
Result: 1,2,3
so, i have no idea on what issue and what algorithm to calculate on the accuracy and efficiency of the text search.. anyone have any idea on that?
Hey,
I have a table that contains sets of sequential datasets, like that:
ID set_ID some_column n
1 'set-1' 'aaaaaaaaaa' 1
2 'set-1' 'bbbbbbbbbb' 2
3 'set-1' 'cccccccccc' 3
4 'set-2' 'dddddddddd' 1
5 'set-2' 'eeeeeeeeee' 2
6 'set-3' 'ffffffffff' 2
7 'set-3' 'gggggggggg' 1
At the end of a transaction that makes several types of modifications to those rows, I would like to ensure that within a single set, all the values of "n" are still sequential (rollback otherwise). They do not need to be in the same order according to the PK, just sequential, like 1-2-3 or 3-1-2, but not like 1-3-4.
Due to the fact that there might be thousands of rows within a single set I would prefer to do it in the db to avoid the overhead of fetching the data just for verification after making some small changes.
Also there is the issue of concurrency. The way locking in InnoDB (repeatable read) works (as I understand) is that if I have an index on "n" then InnoDB also locks the "gaps" between values. If I combine set_ID and n to a single index, would that eliminate the problem of phantom rows appearing?
Looks to me like a common problem. Any brilliant ideas?
Thanks!
Note: using MySQL + InnoDB
I'm working on a project for school in Java programming. I need to design a GUI that will take in questions and answers and store them in a file. It should be able to contain an unlimited number of questions. We have covered binary I/O.
How do I write the input they give to a file? How would I go about having them add multiple questions from this GUI?
package multiplechoice;
import java.awt.*;
import javax.swing.*;
public class MultipleChoice extends JFrame {
public MultipleChoice() {
/*
* Setting Layout
*/
setLayout(new GridLayout(10,10));
/*
* First Question
*/
add(new JLabel("What is the category of the question?: "));
JTextField category = new JTextField();
add(category);
add(new JLabel("Please enter the question you wish to ask: "));
JTextField question = new JTextField();
add(question);
add(new JLabel("Please enter the correct answer: "));
JTextField correctAnswer = new JTextField();
add(correctAnswer);
add(new JLabel("Please enter a reccomended answer to display: "));
JTextField reccomendedAnswer = new JTextField();
add(reccomendedAnswer);
add(new JLabel("Please enter a choice for multiple choice option "
+ "A"));
JTextField A = new JTextField();
add(A);
add(new JLabel("Please enter a choice for multiple choice option "
+ "B"));
JTextField B = new JTextField();
add(B);
add(new JLabel("Please enter a choice for multiple choice option "
+ "C"));
JTextField C = new JTextField();
add(C);
add(new JLabel("Please enter a choice for multiple choice option "
+ "D"));
JTextField D = new JTextField();
add(D);
add(new JButton("Compile Questions"));
add(new JButton("Next Question"));
}
public static void main(String[] args) {
/*
* Creating JFrame to contain questions
*/
FinalProject frame = new FinalProject();
// FileOutputStream output = new FileOutputStream("Questions.dat");
JPanel panel = new JPanel();
// button.setLayout();
// frame.add(panel);
panel.setSize(100,100);
// button.setPreferredSize(new Dimension(100,100));
frame.setTitle("FinalProject");
frame.setSize(600, 400);
frame.setLocationRelativeTo(null); // Center the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
I'm trying to figure out if
g++ -fsyntax-only
does only syntax checking or if it expands templates too.
Thus, I ask stack overflow for help:
is there to write a program so that syntactically it's valid, but when template expansion is done, an error occurs?
Thanks!
Hello,
Im trying to do load testing on a web server. I want to customise the error fields whenever i get results other than 200 ok. At present the error is realised only when the server doesnot respond. Is there anyway i could customise error as i need.
Hello I have a Rewrite rule I am trying to implement on my local host but I cannot get it to do the action no matter how I setup the regex
the files are in this naming scheme /docroot/css/stylesheet.min.css and I have them printed in the code like /docroot/css/stylesheet.min.123438348.css (the number is example it comes from a get modified function). Note docroot is an example directory
how can I have the server ignore the numbers and redirect to the stylesheet.min.css
I need to do this for every css and js files (/js and /css) as well as one specific spritemap image
my current attempt
RewriteRule ^/(docroot)/(js|css)/(.+)\.(min)\.(.+)\.(js|css)$ /$1/$2/$3.$4.$6
RewriteRule ^(/docroot/images/spritemap)\.([0-9]+)\.(png)$ $1.$3
I have this wrapped in a I am on linux..should this be mod_rewrite.so?"
I would like to know what are the open source and commerical tools for window Service Testing. Like memeory usage and code leakes etc ..
C# 2.0 - Window Service.
I'm really not confident with Regex, I know some basic syntax but not enough to keep me happy.
I'm trying to build a regular expression to check if an email is valid. So far here's what I've got:
[A-Za-z0-9._-]+@[A-Za-z0-9]+.[A-Za-z.]+
It needs to take account of periods in the username/domain and I think it works with multiple TLDs (e.g. co.uk).
I'm working with the preg engine in PHP so it needs to work with that. Thanks if you can help!
I want to get the code coverage of my tests. So I set the settings, build an app with .gcno files and run it on simulator.
It can get the coverage data successfully if there is no crash issue.
But if the app crashed, I will get nothing.
So how can I get the code coverage data when the app crash?
In my thought, this is because it will not call __gcov_flush() method when app crash. I only add app does not run in background to my plist file, so __gcov_flush() is called only at the time I press Home button.
Is there any way to call __gcov_flush() before the app crash?
Hi,
this is something I know I should embrass in my coding projects but, due to lack of knowledge and my legendary lazyness, I do not do.
In fact, when I do them, I feel like overloaded and I finally give up.
What I am looking for is a good book/tutorial on how to really write good tests -i.e useful and covering a large spectrum of the code -.
Regards
Hi,
What's the recommended way to cover off unit testing of generic classes/methods?
For example (referring to my example code below). Would it be a case of have 2 or 3 times the tests to cover testing the methods with a few different types of TKey, TNode classes? Or is just one class enough?
public class TopologyBase<TKey, TNode, TRelationship>
where TNode : NodeBase<TKey>, new()
where TRelationship : RelationshipBase<TKey>, new()
{
// Properties
public Dictionary<TKey, NodeBase<TKey>> Nodes { get; private set; }
public List<RelationshipBase<TKey>> Relationships { get; private set; }
// Constructors
protected TopologyBase()
{
Nodes = new Dictionary<TKey, NodeBase<TKey>>();
Relationships = new List<RelationshipBase<TKey>>();
}
// Methods
public TNode CreateNode(TKey key)
{
var node = new TNode {Key = key};
Nodes.Add(node.Key, node);
return node;
}
public void CreateRelationship(NodeBase<TKey> parent, NodeBase<TKey> child) {
.
.
.
HI there
I was wondering if there is a better way of testing that a view has rendered in MVC.
I was thinking perhaps I should render the view to a string but perhaps there are simpler methods?
Basically what I want to know if that the view for a given action has rendered without errors
I m already testing the view model but I want to see that rendering the view giving a correct ViewData.Model works
How do you access a file to use in unit tests? (Every time I have asked with more specific information I cannot get ANYONE to answer. This is as freaking basic as it gets. HELLO? IS ANYONE OUT THERE?)
Is there any good framework for comparing whole objects?
now i do
assertEquals("[email protected]", obj.email);
assertEquals("5", obj.shop);
if bad email is returned i never get to know if it had the right shop, i would like to get a list of incorrect fields.
Guice Singletons are weird for me
First I thought that
IService ser = Guice.createInjector().getInstance(IService.class);
System.out.println("ser=" + ser);
ser = Guice.createInjector().getInstance(IService.class);
System.out.println("ser=" + ser);
will work as singleton, but it returns
ser=Service2@1975b59
ser=Service2@1f934ad
its ok, it doesnt have to be easy.
Injector injector = Guice.createInjector();
IService ser = injector.getInstance(IService.class);
System.out.println("ser=" + ser);
ser = injector.getInstance(IService.class);
System.out.println("ser=" + ser);
works as singleton
ser=Service2@1975b59
ser=Service2@1975b59
So i need to have static field with Injector(Singleton for Singletons)
how do i pass to it Module for testing?
I have a file containing the following content 1000 line in the following format:
abc def ghi gkl
how to write perl script to convert it into :
abc ghi
??
Below is a GLSL fragment shader that outputs a texel
if the given texture coord is inside a box, otherwise a
color is output. This just feels silly and the there
must be a way to do this without branching?
uniform sampler2D texUnit;
varying vec4 color;
varying vec2 texCoord;
void main() {
vec4 texel = texture2D(texUnit, texCoord);
if (any(lessThan(texCoord, vec2(0.0, 0.0))) ||
any(greaterThan(texCoord, vec2(1.0, 1.0))))
gl_FragColor = color;
else
gl_FragColor = texel;
}
Below is a version without branching, but it still feels clumsy.
What is the best practice for "texture coord clamping"?
uniform sampler2D texUnit;
varying vec4 color;
varying vec4 labelColor;
varying vec2 texCoord;
void main() {
vec4 texel = texture2D(texUnit, texCoord);
bool outside = any(lessThan(texCoord, vec2(0.0, 0.0))) ||
any(greaterThan(texCoord, vec2(1.0, 1.0)));
gl_FragColor = mix(texel*labelColor, color,
vec4(outside,outside,outside,outside));
}
I am clamping texels to the region with the label is -- the texture s & t coordinates will be between 0 and 1 in this case. Otherwise, I use a brown color where the label ain't.
Note that I could also construct a branching version of the code that does not perform a texture lookup when it doesn't need to. Would this be faster than a non-branching version that always performed a texture lookup? Maybe time for some tests...
HOSTNAME=$1
#missing files will be created by chk_dir
for i in `cat filesordirectorieslist_of_remoteserver`
do
isdir=remsh $HOSTNAME "if [ -d $i ]; then echo dir; else echo file; fi"
if [ $isdir -eq "dir" ]
then
remsh $HOSTNAME "ls -d $i | cpio -o" | cpio -id
else
remsh $HOSTNAME "ls | cpio -o" | cpio -id
fi
done
i need simple solution for checking remote file is directory or file ?
thanks
I'm writing an RPC middleware in C++. I have a class named RPCClientProxy that contains a socket client inside:
class RPCClientProxy {
...
private:
Socket* pSocket;
...
}
The constructor:
RPCClientProxy::RPCClientProxy(host, port) {
pSocket = new Socket(host, port);
}
As you can see, I don't need to tell the user that I have a socket inside.
Although, to make unit tests for my proxies it would be necessary to create mocks for sockets and pass them to the proxies, and to do so I must use a setter or pass a factory to the sockets in the proxies's constructors.
My question: According to TDD, is it acceptable to do it ONLY because the tests? As you can see, these changes would change the way the library is used by a programmer.
Using Hibernate, what is the most efficient way to determine if a table is empty or non-empty? In other words, does the table have 0, or more than 0 rows?
I could execute the HQL query select count(*) from tablename and then check if result is 0 or non-0, but this isn't optimal as I would be asking the database for more detail than I really need.