Unit Test Framework for 8.6

Hi all,
Do we have Unit Test Framework Toolkit for LabVIEW 8.6?
We have unit Test Framework Toolkit for LabVIEW 8.6.1(Uit Test Framework Toolkit 1.0)
Thanks,
Suresh Kumar.G

John Harby <[email protected]> wrote:
Did you ever find anything? We are looking too ...I have been reading a great book that has given me some ideas, but I have not
solidified any proofs of concept as of yet. Check out Vincent Massol book JUnit
in Action. He has some great working examples of Mock Objects and Stubs using
Cactus and Jetty. What I am thinking is that in a seperate "Java Project" within
the application, we can extend JUnit and create whatever global objects a process
needs and then make SOAP based calls to the JPD, since the JPD is derived from
a web service. So the other piece to this is experience Unit Testing SOAP...
- Noam

Similar Messages

  • Test coverage in LabView Unit Test Framework

    Hi,
    can somebody from NI confirm the following two statements about the Unit Test Framework:
    1. The framework does not support "recursive coverage metrics", where the coverage considers sub-VIs that are executed in the VI under test.
    2. 100% coverage means something weaker that common "branch coverage". For example, an "if" VI is a branch in the program but it is not considered as a branch by LabView's test coverage metrics.
    Thanks,
    Peter

    Hello Johannes,
    I'm interested in branch coverage of a VI under test.
    Imagine a VI A that calls another VI B. If A is tested and LV's unit test framework reports 100% test coverage for A, it is possible that the test cases didn't visit all frames (branches) in B.
    Now my question is: is it possible that LV thinks of A as "flattened" so that all code in B is considered as code of A?
    Peter

  • Unit test plan for inbound and outbound interfaces

    I am trying to create a UNIT TEST PLAN for an interface. In this interface a flat file in IDOC format is picked up from the application server and processed using EDI_DATA_INCOMING for the relevant posting ( example : Sales order creation from a PO IDOC). IF the file is not in IDOC format then it is reformatted to the IDOC format manually.
    In second scenario(outbound), after sales order creation or billing document creation, IDOC is created which is read and a custom flat file is created and sent to a middleware.
    PLease suggest a unit test plan for these kind of scenarios or send a sample UTP if possible.
    REgards
    Nishant
    PS: points will be awarded to helpful answers.

    Unfortunately this isn't possible, the esa has only one routing table. You'll have to add specific routes for your internal networks.
    I usually avoid two-armed setups because of this and it gets even worse if you want to use virtual gateways (traffic gets sent via the internal interface with an IP from the external interface)

  • Unit Test Validation for Output Ref Cursor Not Working

    Here is the problem:
    I have a stored procedure as follows:
    CREATE OR REPLACE
    PROCEDURE usp_GetEmployee(
    p_employeeId IN NUMBER,
    cv_employee OUT Sys_RefCursor )
    AS
    BEGIN
    OPEN cv_employee FOR SELECT * FROM employees WHERE employee_id=p_employeeid;
    END usp_GetEmployee;
    For this, I am implementing a unit test.
    * In the "Select Parameters" step, I am unchecking the "Test Result" check box for the cursor OUT variable.
    * In the "Specify Validations" step, I am choosing "Boolean Function" and putting the following PL/SQL code:
    DECLARE
    emp_rec {cv_employee$}%rowtype;
    BEGIN
    FETCH {cv_employee$} INTO emp_rec;
    IF {cv_employee$}%FOUND THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    RETURN TRUE;
    END;
    But, when I try to execute this Test, I get the following error:
    Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@4f0617> to REF CURSOR.
    If I run in the debug mode, I get the following content in a dialog box:
    The following procedure was run.
    Execution Call
    BEGIN
    "ARCADMIN"."USP_GETEMPLOYEE"(P_EMPLOYEEID=>:1,
    CV_EMPLOYEE=>:2);
    END;
    Bind variables used
    :1 NUMBER IN 1001
    :2 REF CURSOR OUT (null)
    Execution Results
    ERROR
    CV_EMPLOYEE : Expected: [Any value because apply check was cleared], Received: [EMPLOYEE_ID                             COMMISSION_PCT                          SALARY                                 
    1001                                    0.2                                     8400                                   
    Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@31dba0> to REF CURSOR.
    Please suggest how to handle this issue.
    Thanks,
    Rahul

    979635 wrote:
    But, when I try to execute this Test, I get the following error:
    Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@4f0617> to REF CURSOR.
    If I run in the debug mode, I get the following content in a dialog box:
    The following procedure was run.
    Execution Call
    BEGIN
    "ARCADMIN"."USP_GETEMPLOYEE"(P_EMPLOYEEID=>:1,
    CV_EMPLOYEE=>:2);
    END;
    Bind variables used
    :1 NUMBER IN 1001
    :2 REF CURSOR OUT (null)
    Try explicity declaring the ref cursor instead of using a bind variable, something like (untested)
    begin
      foo sys_refcurosr;
    begin
      test_procedure(foo);
    end;Alternately, in SQL*PLUS use the DEFINE command to ste a named bind variable to type REFCURSOR and use the named bind variable in your test
    Edited by: riedelme on Jan 23, 2013 7:10 AM

  • Unit Test Framework Crashing LabVIEW Project

    [Cross posted to LAVA]
    OS: Windows 7
    LabVIEW 2009, LabVIEW 2009 SP1. 
    Howdy
    If I create a project and add a VI and a unit test to it and save it, then delete the unit test, everything works.
    If I do the above but put the unit test in a virtual folder then delete it, the project hangs and LabVIEW crashes.
    I have tried this on multiple computers and get the same effect.
    If it is an issue I thought this may have been fixed in 2009 SP1, but it is not.
    I do not remember this happening in 8.6.1 but I was using VISTA at the time (if that is related?)
    I get the same problem if I open an existing project with unit tests in it. 
    Additionally I have noticed that the files from the unit test in Windows 7 have no "logo/icon" associated with them. I thought in VISTA they had the same icon as what is shown in the project - the green plus sign (but this was a while ago). 
    Is this a known issue / can anyone else confirm this? 
    Cheers
    -JG 
    Message Edited by jg-code on 04-13-2010 10:02 PM
    Certified LabVIEW Architect * LabVIEW Champion

    Hi Kyle 
    Thank you for your quick reply.
    I am having this problem on my work PC, home PC and a colleague's PC all running Windows 7 and 2009 SP1.
    I have found the problem occurs if I create a new unit test OR drag and drop an existing unit test into the project.
    Attached is a (jing) video of what is happening every time.
    You will see that at the root level of the project (My Computer), I can remove the unit test with no problems at all.
    But if it goes into a virtual folder and I try to remove it - then LabVIEW crashes. 
    The attachment is in LV2009.SP1 and is the sane project as used in the video.
    I look forward to your feedback on resolving this issue I am having.
    Cheers
    -JG 
    Certified LabVIEW Architect * LabVIEW Champion
    Attachments:
    Test Project.zip ‏4 KB

  • Where should I put my extended unit test assemblies for Visual Studio 2013?

    Hi, I have a question about M/S Unit test extension.
    1. My purpose
    I'm trying to extend Visual Studio Unit Test.
    The points where I extends unit test is to output detail logs.
    My development environment is as follows.
    OS: Windows 8.1Pro (64bit version)
    IDE: Microsoft Visual Studio Professional 2013
      (Version 12.0.30723.00 Update 3)
    2. Things which I'd like to know
    To enable my test extension, it is required to put my test extension assemblies into designated sub folder under Visual Studio's installed folder.
    The source of this information is MS developers blog below.
    (http://blogs.msdn.com/b/vstsqualitytools/archive/2009/09/04/extending-the-visual-studio-unit-test-type-part-1.aspx)
    Q1. It's required to put the assemblies bellow.
    C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies
    Howerver, the guidance in the blog is for Visual Studio 2010.
    In Visual Studio2013, above "PrivateAssemblies" could not be found under "\Microsoft Visual Studio 12.0\Common7\IDE" folder.
    Where should I put my assemblies for my 2013. Is there any substitution for "\PrivateAssembly" folder?
    Q2. Another requirement is to set Assembly information entry into the registry below.
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\EnterpriseTools\QualityTools\TestTypes\{13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b}\TestTypeExtensions
    For Visual Studio 2013, I could find almost the same node hierarchy, but
    could not find the last "TestTypeExtention" node. Instead,
    I could find "Extensions" node.
    Should I write registry entry here? Or, should I make a new "TestTypeExtension" node and write the entry there?
    Q3.Last question is more basic question.
    Is there any way to kick extended test program in Visual Studio 2013's Test Explore
    without registering my assemblies in the way recommended above.
    I think it's much tender for developer's in debugging phase. For example,
    it is very much helpful, if I could kick a unit test which uses my extended test class in the unit test extension solution.
    That's all. Any information concerning this topics will be appreciated.

    Hi TrailRunner-MF,
    One possible reason is that you didn't view the correct folder, for example, in my windows 8.1 64 bit, it is in the path: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE", not the "C:\Program Files\Microsoft Visual Studio
    12.0\Common7\IDE " folder.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • JavaServer Faces Unit Test Framework

    Based on my knowledge, there isn't any handy JSF Unit test tools. To facilitate UI developers and QAs to do test, I have created a prototype project to evaluate a solution.
    For a Simple JSF enabled JSP file:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
       <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" />
         <f:view>
              <h:form>
                <h:outputText value="Please input:"/>
                   <h:inputText id="input1"/>
                <br/>
                <h:outputText value="Please input a integer:"/>
                   <h:inputText style="width:50px;" converter="javax.faces.Integer"/>
                <h:commandButton value="Submit"/>     
           </h:form>
       </f:view>
    </jsp:root>writing a HttpUnit to this page is obviously difficult:
    1) Hard to pin-point the html element rendered by input1, because up-level NamingContainer h:form is missing id.
    2) More difficult to find the second InputText, because missing two ids.
    3) How to assert if the converter really works or not, we can't assert any object in PageBean by HttpUnit.
    4) Much more difficult to find those html element if there are several level NamingContainer, such as the component nested within "for-loop".
    I perfer not to write HttpUnit and seperate JUnit to PageBean, so if the follow JSP can be used in both test and production environment, work will be much easier:
    * test1.jsp
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:test="http://www.yourcompany.com/jsf/test"  xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
       <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" />
         <f:view>
            <test:parameter name="abc" value="def"/><!-- setting request parameter -->
              <h:form>
                <h:outputText value="Please input:"/>
                   <h:inputText>
                   <test:set value="hello"
    /> <!-- emulate inputing "hello" to the text box -->
                   <test:assert phase="afterUpdateModelValues" description="InputText1" var="input1" value="#{input1=='hello'}"/><!-- you can try other JSF phases as well, here var "input1" is parent jsf component -->
                      <test:assert description="InputText1" var="input1" value="#{input1=='hello'}"/>
    <!-- use default phase "afterRenderResponse", here var "input1" is HtmlElement fetched from rendered page by HttpUnit -->
                </h:inputText>
                <br/>
                <h:inputText style="width:50px;" converter="javax.faces.Integer">
                   <test:set actions="all" value="123"/>
                   <test:assert phase="afterUpdateModelValues" description="Input2 Class Name" var="input2CN" value="#{input2CN.class.name == 'java.lang.Integer'}"/>
                   <test:assert description="InputText2 value in afterRenderResponse phase" var="input2" value="#{input2=='123'}"/>
                   <test:assert description="InputText2 Style" var="input2Style" valueAttribute="style" value="#{input2Style=='width:20px;height:25px;'}"/>
                </h:inputText>
                <br/>
                <h:commandButton value="Submit">
                   <test:action description="Test Sumbit"/><!-- support multi actions -->
                </h:commandButton>     
           </h:form>
       </f:view>
    </jsp:root> For production jsp you can use normal url, http://server:port/yourapp/faces/test1.jsp, those test:xxx components won't do anything.
    For testing a single page, http://server:port/yourapp/faces/TestAction?view=/test1.jsp
    For testing more pages, http://server:port/yourapp/faces/TestAction?suite=/suite1.xml and write file:
    * suite1.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <TestSuite>
       <page>/test1.jsp</page>
       <page>/test2.jsp</page>
    </TestSuite> After running this test suite in sun jsf1.0 runtime, the result comes:
    <?xml version="1.0" encoding="UTF-8" ?>
    <Test suite="/suite1.xml">
      <Page id="/test1.jsp">
        <Action id="_id13" time="0 hour(s) 0 minute(s) 0 second(s) 31 millisecond(s)" description="Test Sumbit">
          <Assert id="_id5" description="InputText1">
             <afterUpdateModelValues pass="true" />
          </Assert>
          <Assert id="_id9" description="Input2 Class Name">
             <afterUpdateModelValues pass="true" />
          </Assert>
          <Assert id="_id6" description="InputText1">
             <afterRenderResponse pass="true" />
          </Assert>
          <Assert id="_id10" description="InputText2 value in afterRenderResponse phase">
             <afterRenderResponse pass="true" />
          </Assert>
          <Assert id="_id11" description="InputText2 Style">
             <afterRenderResponse pass="false" />
          </Assert>
        </Action>
      </Page>
      <Page id="/test2.jsp">
      </Page>
    </Test> So far, if you think this idea is good for you, you can get the src code at the end of this post.
    Furthermore, you can make improvement to this as well, such as implement concurrent and repeatable test.
    Anyway, don't expect this two days prototype is quite robust, and coding is not my day to day work either.
    If you have any questions or idea, please drop me a line: [email protected], [email protected]
    *  jsftest.tld
    <?xml version="1.0"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlib-version>1.0</tlib-version>
         <jsp-version>1.2</jsp-version>
         <short-name>test</short-name>
         <uri>http://www.yourcompany.com/jsf/test</uri>
         <display-name>JSF Test Tag Library</display-name>
         <description></description>
         <tag>
              <name>action</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.ActionTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Action</display-name>
              <description>JSF test submit action</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>description</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>     
         <tag>
              <name>assert</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.AssertTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Assert</display-name>
              <description>JSF test assertion</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>actions</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>default value is "all", means all actions, use "," as delimeter</description>
              </attribute>
              <attribute>
                   <name>phase</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>effective value can be anyone of: afterRestoreView,
                                   beforeApplyRequestValues, afterApplyRequestValues,
                                   beforeProcessValidations, afterProcessValidations,
                                   beforeUpdateModelValues,  afterUpdateModelValues,
                                   beforeInvokeApplication,  afterInvokeApplication,
                                   beforeRenderResponse,     afterRenderResponse
                                 The default value is afterRenderResponse, this assertion will be applied to HtmlElement rather than JSF Component.
                            </description>
              </attribute>
              <attribute>
                   <name>value</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>must be boolean, means pass test or not</description>
              </attribute>
              <attribute>
                   <name>var</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>variable name, used to define a request attribute which can be used in valueBinding language</description>
              </attribute>
              <attribute>
                   <name>valueAttribute</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>The default is "value".
                                         var will be bound to this attribute.
                                         var will be bound to the rendered HtmlElement if the phase="afterRenderResponse",
                                         otherwise var will be bound to parent component.
                            </description>
              </attribute>
              <attribute>
                   <name>postback</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>The default is "true".
                                         Currently only support true;
                            </description>
              </attribute>
              <attribute>
                   <name>description</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
         <tag>
              <name>parameter</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.ParameterTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Set</display-name>
              <description>JSF test request parameter setter</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>actions</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>default value is "all", means all actions, use "," as delimeter</description>
              </attribute>
              <attribute>
                   <name>name</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>value</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
         <tag>
              <name>set</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.SetTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Set</display-name>
              <description>JSF test component value setter</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>actions</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>default value is "all", means all actions, use "," as delimeter</description>
              </attribute>
              <attribute>
                   <name>value</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
    </taglib>
    *  faces-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Action</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Action</component-class>
      </component>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Assert</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Assert</component-class>
      </component>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Parameter</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Parameter</component-class>
      </component>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Set</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Set</component-class>
      </component>
      <lifecycle>
          <phase-listener>com.yourcompany.jsf.ui.test.listener.TestPhaseListener</phase-listener>
          <phase-listener>com.yourcompany.jsf.ui.test.listener.TestAssertPhaseListener</phase-listener>
      </lifecycle>
    </faces-config>
    *  TestPhaseListener.java
    package com.yourcompany.jsf.ui.test.listener;
    import java.io.InputStream;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.application.ViewHandler;
    import javax.faces.component.UIComponent;
    import javax.faces.component.UIViewRoot;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    import javax.faces.event.PhaseEvent;
    import javax.faces.event.PhaseId;
    import javax.faces.event.PhaseListener;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import com.meterware.httpunit.HTMLElement;
    import com.meterware.httpunit.PostMethodWebRequest;
    import com.meterware.httpunit.WebConversation;
    import com.meterware.httpunit.WebRequest;
    import com.meterware.httpunit.WebResponse;
    import com.sun.faces.renderkit.html_basic.HtmlResponseWriter;
    import com.yourcompany.jsf.ui.component.UIIterate;
    import com.yourcompany.jsf.ui.test.component.Action;
    import com.yourcompany.jsf.ui.test.component.Assert;
    import com.yourcompany.jsf.ui.test.component.Parameter;
    import com.yourcompany.jsf.ui.test.component.Set;
    import com.yourcompany.jsf.ui.test.report.Constants;
    import com.yourcompany.jsf.ui.test.report.TestAction;
    import com.yourcompany.jsf.ui.test.report.TestAssert;
    import com.yourcompany.jsf.ui.test.report.TestPage;
    import com.yourcompany.jsf.ui.test.report.TestReport;
    import com.yourcompany.jsf.ui.util.ComponentUtil;
    public class TestPhaseListener implements PhaseListener {
         public TestPhaseListener() {
              super();
              // TODO Auto-generated constructor stub
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
         public void afterPhase(PhaseEvent event) {
              if(-1 != event.getFacesContext().getViewRoot().getViewId().indexOf("TestAction")){
                   FacesContext context =      event.getFacesContext();
                   ViewHandler vh = context.getApplication().getViewHandler();
                   HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
                   TestReport report = new TestReport();
                   request.getSession().setAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID, report);
                   String suitefile = request.getParameter("suite");
                   List pages = new ArrayList(5);
                   if(suitefile==null){
                        pages.add(request.getParameter("view"));
                   }else{
                        report.setSuiteId(suitefile);
                        try{
                             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                          factory.setValidating(false);
                          factory.setNamespaceAware(false);
                          DocumentBuilder builder = factory.newDocumentBuilder();
                          InputStream ins = context.getExternalContext().getResourceAsStream(suitefile);
                          Document doc = builder.parse(ins);
                          NodeList pageNodes = doc.getElementsByTagName("page");
                          for(int i=0; i<pageNodes.getLength(); i++){
                               pages.add(((Text)pageNodes.item(i).getFirstChild()).getData());
                        }catch(Exception e){
                             report.setException(e);
                   for(Iterator p=pages.iterator(); p.hasNext(); ){
                        String viewId = (String)p.next();
                        UIViewRoot view = vh.restoreView(context, viewId);
                        if(view==null){
                             try{
                                WebConversation wc = new WebConversation();
                                wc.putCookie("JSESSIONID", request.getSession().getId());
                                String url = getUrl(request, viewId);
                                WebResponse wr = wc.getResponse(url);
                             }catch(Exception e){
                                  report.setException(e);
                             view = vh.restoreView(context, viewId);
                        try{
                             Method doActionMethod = TestPhaseListener.class.getDeclaredMethod("doAction", new Class[]{Action.class, FacesContext.class, HttpServletRequest.class, UIViewRoot.class, String.class});
                             ComponentUtil.iterateComponent(view, Action.class, this, doActionMethod, new Object[]{context, request, view, viewId});
                        }catch(Exception e){
                             report.setException(e);
                   //render report
                   renderReport(context, report);
                   request.getSession().removeAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                   context.responseComplete();
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
         public void beforePhase(PhaseEvent event) {
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#getPhaseId()
         public PhaseId getPhaseId() {
               return PhaseId.RESTORE_VIEW;
         private String getUrl(HttpServletRequest request, String viewId){
              return request.getScheme()+"://" + request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/faces"+viewId;
         protected void doAction(Action action, FacesContext context, HttpServletRequest request, UIViewRoot view, String viewId){
              try{
                      WebConversation wc = new WebConversation();
                      wc.putCookie("JSESSIONID", request.getSession().getId());
                      String url = getUrl(request, viewId);
                      WebRequest wrq = new PostMethodWebRequest(url);
                      wrq.setParameter(Constants.TEST_VIEW_PARAMETER, viewId);
                      wrq.setParameter(Constants.TEST_ACTION_PARAMETER, action.getId());
                      //set parameters
                      try{
                           Method doParameterMethod = TestPhaseListener.class.getDeclaredMethod("doParameter", new Class[]{Parameter.class, String.class, WebRequest.class});
                           ComponentUtil.iterateComponent(view, Parameter.class, this, doParameterMethod, new Object[]{action.getId(), wrq});
                      }catch(Exception e){
                           e.printStackTrace();
                      //set attributes
                      //set values
                      try{
                           Method doSetMethod = TestPhaseListener.class.getDeclaredMethod("doSet", new Class[]{Set.class, FacesContext.class, String.class, WebRequest.class});
                           ComponentUtil.iterateComponent(view, Set.class, this, doSetMethod, new Object[]{context, action.getId(), wrq});
                      }catch(Exception e){
                           e.printStackTrace();
                      //do test actions
                      String formId = null;
                      if(formId!=null)wrq.removeParameter(formId);
                      formId = ComponentUtil.getForm(action).getClientId(context);
                      wrq.setParameter(formId, action.getParent().getClientId(context));
                      long start = System.currentTimeMillis();
                      WebResponse wrp = wc.getResponse(wrq);
                      //System.out.println(wrp.getText());
                      //do assertions
                      try{
                           Method doAssertMethod = TestPhaseListener.class.getDeclaredMethod("doAssert", new Class[]{Assert.class, FacesContext.class, HttpServletRequest.class, String.class, String.class, String.class, WebResponse.class});
                           ComponentUtil.iterateComponent(view, Assert.class, this, doAssertMethod, new Object[]{context, request, viewId, action.getId(), action.getDescription(), wrp});
                      }catch(Exception e){
                           e.printStackTrace();
                      TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                     report.getPage(viewId).getAction(action.getId()).setTime(System.currentTimeMillis()-start);
                   }catch(Exception e){
                        e.printStackTrace();
         protected void doParameter(Parameter parameter, String actionId, WebRequest wrq){
               if("all".equals(parameter.getActions()) || Arrays.asList(parameter.getActions().split(",")).contains(actionId))wrq.setParameter(parameter.getName(), parameter.getValue());
         protected void doSet(Set set, FacesContext context, String actionId, WebRequest wrq){
               if("all".equals(set.getActions()) || Arrays.asList(set.getActions().split(",")).contains(actionId))wrq.setParameter(set.getParent().getClientId(context), set.getValue());
         protected void doAssert(Assert ast, FacesContext context, HttpServletRequest request, String viewId, String actionId, String actionDescription, WebResponse wrp){
              if(("all".equals(ast.getActions()) || Arrays.asList(ast.getActions().split(",")).contains(actionId)) && "afterRenderResponse".equals(ast.getPhase())){
                    TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                    try{
                         HTMLElement targetElement = wrp.getElementWithID(ast.getParent().getClientId(context));
                         if(targetElement==null)targetElement = wrp.getElementsWithName(ast.getParent().getClientId(context))[0];
                         if(targetElement==null)request.setAttribute(ast.getVar(), null);
                         else request.setAttribute(ast.getVar(), targetElement.getAttribute(ast.getValueAttribute()));
                         //report assert
                         report.report(viewId, actionId, actionDescription, ast.getId(), ast.getDescription(), ast.getPhase(), (Boolean)ast.getValue(), null);
                    }catch(Exception e){
                         report.report(viewId, actionId, actionDescription, ast.getId(), ast.getDescription(), ast.getPhase(), Boolean.FALSE, e);
         protected void renderReport(FacesContext context, TestReport report){
              try{
                   HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse();
                   response.setContentType("text/xml; charset=UTF-8");
                   response.setHeader("Cache-Control", "no-cache");
                   ResponseWriter writer = new HtmlResponseWriter(response.getWriter(), null, null);
                   context.setResponseWriter(writer);
                   writer.startDocument();
                   writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
                   writer.startElement("Test", null);
                   if(report.getSuiteId()!=null)writer.writeAttribute("suite", report.getSuiteId(), null);
                   for(Iterator p=report.listPages().iterator(); p.hasNext(); ){
                        TestPage page = (TestPage)p.next();
                        writer.startElement("Page", null);
                        writer.writeAttribute("id", page.getViewId(), null);
                        for(Iterator i=page.listActions().iterator(); i.hasNext(); ){
                             TestAction action = (TestAction)i.next();
                             writer.startElement("Action", null);
                             writer.writeAttribute("id", action.getId(), null);
                             writer.writeAttribute("time", getElapsedTime(action.getTime()), null);
                             if(action.getDescription()!=null)writer.writeAttribute("description", action.getDescription(), null);
                             for(Iterator j=action.getAsserts().values().iterator(); j.hasNext(); ){
                                  TestAssert ast = (TestAssert)j.next();
                                  writer.startElement("Assert", null);
                                  writer.writeAttribute("id", ast.getId(), null);
                                  if(ast.getDescription()!=null)writer.writeAttribute("description", ast.getDescription(), null);
                                  for(Iterator k=ast.getStatus().keySet().iterator(); k.hasNext(); ){
                                       String phase = (String)k.next();
                                       writer.startElement(phase, null);
                                       writer.writeAttribute("pass", ast.getStatus().get(phase).toString(), null);
                                       writer.endElement(phase);
                                  if(ast.getException()!=null){
                                       writer.startElement("Exception", null);
                                       StackTraceElement[] stack = ast.getException().getStackTrace();
                                       for(int m=0; m<stack.length; m++){
                                            writer.write(stack[m].toString());
                                            writer.write("\r\n");
                                       writer.endElement("Exception");
                                  writer.endElement("Assert");
                             if(action.getException()!=null){
                                  writer.startElement("Exception", null);
                                  StackTraceElement[] stack = action.getException().getStackTrace();
                                  for(int m=0; m<stack.length; m++){
                                       writer.write(stack[m].toString());
                                       writer.write("\r\n");
                                  writer.endElement("Exception");
                             writer.endElement("Action");
                        if(page.getException()!=null){
                             writer.startElement("Exception", null);
                             StackTraceElement[] stack = page.getException().getStackTrace();
                             for(int m=0; m<stack.length; m++){
                                  writer.write(stack[m].toString());
                                  writer.write("\r\n");
                             writer.endElement("Exception");
                        writer.endElement("Page");
                   if(report.getException()!=null){
                        writer.startElement("Exception", null);
                        StackTraceElement[] stack = report.getException().getStackTrace();
                        for(int m=0; m<stack.length; m++){
                             writer.write(stack[m].toString());
                             writer.write("\r\n");
                        writer.endElement("Exception");
                   writer.endElement("Test");
                   writer.endDocument();
                   response.getWriter().flush();
                   response.getWriter().close();
              }catch(Exception e){
                   e.printStackTrace();
          public static String getElapsedTime(long millis) {
                   long hours, minutes, seconds, ms;
                   hours = millis / 3600000;
                   millis = millis - (hours * 3600000);
                   minutes = millis / 60000;
                   millis = millis - (minutes * 60000);
                   seconds = millis / 1000;
                   ms = millis - (seconds * 1000);
                   return hours
                        + " hour(s) "
                        + minutes
                        + " minute(s) "
                        + seconds
                        + " second(s) "
                        + ms
                        + " millisecond(s)";
    *  TestAssertPhaseListener.java
    package com.yourcompany.jsf.ui.test.listener;
    import java.lang.reflect.Method;
    import java.util.Arrays;
    import javax.faces.component.UIViewRoot;
    import javax.faces.context.FacesContext;
    import javax.faces.event.PhaseEvent;
    import javax.faces.event.PhaseId;
    import javax.faces.event.PhaseListener;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.commons.beanutils.PropertyUtils;
    import com.yourcompany.jsf.ui.test.component.Assert;
    import com.yourcompany.jsf.ui.test.report.Constants;
    import com.yourcompany.jsf.ui.test.report.TestReport;
    import com.yourcompany.jsf.ui.util.ComponentUtil;
    public class TestAssertPhaseListener implements PhaseListener {
         public TestAssertPhaseListener() {
              super();
              // TODO Auto-generated constructor stub
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
         public void afterPhase(PhaseEvent event) {
              if(PhaseId.RENDER_RESPONSE.equals(event.getPhaseId()))return;
              iterateAssert(event, false);
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
         public void beforePhase(PhaseEvent event) {
              if(PhaseId.RESTORE_VIEW.equals(event.getPhaseId()))return;
              iterateAssert(event, true);
         public PhaseId getPhaseId() {
               return PhaseId.ANY_PHASE;
         protected void iterateAssert(PhaseEvent event, boolean before){
              FacesContext context = event.getFacesContext();
              HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
              String viewId = request.getParameter(Constants.TEST_VIEW_PARAMETER);
              String actionId = request.getParameter(Constants.TEST_ACTION_PARAMETER);
              if(actionId!=null){
                   TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                   UIViewRoot view = context.getViewRoot();
                   if(view==null)return;
                   try{
                        Method doAssertMethod = TestAssertPhaseListener.class.getDeclaredMethod("doAssert", new Class[]{Assert.class, FacesContext.class, HttpServletRequest.class, String.class, String.class, String.class});
                        ComponentUtil.iterateComponent(view, Assert.class, this, doAssertMethod, new Object[]{context, request, viewId, actionId, this.getAssertPhase(event.getPhaseId(), before)});
                   }catch(Exception e){
                        report.getPage(viewId).getAction(actionId).setException(e);
         protected void doAssert(Assert ast, FacesContext context, HttpServletRequest request, String viewId, String actionId, String assertPhase){
               if(("all".equals(ast.getActions()) || Arrays.asList(ast.getActions().split(",")).contains(actionId)) && assertPhase.equals(ast.getPhase())){
                    TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                    try{
                         request.setAttribute(ast.getVar(), PropertyUtils.getProperty(ast.getParent(), ast.getValueAttribute()));
                         //report assert
                         report.report(viewId, actionId, null, ast.getId(), ast.getDescription(), ast.getPhase(), (Boolean)ast.getValue(), null);
                    }catch(Exception e){
                         report.report(viewId, actionId, null, ast.getId(), ast.getDescription(), ast.getPhase(), Boolean.FALSE, e);
         protected String getAssertPhase(PhaseId phaseId, boolean before){
              String perfix = before ? "before" : "after";
              if(PhaseId.RESTORE_VIEW.equals(phaseId))return perfix+"RestoreView";
              if(PhaseId.APPLY_REQUEST_VALUES.equals(phaseId))return perfix+"ApplyRequestValues";
              if(PhaseId.PROCESS_VALIDATIONS.equals(phaseId))return perfix+"ProcessValidations";
              if(PhaseId.UPDATE_MODEL_VALUES.equals(phaseId))return perfix+"UpdateModelValues";
              if(PhaseId.INVOKE_APPLICATION.equals(phaseId))return perfix+"InvokeApplication";
              if(before && PhaseId.RENDER_RESPONSE.equals(phaseId))return "beforeRenderResponse";
              return "";
    *  UIIterate.java
    // This class brings "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    To Neoreborn:
    If I understand right, Shale only provides some mock core JSF objects and extends JUnit so that you can do junit test to your java classes.
    What I concern is to test Pages(JSP) rather than java classes. I want to assert component attribute values within all lifecycle including rendered HTML script. Currently, there isn't any good tools to do this kind of JSP Unit test, am I right?

  • Required Unit test Plan for Data migration

    Dear All,
    I am looking for unit test plan Draft documents/templates which covers
    1. Testing tools
    2. Methods
    3. Error handling
    4. Reviews and approvals
    The project is a Oracle 10g data migration from one schema to another schema.
    It will be a greate help if anyone can forward the same to me.
    Thank you.

    Hi Vaishali,
    You may wish to refer the links below...
    https://service.sap.com/instguides --> SAP NetWeaver --> Release 2004s --> Upgrade
    https://www.sdn.sap.com/irj/sdn/developerareas/bi
    latest on upgrade tp BI7.0
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2e8e5288-0b01-0010-2ea8-bcd4df5084a7
    Upgrading BW 3.X to SAP NetWeaver 2004s BI (PDF 2.6 MB)
    Front End Migration strategy
    Here's the migration strategy: Rolling out the New SAP NetWeaver 2004s BI Frontend Tools
    Presentation
    http://csc-studentweb.lrc.edu/swp/Berg/Articles/PM_2006_upgrade_NW2004s_Bjarne_Berg_v12.ppt
    Here are the frontend requirements:
    Troubleshoot the SAP NetWeaver 2004s BI Frontend Installation
    Here are the backend requirements in the product availabilty matrix:
    https://websmp110.sap-ag.de/~form/handler?_APP=00200682500000001303&_EVENT=DISP_NEW&00200682500000002804=01200615320900001250
    Migration of Web Teplates
    832713 - Migration of Web templates from BW 3.x to Netweaver
    Assign points if this helps.
    Regards,
    Anil

  • Test framework for OSB

    Is there anything similar as the Test Suites in BPEL described here
    http://www.oracle.com/technology/oramag/oracle/07-nov/o67bpel.html
    for the OSB (formerly ALSB)??
    We are looking at some way to execute test cases for OSB flows just like you can in JDev for BPEL.
    thanks

    OSB does not have anything like "TestSuite" you described in above link. But some part of the use case can be accomplished by test console http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/testing.html#wp1052410. The testing can be done using Workshop for OSB (similar to JDEV for BPEL) http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/eclipsehelp/tasks.html#wp1151352. Even though documentation talks about split-join, the same can be applied to any Proxy/Business Service
    Thanks
    Manoj
    Edited by: mneelapu on Dec 22, 2009 9:22 AM

  • Perl unit tests fail for dbxml-2.5.16

    Hi,
    I installed the berkeley db xml version 2.5.16 but while attempting to install perl, I came across the following errors when I run 'make test'
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
    t/btree.t .. 1/35 # Check simple env works with a hash.
    # cursors
    t/btree.t .. ok
    t/dbt.t .... ok
    t/txn.t .... # transaction - commit works
    t/txn.t .... 1/28 # transaction - abort works
    t/txn.t .... ok
    All tests successful.
    Files=3, Tests=73, 1 wallclock secs ( 0.03 usr 0.05 sys + 0.16 cusr 0.17 csys = 0.41 CPU)
    Result: PASS
    make[1]: Leaving directory `/home/emulo/Downloads/install/dbxml-2.5.16/dbxml/src/perl/Db'
    make[1]: Entering directory `/home/emulo/Downloads/install/dbxml-2.5.16/dbxml/src/perl/DbXml'
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
    t/XmlContainerConfig.t ..... 1/28 BDB XML: illegal flag combination specified to DB->open
    XmlException=SCALAR(0x85c0fb4)# Looks like you planned 28 tests but ran 25.
    # Looks like your test exited with 2 just after 25.
    t/XmlContainerConfig.t ..... Dubious, test returned 2 (wstat 512, 0x200)
    Failed 3/28 subtests
    t/XmlDocument.t ............ ok
    t/XmlEvent.t ............... ok
    t/XmlIndexLookup.t ......... ok
    t/XmlIndexSpecification.t .. ok
    t/XmlManager.t ............. 1/92 failed
    Error: The flags DB_READ_UNCOMMITTED and DB_TXN_NOT_DURABLE cannot be used directly, you must set these flags using XmlContainerConfig.setReadUncommitted and XmlContainerConfig.setTransactionNotDurable. in t/XmlManager.t, line 367
    # Looks like you planned 92 tests but ran 53.
    # Looks like your test exited with -1 just after 53.
    t/XmlManager.t ............. Dubious, test returned 255 (wstat 65280, 0xff00)
    Failed 39/92 subtests
    t/XmlQueryContext.t ........ ok
    t/XmlResults.t ............. ok
    t/XmlValue.t ............... ok
    Test Summary Report
    t/XmlContainerConfig.t (Wstat: 512 Tests: 25 Failed: 0)
    Non-zero exit status: 2
    Parse errors: Bad plan. You planned 28 tests but ran 25.
    t/XmlManager.t (Wstat: 65280 Tests: 53 Failed: 0)
    Non-zero exit status: 255
    Parse errors: Bad plan. You planned 92 tests but ran 53.
    Files=9, Tests=535, 5 wallclock secs ( 0.11 usr 0.15 sys + 1.04 cusr 1.51 csys = 2.81 CPU)
    Result: FAIL
    Failed 2/9 test programs. 0/535 subtests failed.
    Any idea what could be causing this?
    Edited by: 902499 on Jul 5, 2012 12:59 AM

    Hi Michael,
    Thanks for the patch! We'll take a look at that and try to improve the Perl installation in the next release.
    John

  • Unit Test Framework Bug: Removing a test vector file causes LV to crash

    Labview 2010 f2 crashes every time I try to remove a test vector file from a project.
    Repro:
    1. Start Labview and open a new project.
    2. Save the project.
    3. Right-click My Computer and select New -> Test Vectors
    4. Right-click the new file (Untitled.lvvect) and select Remove From Project
    I've tried various combinations of renaming the test vector file, trying multiple vector files, etc., but the end result is the same.  LV always crashes when I try to remove the vector file from the project.  LV crashes when I try to remove it even if I delete the vector file from disk before loading it from disk.  The only way I can remove a vector file from a project once the project has been saved is by editing the .lvproj file directly.

    Update:  I believe the last error is a different issue.  I was able to narrow the error down to a specific library and generate some error logs.  That library hasn't had any code changes in over a month.  The error logs point to something in the f2 patch, which I installed last Thursday.  Unfortunately there doesn't appear to be any way to uninstall the patch.
    I can send the guilty code via email or ftp if you need them.
    Attachments:
    lvlog2010-11-03-11-12-03.txt ‏6 KB
    lvlog2010-11-03-12-00-02.txt ‏4 KB

  • Better UI for Unit Tests

    I've been doing a lot of unit tests lately.  Right now I'm working on a code converter Air app and I'm constantly creating unit tests for bugs I'm finding and running them, and debugging them when they don't work.  When I debug, it's easiest to isolate the runner to run only one test.  I know I can do that by editing the source file and typing in the test name in the core.run call.  However, I can't help by think a better UI is needed for doing this form for TestDriven Development. 
    Basically, what I think would be perfect, is to have the UI, not run the tests initially.  It should provide you with a list of tests with checkboxes.  Then give you the opportunity to select which ones you want to run, and then run them.  It should also have the ability to re-run a test.  I realize that for any code changes to take affect you would need to re-run the entire app, but a lot of times, I find myself running the same test over and over and stepping through the code with the debugger in order to figure out what's going on.  Then I eventually change the code.
    Also, the new UI should persist the last set of selected tests, and maybe have a way to store previous selections.  That would make it perfect for how I use it. 
    Does anyone agree or disagree with this?  Has someone done this already?
    BTW, the reason I'm using the stand alone runner and not the one in Flash Builder 4 is because I've run into some bugs with the FlexUnit shipped with Flash Builder 4 and there doesn't seem to be a way to get the latest FlexUnit 4.1 to work properly with Flash Builder 4.  There seems to be a way to do it with Flash Builder 4.5, but I don't have that version.
    Thanks,
    Mark

    On 05/08/2012 03:56 PM, prakash jv wrote:
    > We have been looking for unit test framework for unit testing SWT
    > components in our RCP application developed in eclipse galileo 3.5.
    >
    > We found SWTBot supports the better UI testing and wanted to additional
    > details reagrding its support for maven 2.2.1.
    >
    > Does SWTBot work with projects which are mavenized with maven 2.2.1?
    >
    > Our aim of adding the unit tests for UI components is for better build
    > quality. So we would want these Unit tests to be run everytime we build
    > our assembly. As of now we use Junit4 for running our JUnits and they
    > run with maven outside eclipse.
    >
    > Does SWTBot support running the UI unit tests outside eclipse using maven?
    Hi
    in
    http://code.google.com/a/eclipselabs.org/p/emf-components/
    we run swtbot tests with maven/tycho
    hope this helps
    cheers
    Lorenzo
    Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
    ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
    HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
    http://www.myspace.com/supertrouperabba
    BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
    http://www.gnu.org/software/src-highlite
    http://www.gnu.org/software/gengetopt
    http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net

  • Unit testing? help.

    OK, I have tried to rap my mind around this for a few days. Unit testing.
    I understand the whole:
    if(expected)
    System.out.println("OK");
    else System.out.println("Error");Part of my class assignment but, I am still confused. Could someone explain how unit testing works? (*No, I don't want you to do it for me or anything like that.*) I am just confused on how exactly to test for these things in Java. I understand that I need to add some kind of input then check the return value with what is expected. However, I am not sure how to implement it.
    Currently I tried something:
    public static void lastIndexOfTest(MyString ms, int pos, char expected){
              System.out.println("Testing lastIndexOf("+pos+") on MyString " + ms);
              System.out.println("Expected: " + expected);
              try{
                   int got = ms.charAt(pos);
                   System.out.println("Got: " + got);
                   if(got == expected)
                        System.out.println("OK");
                   else
                        System.out.println("Error2");
              catch(Exception e) {
                   System.out.println("Error: " + e);
              }That works in the sense that it give me no errors. But, because I don't understand how the code works exactly for everything I am not sure at all if it is even returning something thats correct.
    Here is my assignment:
    http://www.csl.mtu.edu/cs1122/www/programs/prog1/desc.html
    Are there any tutorials on how to do unit testing? I have been looking all over and can't seem to find any listed on Google.

    shawnw wrote:
    OK, I have tried to rap my mind around this for a few days. Unit testing."Unit" == "one thing". You're testing each individual part of your program that can be considered a single functional unit (not necessarily a single class).
    Although I've heard people say "unit testing" to apply to just about everything.
    That works in the sense that it give me no errors. But, because I don't understand how the code works exactly for everything I am not sure at all if it is even returning something thats correct.Well, obviously, knowing what's correct is necessary before you can test for correctness.
    Typically, you introduce specific test data to the thing being tested, and you know the correct response for that test data.
    For example if you're testing a factorial program, you know that 3! == 6.
    If you have a bit of (your own code) and you don't know what correct behavior of that code is, then you're not done. Really you shouldn't have started coding if you didn't know what you were trying to accomplish when you were done.
    In test-driven development, you write the test before you write the code. Among other things, this ensures that you know what a bit of code is supposed to accomplish before you even start, which is a good thing.
    Here is my assignment:
    http://www.csl.mtu.edu/cs1122/www/programs/prog1/desc.html
    Are there any tutorials on how to do unit testing? Didn't your professor mention it in class?
    I have been looking all over and can't seem to find any listed on Google.I find that hard to believe. If I Google "unit testing tutorial" I find a bunch. But several of those are specific to particular environments, so maybe that's what's throwing you off.
    The canonical unit testing framework for Java is JUnit. You might want to google for JUnit tutorials (I just did and found some).

  • Hi Experts, need an example for abap unit test(ABAP OO)?

    Hi Experts,
    I want to do abap unit test for the developed programs, could anyone please give me an example program of development(a simple is ok, just use it to test)? and an abap unit test example for the program, what I want is to use object oriented abap, thanks in advance!
    Merry Christmas to you all.
    Kind regards
    Dawson

    Hi
    Below documents will give you more information,
    http://help.sap.com/saphelp_nw04/helpdata/en/a2/8a1b602e858645b8aac1559b638ea4/content.htm
    ABAP Testing and Troubleshooting [original link is broken]
    http://bi.offis.de/publicProject/g16cglafhqva.htm
    regards
    Nagaraju

  • Duplicate control label preventing creation of unit test using UTF

    Hello Everyone,
                       I was trying to create a unit test for a VI using the unit test framework (evaluation version) to try out this tool.  I have two questions regarding that.
    1. Several sub-VIs are called by this VI. I wanted to create a unit test for each of these sub-VIs so that I could test each of them separately. But UTF provided me with the option to create a unit test for the main VI alone. The main VI is huge and getting 100% code coverage is going to be a challenging task. Is there a way by which I can create unit tests for the individual sub-VIs?
    2. When I tried to create the unit test for the main VI, I got an error saying: Cannot create a test from this VI. Contains the following duplicate control labels. This is because the same indicators are being used in different cases within a case structure.
    Is there anyway to resolve this issue?
    Thanks

    If I understand what the problem is you have to controls or indicators that have the same name. To fix this you need to give them unique names. If they need to say the same thing on the user interface then you can use the caption and change the name on that so they both have the same name.
    Tim
    Johnson Controls
    Holland Michigan

Maybe you are looking for

  • OBIEE 11G Installation on Windows XP Platform

    Is it possible to install OBIEE11G in a XP machine with a configuration core i5 4GB RAM? I would like to know more on the performance and the possible issues.

  • Question about memory upgrade on Satellite L20-181

    Hi, there The minimum recommended memory for Windwows XP is 256 Mb and I do not understand how the company could get away selling notebook with 256 MB with built-in graphic adapter sharing the system memory. Anyway, I want to upgrade my Toshiba and m

  • CR 2008, missing parameter values in parameter list

    somehow this thread got posted in the  .NET SDK section, so re-posting here... When my users run the report, the list of values in the paramter list does not include all the possible values that exist in the view on SQL server. How can I get ALL the

  • Removing Space within JTabbedPane

    Hi everyone. It seems that whenever I add a component to a JTabbedPane, the component is maximized, but there's still a small space around the component that seperates it from its tab. Does anyone know how to remove this small space? Thanks. Jon

  • ODAC driver 11.2.0.2.1 compatible with windows xp profession service pack 3

    Dear all, I am looking at the online system requirement for ODAC driver 11.2.0.2.1 and bascially it says it is compatible with windows xp, but it doesnt specific whether it is compatible with windows xp service 3. Can we assume it is equally compatib