Trouble Running Unit Tests on Device

I am having trouble running multiple unit test on my device. I am using JMUnit as part of NetBeans IDE 5.5.1. I can get the tests running in the emulator but when I try them on the phone they don't work. Under my project's properties->Application Descriptor->MIDlets->MIDlets in the Suite, the 'jmunit.framework.cldc11.TestSuite' comes up in red with the error 'Some MIDlet classes are invalid'. I am using CDLC 1.1 and MIDP 2.0. Any ideas?

wegunterjrASI, 
I have a few follow up questions for you to gain a better understanding of your application: 
1). What are you using to do the unit test (NI’s unit test framework or VI tester from JKI)?
2). What are you conducting the unit test on (RT Driver or something on the host machine)? 
3). Are the unit test VIs under the target in the LabVIEW project? 
4). Are you able to run a simple unit test? 
Screenshots are always appreciated. 
Regards, 
 

Similar Messages

  • Error when running unit tests

    Hi,
    I'm getting the error 'Marker id <num> not found' about 9 times out of 10 when I try to run unit tests in Flash Builder 4.5 Premium. This is happening on a new (2 weeks old) spark + mx project, with the unit test classes created in Flash Builder using the built-in tools. Using Run As or Debug does not seem to make a difference to whether the error occurs or not. I have to just keep retrying until it runs correctly.
    I am using the AS Code Coverage plugin and the FlexUnit 4.1.
    Please help as this is driving me mad!
    Thanks,
    Adam

    Here you go.  Looks like it shrunk down the libraries image though.

  • Using FB 4.7 Premium cannot run unit tests

    I have a licensed version of 4.7 Premium but cannot run unit tests. The message I get says "This feature requires a Flash Builder Premium License".
    I have uninstalled Fb 4.7 and then downloaded and reinstalled. Still the same issue.
    I have verified I am running FB 4.7 Premium with this code snippet.
    if (Class(this.systemManager.getDefinitionByName("licence.LicenseHandler ")))
         Alert.show("This SWF was compiled WITHOUT a Flash Builder Pro license")
    else
         Alert.show("This SWF was compiled WITH a Flash Builder Pro license")

    Hello, anybody still answering posts here or is everybody just working on MAX?!

  • Running Unit Test from test manager that run bat file from command line

    Hi ,
    I am trying to run Jsystem (java framewotk) from command line using runScenario.bat thru unit test that i associated to test in test manager.
    the idea is that when i ran the automated test  from MTM - it will run the the unit test that will run the appropriate test case in java.
    i wrote the code like this : 
    using System;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    namespace UnitTestProject3
    [TestClass]
    public class UnitTest1
    [TestMethod]
    public void TestMethod1()
    try
    String command = "c:\\JSYSTEM\\runner\\runScenario.bat
    c:\\Users\\ryeshua\\Source\\Workspaces\\Auto1\\my-tests-project\\target\\classes scenarios\\feature1 RoeySetup.xml ";
    System.Diagnostics.ProcessStartInfo procStartInfo =
    new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
    procStartInfo.RedirectStandardOutput = true;
    procStartInfo.UseShellExecute = false;
    //procStartInfo.CreateNoWindow = true;
    System.Diagnostics.Process proc = new System.Diagnostics.Process();
    proc.StartInfo = procStartInfo;
    proc.Start();
    string result = proc.StandardOutput.ReadToEnd();
    Console.WriteLine(result);
    catch (Exception objException)
    // Log the exception
    and when i ran it from visual studio it worked perfect. and update  the Jsystem logs of the junit test in the jsystem/runner/log folder.
    but when i added it to associated test and ran it from MTM - it pass but it does not update  the logs in jsystem folder.
    the problem that i dont know what is not working. i cant see the output of it when i ran from mtm but can see when i ran from VS.
    i am using VS 2013 Pro with MTM 2013.
    please advice
    Roey

    Hi Roey,
    Thank you for posting in MSDN forum.
    Based on your issue, could you please tell me how you generate the log file under the jsystem folder?
    Generally, I know that when we run unit test from VS IDE, the file will be saved into the local machine. But when we run unit test from MTM, the unit test method will be run on the test agent machine, so the file will be saved into the test agent machine.
    Therefore, I suggest you could check if you did not see the updated logs file in jsystem folder on the test agent machine.
    In addition, I suggest you could try to copy this unit test project on this test agent machine and then run the unit test method using mstest.exe in command line and then check if you can update the logs file.
    https://msdn.microsoft.com/en-us/library/ms182489.aspx?f=255&MSPPError=-2147217396
    If you have any updated message about this issue, please tell me.
    Best Regards,
    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.

  • Running unit tests on inline hardware custom device

    How to do unit tests for Inline Hardware Custom Devices?
    I get this error after creating a unit test.
    Possible reason(s):
    Cannot connect to the target. Please ensure that the VI Server setting is enabled and deployed to the target. Also, make sure that the port number is correct and that this machine is allowed to connect through VI Server.

    wegunterjrASI, 
    I have a few follow up questions for you to gain a better understanding of your application: 
    1). What are you using to do the unit test (NI’s unit test framework or VI tester from JKI)?
    2). What are you conducting the unit test on (RT Driver or something on the host machine)? 
    3). Are the unit test VIs under the target in the LabVIEW project? 
    4). Are you able to run a simple unit test? 
    Screenshots are always appreciated. 
    Regards, 
     

  • Got an eror while running unit tests on jsf.

    Hi
    i checked the latest verison from cvs and also downloaded the latest build of glassfish for linux.
    While trying to run the unt tests, i got the followig error when i ran "test.appserver" under jsf-ri.
    i made sure that the server was runing at the time when i ran the test and have the correct versions of cactus,junit and html-unit.But the test resulted in the folowing error:
    run.cactus.test.appserver:
    deploy:
    [copy] Copying 1 file to /home/kc161609/glassfish/domains/domain1/autodeploy
    run.cactus.test:
    [junit] Running com.sun.faces.application.TestActionListenerImpl
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 9.755 sec
    [junit] Testsuite: com.sun.faces.application.TestActionListenerImpl
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 9.755 sec
    [junit] Testcase: testProcessAction took 5.845 sec
    [junit] Caused an ERROR
    [junit] (java.lang.reflect.ReflectPermission suppressAccessChecks)
    [junit] at com.sun.faces.cactus.TestingUtil.invokePrivateMethod(TestingUtil.java:48)
    [junit] at com.sun.faces.cactus.StoreServletContext.setServletContext(StoreServletContext.java:58)
    [junit] at com.sun.faces.cactus.FacesTestCaseService.setUp(FacesTestCaseService.java:147)
    [junit] at com.sun.faces.cactus.ServletFacesTestCase.setUp(ServletFacesTestCase.java:160)
    [junit] at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
    [junit] at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
    [junit] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
    [junit] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
    [junit] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
    [junit] at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
    [junit] at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
    [junit] at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
    [junit] at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
    [junit] at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
    [junit] at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
    [junit] at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
    [junit] at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit] at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:256)
    [junit] at java.security.AccessController.doPrivileged(Native Method)
    [junit] at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    [junit] at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:289)
    [junit] at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:172)
    [junit] at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:384)
    [junit] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:273)
    [junit] at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:560)
    [junit] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:530)
    [junit] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:234)
    [junit] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
    [junit] at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:560)
    [junit] at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
    [junit] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    [junit] at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:560)
    [junit] at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:118)
    [junit] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    [junit] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:131)
    [junit] at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:560)
    [junit] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:530)
    [junit] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    [junit] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:214)
    [junit] at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:569)
    [junit] at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:350)
    [junit] at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:243)
    [junit] at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:248)
    [junit] at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:73)
    [junit] Caused by: java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
    [junit] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    [junit] at java.security.AccessController.checkPermission(AccessController.java:427)
    [junit] at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    [junit] at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:107)
    [junit] at com.sun.faces.cactus.TestingUtil.invokePrivateMethod(TestingUtil.java:45)
    [junit] ... 48 more
    BUILD FAILED
    /home/kc161609/javaserverfaces-sources/jsf-ri/build.xml:820: The following error occurred while executing this line:
    /home/kc161609/javaserverfaces-sources/jsf-ri/build-tests.xml:452: The following error occurred while executing this line:
    /home/kc161609/javaserverfaces-sources/jsf-ri/build-tests.xml:338: Test com.sun.faces.application.TestActionListenerImpl failed
    Total time: 2 minutes 27 seconds
    There is some "access denied exception"
    (java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
    [junit] java.lang.RuntimeException: java.security.AccessControlException: access denied")
    I think there is no problem with the build or the machine .I'm not sure what that problem is well,so please help me out with this error.
    Thanks
    Srinivas

    Hi,
    You got these errors because runInstaller can not start the GUI. There are 2 solutions, you can choose one:
    1. logout Gnome/Kde, login as oracle user, and run runInstaller again.
    2.open a new root terminal,
    a) run "xhost +" as root.
    b) run "su - oracle" switch to oracle
    c) run "export DISPLAY=:0.0"
    d) then run "./runInstaller" again.
    cheers.
    Ice

  • Run unit test in comand line

    Hello everybody,
    I try to run existing unit test in comand line:
    ututil -run -test -name ROW_COUNT -repo unit_test_repos -db finch
    where
    ROW_COUNT - simple unit test
    unit_test_repos - unit test repository, which i create using tutorial (http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev/r30/sqldev_unit_test/sqldev_unit_test_otn.htm)
    finch - owner of procedure, which i try to test
    after execution this command i receive this message:
    C:\sqldeveloper\sqldeveloper\bin>ututil -run -test -name ROW_COUNT -repo unit_test_repos -db finch
    SEVERE Error: No Repository was found on the selected connection, you need to create a repository. - oracle.dbtools.unit_test.UtRepositoryManager.openConnectionWithChecks(UtRepositoryManager.java:214)
    Unable to open repositoryafter that i try to execute command with another parametres (instead of finch i use sys-user), but receive equal result.
    what`s wrong?
    in Help document i find next:
    The following example runs a unit test named AWARD_BONUS in a Windows environment where SQL Developer is installed under Program Files. (Note that test and suite names are case sensitive for the command-line interface.) This example uses the repository connection for user unit_test_repos and runs the test as user fred.
    cd c:\Program Files\sqldeveloper\sqldeveloper\bin
    ututil -run -test -name AWARD_BONUS -repo unit_test_repos -db fred"
    fred is connection which exist in oracle sql developer interface? what kind of privilegies should fred has?
    In oracle sql deevloper exist several connection to another servers. i`t can be reason of error?
    I trying in oracle sql developer interface select finch as manager of unit tests (tools - unit_test - manage_users to the next i select in dropdown list "finch" and granted needed privilegies for him) , but result was`t changed.
    thanks.

    It looks like you need to spark up SQL Developer, create a repository connection and assign that in the Unit Test Menu. It will walk you through creating the repository and then you can refer to that from the command line.

  • Trouble w unit test code

    this code compiles fine, but my unit tests starting with the lines
    public static class AllTests extends TestCase {
    are failing with a null pointer exception. i was advised that
    '>
    The testCreateAccount is failing because you're using a local variable,newAccount,
    in the setUp method(), which has the same name as the class instance variable,newAccount.
    Since the testCreateAccount uses the class instance variable, it is null.
    protected void setUp() {
    anAccountServiceImpl = new AccountServiceImpl();
    AccountEntryStruct newAccount = new AccountEntryStruct();'-so i changed all instances of newAccount to newAccount2 in my unit tests (you
    will see towards
    the bottom of my code). it looks like the testCreateAccount method is still
    using a
    null value. i'm not sure if i'm following the advice correctly...
    code is below:
    // AccountServiceImpl.java: The AccountService Implementation
    package com.kafein.accountServices;
    import java.util.Hashtable;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import junit.framework.TestCase;
    import junit.framework.Test;
    import junit.framework.TestSuite;
    import org.omg.PortableServer.*;
    import com.kafein.idl.accountServices.AccountServicePOA;
    import com.kafein.idl.accountServices.AccountEntryStruct;
    import com.kafein.idl.accountServices.AccountStruct;
    import com.kafein.idl.utilities.DateTimeStruct;
    import com.kafein.idl.exceptions.NotFoundException;
    import com.kafein.idl.exceptions.DataValidationException;
    import com.kafein.idl.errorCodes.DataValidationErrorCodes;
    import com.kafein.utils.ServiceHandler;
    import com.kafein.utils.Log;
    public class AccountServiceImpl extends AccountServicePOA {
    POA poa;
    private Hashtable accounts = new Hashtable(); // collection of Accounts
    private static int nextAccountID = 1; // global account ID
    * Construct an instance.
    public AccountServiceImpl(POA aPOA) {
    super();
    poa = aPOA;
    * Overloaded constructor for unit tests.
    protected AccountServiceImpl() {
    poa = null;
    * createAccount is used by administrator to add a new Account
    * in the system.
    * @param newAccount AccountEntryStruct containing data for new account
    * @return int the new unique Account ID
    * @exception com.kafein.idl.exceptions.DataValidationException
    public int createAccount(AccountEntryStruct newAccount) throws
    DataValidationException {
    validateData (newAccount); // throws DataValidationException;
    int accountID = getNextID();
    // Create new Account.
    Account anAccount = new Account(accountID,
    newAccount.userName,
    newAccount.userEmail,
    newAccount.creditCardType,
    newAccount.creditCardNumber,
    newAccount.creditCardExpirationDate.year,
    newAccount.creditCardExpirationDate.month,
    newAccount.userPassword,
    newAccount.initialBalance);
    accounts.put(accountID,anAccount);
    return accountID;
    * isAccountValid is used to validate a user logon.
    * @param accountID AccountID
    * @param userPassword String
    * @return boolean true to indicate an existing Account
    public boolean isValidAccount (int accountID, String userPassword) {
    // Get account with key equal to accountID.
    AccountStruct anAccount;
    try {
    anAccount = (AccountStruct) getAccount (accountID);
    catch (NotFoundException e) {
    return false;
    // Verify password.
    return (anAccount.userPassword.equals(userPassword) ? true : false);
    * getAccount is used to retrieve an existing Account in the system
    * @param int AccountID
    * @return AccountStruct containing data for the existing Account
    * @exception com.kafein.idl.exceptions.NotFoundException
    public AccountStruct getAccount(int accountID)throws
    NotFoundException {
    // Verify that accountID is within an appropriate interval.
    if (accountID < 1 || accountID > accounts.size()) {
    throw new NotFoundException(DataValidationErrorCodes.INVALID_ACCOUNT_ID,
    "Account ID not found");
    // Get Account and convert to AccountStruct (which is returned).
    Account anAccount = (Account) accounts.get(accountID);
    return anAccount.getAccountStruct();
    * getAllAccounts is used to retrieve all existing Accounts in the system
    * @return AccountStruct[] containing all existing Accounts.
    * @fyi returns an empty sequence if no Accounts exist
    public AccountStruct[] getAllAccounts() {
    // Allocate the array of AccountStructs.
    int lastKey = accounts.size();
    AccountStruct[] accountSequence = new AccountStruct[lastKey];
    if (lastKey==0) {
    return accountSequence;
    // DAR:Sort accounts by accountID (int).
    // Create AccountStructs from Accounts.
    for (int i = 1; i <= lastKey; i++) {
    Account anAccount = (Account) accounts.get(i);
    accountSequence[i-1] = anAccount.getAccountStruct();
    return accountSequence;
    * validateData is used to check new account data.
    * @param newAccount AccountEntryStruct containing data for new account
    * @exception com.kafein.idl.exceptions.DataValidationException
    protected void validateData(AccountEntryStruct newAccount) throws
    DataValidationException {
    // Check all of the member data in newAccount.
    if (newAccount.userName.equals("")) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_USER_NAME,
    "User Name must not be empty");
    if (newAccount.userEmail.equals("")) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_USER_EMAIL,
    "User Email must not be empty");
    if (newAccount.creditCardType.equals("")) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_CREDIT_CARD_TYPE,
    "Credit card type must not be empty");
    if (newAccount.creditCardNumber.equals("")) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_CREDIT_CARD_NUMBER,
    "Credit card number must not be empty");
    // Compare creditCardExpirationDate to current date
    // (we only consider year and month).
    GregorianCalendar now = new GregorianCalendar();
    DateTimeStruct proposed = newAccount.creditCardExpirationDate;
    if (proposed.year < now.get (Calendar.YEAR) ||
    (proposed.year == now.get (Calendar.YEAR) &&
    proposed.month < now.get (Calendar.MONTH) + 1)) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_CREDIT_CARD_EXPIRATION_DATE,
    "Credit card has expired");
    if (newAccount.userPassword.equals("")) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_USER_PASSWORD,
    "Password must not be empty");
    else if
    (!newAccount.userPassword.equals(newAccount.userPasswordVerification)) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_USER_PASSWORD,
    "Password verification failure");
    if (newAccount.initialBalance < 0.0F) {
    throw new DataValidationException(
    DataValidationErrorCodes.INVALID_BALANCE,
    "Account Balance cannot have a negative balance");
    * getNextID is used to generate a unique ID.
    * Needs a much better implementation that generates a globally unique ID!
    * @return int an Account ID
    protected synchronized int getNextID() {
    nextAccountID++;
    return nextAccountID - 1;
    * override defaultPOA to return this servant's POA, not Root POA
    public POA defaultPOA() {
    return poa;
    * AllTests is used for unit testing the AccountServiceImpl Class. It
    extends the
    * JUnit testing framework's TestCase class.
    * To execute in graphic mode:
    * java junit.swingui.TestRunner
    com.kafein.accountServices.AccountServiceImpl$AllTests
    * To execute in text mode:
    * java com.kafein.accountServices.AccountServiceImpl$AllTests
    public static class AllTests extends TestCase {
    private AccountServiceImpl anAccountServiceImpl;
    private Hashtable accounts = new Hashtable();
    private Account anAccount;
    private AccountEntryStruct newAccount2;
    public AllTests(String name) {
    super(name);
    protected void setUp() {
    anAccountServiceImpl = new AccountServiceImpl();
    AccountEntryStruct newAccount2 = new AccountEntryStruct();
    newAccount2.userName = "testName";
    newAccount2.userEmail = "test@email";
    newAccount2.creditCardType = "testCreditCardType";
    newAccount2.creditCardNumber = "0123456789";
    newAccount2.creditCardExpirationDate = new DateTimeStruct();
    newAccount2.creditCardExpirationDate.year = 2005;
    newAccount2.creditCardExpirationDate.month = 6;
    newAccount2.creditCardExpirationDate.day = -1; // not applicable data
    newAccount2.creditCardExpirationDate.hour = -1;
    newAccount2.creditCardExpirationDate.minute = -1;
    newAccount2.userPassword = "kafein";
    newAccount2.userPasswordVerification = "kafein";
    newAccount2.initialBalance = 0.0F;
    protected void tearDown() {
    public static void main (String[] args) {
    junit.textui.TestRunner.run(suite());
    public static Test suite() {
    return new TestSuite(AllTests.class);
    public void testGetAllAccountsSizeZero() {
    AccountStruct[] results =
    anAccountServiceImpl.getAllAccounts();
    assertTrue(results != null);
    assertTrue(results.length == 0);
    public void testCreateAccount() {
    try {
    int testAccountID = anAccountServiceImpl.createAccount(newAccount2);
    //fail(); // shouldn't get here
    assertTrue(testAccountID == 1);
    AccountStruct[] results = anAccountServiceImpl.getAllAccounts();
    assertTrue(results[0].userName.equals("testName"));
    assertTrue(anAccountServiceImpl.isValidAccount(1, "kafein"));
    } catch(DataValidationException e) {
    public void testGetAllAccounts() {
    AccountStruct[] results = anAccountServiceImpl.getAllAccounts();
    assertTrue(results[0].userName.equals("testName"));
    public void testIsValidAccount() {
    assertTrue(anAccountServiceImpl.isValidAccount(1, "kafein"));
    }

    thanks again all
    my code now looks like
            public static class AllTests extends TestCase {
              private AccountServiceImpl anAccountServiceImpl;
              private Hashtable accounts = new Hashtable();
              private Account anAccount;
              private AccountEntryStruct newAccount2;
              public AllTests(String name) {
                            super(name);
                    protected void setUp() {
              anAccountServiceImpl = new AccountServiceImpl();
              newAccount2 = new AccountEntryStruct();
              newAccount2.userName = "testName";
                    newAccount2.userEmail = "test@email";
                    newAccount2.creditCardType = "testCreditCardType";
                   newAccount2.creditCardNumber = "0123456789";
                    newAccount2.creditCardExpirationDate = new DateTimeStruct();
                    newAccount2.creditCardExpirationDate.year = 2005;
                    newAccount2.creditCardExpirationDate.month = 6;
                    newAccount2.creditCardExpirationDate.day = -1; // not applicable data
                    newAccount2.creditCardExpirationDate.hour = -1;
                    newAccount2.creditCardExpirationDate.minute = -1;
                    newAccount2.userPassword = "kafein";
                    newAccount2.userPasswordVerification = "kafein";
                    newAccount2.initialBalance = 0.0F;
                    protected void tearDown() {
                    public static void main (String[] args) {
                            junit.textui.TestRunner.run(suite());
                    public static Test suite() {
                            return new TestSuite(AllTests.class);
              public void testGetAllAccountsSizeZero() {
                        AccountStruct[] results = anAccountServiceImpl.getAllAccounts();
                        assertTrue(results != null);
                        assertTrue(results.length == 0);
                    public void testCreateAccount() {
                    try {
              int testAccountID = anAccountServiceImpl.createAccount(newAccount2);
              assertTrue(testAccountID == 1);
              AccountStruct[] results = anAccountServiceImpl.getAllAccounts();
              assertTrue(results[0].userName.equals("testName"));
              assertTrue(anAccountServiceImpl.isValidAccount(1, "kafein"));
                      //fail(); // shouldn't get here
              } catch(DataValidationException e) {
                    public void testGetAllAccounts() {
              AccountStruct[] results = anAccountServiceImpl.getAllAccounts();
              assertTrue(results[0].userName.equals("testName"));
                    public void testIsValidAccount() {
              assertTrue(anAccountServiceImpl.isValidAccount(1, "kafein"));
    }-it compiles cleanly. unit tests testGetAllAccounts() and testIsValidAccount() are failing still, however. i'm not sure how to initialize the struct outside of the setUp method and have the struct be available to methods outside of setUp()

  • SQLDEV 2.1.0.63 gives ORA-904 on UT_TEST_RESULTS when running unit test

    Hi, I am trying to create and run my first unit test using sqldeveloper 2.1.0.63 but it fails with followkng error:
    ----- Error Stack Dump -----
    ORA-00904: "TEST_USER_NAME": invalid identifier
    ----- Current SQL Statement for this session (sql_id=b9c4zd8fqmykv) -----
    select utr_id, name, status, message, run_date,coverage,test_user_name from ut_test_results where ut_id = :ID order by run_date desc
    table ut_test_results indeed does not have this column test_user_name:
    SYS@madlnlcs11/map SQL> DESC UT_SP5.UT_TEST_RESULTS
    Name Null? Type
    UTR_ID NOT NULL VARCHAR2(40)
    UT_ID NOT NULL VARCHAR2(40)
    NAME NOT NULL VARCHAR2(120)
    STATUS NOT NULL VARCHAR2(20)
    MESSAGE VARCHAR2(2000)
    COVERAGE NOT NULL NUMBER(1)
    RUN_DATE NOT NULL TIMESTAMP(6)
    CREATED_ON NOT NULL TIMESTAMP(6)
    CREATED_BY NOT NULL VARCHAR2(120)
    UPDATED_ON NOT NULL TIMESTAMP(6)
    UPDATED_BY NOT NULL VARCHAR2(120)
    how come there's this mismatch? The Unitest repository was created by the same sqldeveloper !
    regards,
    Andre

    This seems to be coming from the repository being marked as Shared repository. Appearantly sqldeveloper is issueing a different query, referencing TEST_USER_NAME, in that case. After I did a DESELECT AS SHARED REPOSITORY and drop/recreate of the repository the error ORA-904 no longer occurs.

  • Visual Studio locks when bringing up "Run Unit Test" vs2013

    2013 Visual studio 2013.
    I had been running a few simple unit tests on a large project.   Then 2013 stopped responding and said  -- please contact Microsoft.
    most time the test explore never comes up.  I tried the test with a tiny project .  still same issue
    this is my tiny project
     Using System.Configuration;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    namespace UnitTestProject1
        [TestClass]
        public class UnitTest1
            [TestMethod]
            public void TestMethod1()
                Assert.AreEqual(1,1);
            [TestMethod]
            public void TestMethod2()
                Assert.AreEqual(2, 1);
    Howard Davis

    Hi Howard Davis,
    Could you tell us the real VS2013 version you were using? We have to make sure that it supports the unit test project.
    >>most time the test explore never comes up.  I tried the test with a tiny project .  still same issue
    We could open the test explorer window under Test menu->Windows.
    Before you run your test, please clean and rebuild your test project, and make sure no any warning or error, and then run it from the test explorer window, check the result.
    In addition, you would check your task manager, and make sure that it is free before you run your tests. I mean that we have to make sure that it is not the performance issue.
    But if a simple Assert method still doesn't work in your side, I doubt that it is your VS IDE issue.
    Run your VS as the admin, check the result.
    If possible, please repair your VS, please also install the VS2013 update 4, and then create a new test project, check the result.
    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.

  • Trouble running hardware test on 07 iMac with noisy fan

    Hello
    I have an 07 iMac with a noisy fan- I've tried vacuuming out dust from the back but want to avoid taking it apart if possible...
    I read online I should run the hardware test, but since I am running Mavericks the Apple support advice is to run the original OS X install disc and restart (holding down D or Option+D)...
    Long story short I got a replacement disc from Apple (I'd lost the original) but the iMac ejects it when I restart following the process above... could it be my bluetooth keyboard? Hopefully not since I no longer have the original hardwired one... or does anyone have any other ideas for either how to get to the hardware test... or fix the fan (without a third party app just stopping it)
    Thanks!

    Try holding down the Option key to get the one time boot manager screen then select the AHT. Not sure as Apple moved it around on different install discs but it might be on the Applications discs and not the OS X discs.

  • Does new type of unit testing in Flash Builder4 support ANT task ?

    Hi,
    I am using the new way of creating unit tests following this page http://help.adobe.com/en_US/flashbuilder/using/WS27ECA937-059A-4308-A2E2-F3A3AAB64337.html #WSF04FE993-D0BA-4a2b-BDF1-8B8ABF22E448, which is really easier and more efficient than old ways.
    But I then found that the old ANT task "flexunit" for running unit test not working any more.  So if I want to get the results of unit testing from a CI server, how could I do now?
    Thanks a lot
    Michael

    @Michael Lin89 - You can find information on using FlexUnit4 via Ant @ http://docs.flexunit.org/index.php?title=Ant_Task.  There has been a lot of information collected on the wiki as well related to the CI process.  You can see that info @ http://docs.flexunit.org/index.php?title=Continuous_Integration_Support.  There are also an assortment of community projects built to work with FlexUnit which you can check out on the community page @ http://docs.flexunit.org/index.php?title=Community_Projects. There is also a sample project for working with CI, Ant, Maven, and a few other technologies @ http://docs.flexunit.org/index.php?title=CI_Sample_Project_Information.
    Hope this helps to fill in the gaps as to what support we offer in terms of Ant and CI.
    -Brian

  • Getting Error in Asmx Web Service Unit Testing & not able to debug unit-test Project.

    I am getting below error message while running unit test for ASMX web service
    Failed MyFunction The ASP.NET Web application at 'D:\MyProjectFolder' is already configured for testing by another test run. Only one test run at a time can run
    tests in ASP.NET. If there are no other test runs using this Web application, ensure that the Web.config file does not contain an httpModule named HostAdapter.
    I checked in web.config. Below line already added in web.config. i removed below line to run test again but getting same error message.
    <httpModules>
    <add name="HostAdapter" type="Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule, Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </httpModules>
    i am not able to debug unit test project.
    Please "Mark as Answer" if this post answered your question. :)
    Kalpesh Chhatrala | Software Developer | Rajkot | India
    Kalpesh 's Blog
    VFP Form to C#, Vb.Net Conversion Utility

    Hi Kalpesh,
    >>Failed MyFunction The ASP.NET Web application at 'D:\MyProjectFolder' is already configured for testing by another test run. Only one test run at a
    time can run tests in ASP.NET. If there are no other test runs using this Web application, ensure that the Web.config file does not contain an httpModule named HostAdapter.
    In your web application root, can you find a file named 'web.config.backup'?
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/e2ad0c20-df90-48dc-818c-8c5ec24d9365/visual-studio-test-is-not-hitting-breakpoints-in-debug?forum=vststest
    Fang also shared more information about debugging the unit test for web project here:
    https://social.msdn.microsoft.com/Forums/en-US/daa16086-b1b8-4917-ad8d-65e23b49e1bc/not-able-to-read-webconfig-through-unit-test-feature-by-visual-studiovsts?forum=vststest
    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.

  • Unit Test code using wrong persistence unit

    In the midst of learning Maven, I created a simple application in which I am using JPA (Java Persistence 1.0.2) with EclipseLink implementation (2.0.2).
    Note: This is an Application Managed environment. So I manually control EntityManager's life cycle.
    The persistence.xml file used by the main source code is different from the one that unit test code uses. Main code uses an Oracle DB and the test code uses an in-memory Derby.
    Running unit tests was updating the Oracle DB (!) and I eventually managed to fix that by using two different persistence-units in the XML files.
    However, I don't understand why that fixed the problem. I manually create and shut down the entity managers and they are not running concurrently. I'm pretty sure Maven (or the way I set it up) doesn't mess up the resources (XML files). In fact by looking at Maven's debug output I can see it's using the right XML file for unit tests.
    Could someone enlighten me, please?

    Do you have both persistence.xml files on your classpath? If so, and they contain the same name for their respective persistence units, you should be getting a warning or error since they must have unique names. There is no way to tell which one you want to access otherwise.
    Best Regards,
    Chris

  • Unit Test in SQL Developer 2.1: Automated Builds

    Hi,
    I am interested to know if the new Unit Testing framework can be accessed via API so the test execution is initiated from automated build process.
    Regards,
    Vadim

    I am having a problem with the unit testing command line.
    I am attempting to run the unit testing using the command line interface.
    I can connect to UNIT_TEST_REPOS schema in SQL developer.
    I am successfully running units test and suites in SQL developer.
    UNIT_TEST_REPOS, RCSV1 and DEVER users are granted on the UT_REPO_USER role and UNIT_TEST_REPOS and DEVER on the UT_REPO_ADMINISTRATOR.
    The following commands result in an error box saying "No Repository was found on the selected connection, you need to create a repository." (The HELP button apparently does nothing. The OK button closes the box.)
    C:\Program Files\sqldeveloper\sqldeveloper\bin>UtUtil -exp -test -name RCSV1_RCS_SECURITY.GET_LDAP_BASE -repo unit_test_repos -file c:\ut_xml\test.xml
    Unable to open repository
    C:\Program Files\sqldeveloper\sqldeveloper\bin>UtUtil -run -test -name RCSV1_RCS_SECURITY.GET_LDAP_BASE -repo unit_test_repos -db dever
    Unable to open repository
    C:\Program Files\sqldeveloper\sqldeveloper\bin>UtUtil -run -test -name RCSV1_RCS_SECURITY.GET_LDAP_BASE -repo dever -db dever
    Unable to open repository
    I would guess that I am not supplying the correct connection info.
    My last comment triggered an idea. It turns out that the connection names required are those connections named in SQL developer. In my case, they are not the same as the schema names. The following command worked as advertised.
    C:\Program Files\sqldeveloper\sqldeveloper\bin>UtUtil -run -test -name RCSV1_RCS_SECURITY.GET_LDAP_BASE -repo UNIT_TEST -db DeverLocal
    The ANT target is
    <target name="UnitTests">
    <exec executable="cmd" dir="${sqldev.bin.dir}">
    <arg value="/c"/>
    <arg value="UtUtil -run -suite -name RCSV1 -repo UNIT_TEST -db DeverLocal"/>
    </exec>
    </target>
    Regards,
    Bill

Maybe you are looking for

  • Query for Sales order and corr.AR Invoice Info

    Hi, I need to write a query which gives the flollowing sales order info along with the coressponding AR invoices info Sales Order columns reqd: OPERATING_UNIT ORDER_NUMBER CUSTOMER_NUM CUSTOMER_NAME ORDERED_DATE FLOW_STATUS_CODE TOTAL_ORDER_AMOUNT AR

  • Trouble Setting "Display PDF in browser using" by MCX

    I want to force the PDF viewer in Safari to Mac OS X v10.6 built-in Preview Application instead of Adobe Acrobat Pro (9.4.0). I found that unchecking "Display PDF in browser using:" in Acrobat's Preferences, sets the viewer in Safari to Preview. It s

  • LSD problem in Lenovo B450

    So, im wrote all history about problems with this problem.... When i, take this laptop, him have problem with KBC controller, Battery not charging and Keyboard not work... im open case and view mainboard, damage component's will be not found... LSD p

  • Triple Boot Snow Leopard, Leopard, Windows 7 RC

    I just managed a triple boot setup on a new MBP. I now have Snow Leopard 10.6.1, Leopard, 10.5.8, and Windows 7 RC and can boot easily to any of them with the option-key at power on. These are the steps I followed: 1) Installed the windows 7 RC via B

  • Invoice pricing date

    Hi my clint requirement is. Present the pricing date flowing to the invoice PGI date as invoice pricing date. Now our requirement is sales order pricing date we need in invoice pricing date. How we con configure this? I have one doubt As per our stan