Gauge and plain Java - something went wrong with packages import

510 views
Skip to first unread message

IrimoteCat

unread,
Feb 17, 2017, 11:47:49 AM2/17/17
to getgauge
Hello! I am newbie in test automation and desperately need help from experts - please, help.

 I try gauge for automation testing in our project (java server-side with JMS api + jdbc) and created sandbox gaude project to produce prove of concept and learn how it works. The problem is that my test failed because it can't resolve dependencies. 

I produced the following code:

jms.spec
Specification Heading
=====================

This is slightly modified example from Gauge docs


* Test.

Send test text jms and get response from server
---------------------------

tags: jms

* Send TextJMS with text "From Gauge with  love".
* The response has correct modification.

Step implementation - JMSTester.java
import javax.jms.*;
import com.thoughtworks.gauge.Step;

import sandbox.sandjms.ClientSide;
import sandbox.sandjms.ServerSide;

public class JMSTester {
    @Step("Send TextJMS with text <text>")
    public void sendJMS(String text) {
        try {
        ClientSide client = new ClientSide();
            client.sendMessage("Hello to my mistress from Gauge!");
        } catch (JMSException e) {
            //Handle the exception appropriately
        }        
    }

    @Step("The response has correct modifications")
    public void getResponseAndandCheck() {
        ServerSide server = new ServerSide();
      //  assertEquals(expectedCount, actualCount);    
    }
}

Output:
src\test\java\JMSTester.java:1: error: package javax.jms does not exist
import javax.jms.*;
^
src\test\java\JMSTester.java:4: error: package sandbox.sandjms does not exist
import sandbox.sandjms.ClientSide;
                      ^
src\test\java\JMSTester.java:5: error: package sandbox.sandjms does not exist
import sandbox.sandjms.ServerSide;
                      ^
src\test\java\JMSTester.java:11: error: cannot find symbol
        ClientSide client = new ClientSide();
        ^
  symbol:   class ClientSide
  location: class JMSTester
src\test\java\JMSTester.java:11: error: cannot find symbol
        ClientSide client = new ClientSide();
                               ^
  symbol:   class ClientSide
  location: class JMSTester
src\test\java\JMSTester.java:13: error: cannot find symbol
        } catch (JMSException e) {
                 ^
  symbol:   class JMSException
  location: class JMSTester
src\test\java\JMSTester.java:20: error: cannot find symbol
        ServerSide server = new ServerSide();
        ^
  symbol:   class ServerSide
  location: class JMSTester
src\test\java\JMSTester.java:20: error: cannot find symbol
        ServerSide server = new ServerSide();
                                ^
  symbol:   class ServerSide
  location: class JMSTester
8 errors
process C:\Program Files\Java\jdk1.8.0_121\bin\javac.exe with pid 3044 quit unexpectedly. exit status 1
Failed to start gauge API: Runner with pid 12140 quit unexpectedly(exit status 1).

Ath the same time, I added all libs above to the project using maven (see screenshots)

Please, help me to understand whats wrong. I really keen into gauge and want to introduce it in my company.

Thanks in advance!

PackageExplorer+JMSTester.jpg
pom.jpg
ProjectProperties.jpg

Vinay Shankar Shukla

unread,
Feb 20, 2017, 1:12:15 AM2/20/17
to getgauge
Hi IrimoteCatI,
I'm sorry to say that we don't support eclipse for gauge. You can run your project from command line.
In your issue looks like your dependencies are not in the classpath. By default, Gauge adds the external dependencies in classpath from libs folder. You can add your dependencies in libs folder and run it from the command line. If you want your dependencies in any other place, set the gauge_additional_libs property in your env/default/java.propertiers  to relative path of your dependencies folder.
We highly recommend you to use IntelliJ (with gauge plugin) for your gauge project as it has a lot of features which helps you to write your tests.  Find out more about [gauge intelliJintelliJ plugin](https://docs.getgauge.io/using.html#intellij-idea). 
Feel free to contact us for any further issue. We are happy to help you.

Thanks



--
You received this message because you are subscribed to the Google Groups "getgauge" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getgauge+u...@googlegroups.com.
To post to this group, send email to getg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/getgauge/89a60446-c16d-45b2-8631-a8429d411278%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Regards,

Vinay Shankar Shukla
STEP Intern
Emailvin...@thoughtworks.com
Telephone8147430068
ThoughtWorks

IriomoteCat

unread,
Feb 20, 2017, 9:26:19 AM2/20/17
to getgauge
Thanks a lot, Vinay, for such a detailed answer! I will try to create my PoC using Idea

Best regards,
Cat

пятница, 17 февраля 2017 г., 19:47:49 UTC+3 пользователь IriomoteCat написал:
Reply all
Reply to author
Forward
0 new messages