header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
January 09, 2009, 01:01:41 am
Username: Password:
Login with username, password and session length

Forgot your password?
 
Unit testing via soapUI and Groovy
Welcome, Guest. Please login or register.
January 09, 2009, 01:01:41 am
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  Unit testing via soapUI and Groovy
« previous next »
Pages: [1] Print
Author Topic: Unit testing via soapUI and Groovy  (Read 570 times)
TomK
soapui pro users
Newbie
*
Posts: 25


« on: June 13, 2008, 04:40:09 pm »

I tried to run the following groovy Unit Test script in soapUI:

import groovy.util.GroovyTestCase

class MyTest extends GroovyTestCase {
    void testSomething() {
        assert 1 == 1
        assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"
    }
}

And I got the following casting error:
Fri Jun 13 16:26:57 BST 2008:ERROR:groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class MyTest. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@1560b81' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'

Is this a bug or did I do something wrong with the script?

Thanks,

Tom
Logged
TomK
soapui pro users
Newbie
*
Posts: 25


« Reply #1 on: June 13, 2008, 04:55:50 pm »

I think I managed to narrow it down to the extends instruction.
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,666


« Reply #2 on: June 15, 2008, 08:05:09 am »

Hi!

exactly where are you entering this script? You probably don't need to wrap the assertions in a method, just enter

assert 1 == 1
assert 2 + 2 == 4 : "We're in trouble, arithmetic is broken"

regards!

/Ole
eviware.com
Logged
TomK
soapui pro users
Newbie
*
Posts: 25


« Reply #3 on: June 19, 2008, 01:06:36 pm »

I was attempting to create Unit tests for the Java consumer so I have everything in one place.
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,666


« Reply #4 on: June 19, 2008, 06:57:23 pm »

Hi,

ok.. but exactly where in soapUI are you entering this script? Can you attach a screenshot?

regards!

/Ole
eviware.com
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header