Questions tagged [groovy-console]

The Groovy Console is a Java Swing based graphical user interface that is packaged with the Groovy distribution. It provides a simple but elegant way of executing interactive groovy scripts, with Groovy script entered in the top window, and the output of the script appearing in the lower window.

The Groovy Console is a Java Swing based graphical user interface that is packaged with the Groovy distribution. It provides a simple but elegant way of executing interactive groovy scripts, with Groovy script entered in the top window, and the output of the script appearing in the lower window.

The console is launched with one of a few variations of a command line call to groovyConsole. The variations comprise platform differences and executables that are compiled for some operating systems. It's location is:

<Groovy Home>\bin\groovyConsole[.*]

Variations include:

  • groovyConsole.bat (Windows)
  • groovyConsole.exe (Windows)
  • groovyConsole (Unix/Linux)

Groovy Console Snapshot

enter image description here

GroovyConsole Functions

Some of the useful functions provided in the UI are:

  • File Open / File Save / File New
  • New Window (multiple open windows supported)
  • Standard Edit Menu Functions (Copy/Paste/Undo/Redo/Search/Replace)
  • Various UI Property Toggles and Controls
  • Groovy AST Viewer
  • Groovy Variables Viewer
  • Compile Scripts
  • Run Scripts
  • Interrupt Running Script
  • Add JAR to Classpath
  • Add Directory to Classpath
162 questions
2
votes
3 answers

GroovyConsole running build.gradle

GradleWare's book - Building and Testing with Gradle - states the following in section 1.1: "Every Gradle build file is an executable Groovy script." However, when I run a build.gradle file in GroovyConsole, it gives me this…
IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147
2
votes
2 answers

Unable to connect to oracle database from groovy

Hi i am unable to connect to oracle database in groovy . I have used the following code in groovy console but getting the following compilation error unable to resolve class oracle.jdbc.driver.OracleTypes at line: 5, column: 1 I have used the…
gshashank
  • 23
  • 1
  • 1
  • 6
2
votes
2 answers

Sending an email: no object DCH for MIME type multipart/mixed

I'm trying to send an email using Java code but running from GroovyConsole. It works fine for when I just send an email without attachments but it fails as soon as I add in the multipart logic for attachments. EDIT: I'm using Javamail version…
twbbas
  • 407
  • 3
  • 9
  • 19
2
votes
3 answers

SoapUI Groovy Scripts

I'm trying to read the incoming request & set the mock response depending on a value comming in the request in soapUI 3.0. I use the following groovy script for this. def typeElement = mockRequest.getContentElement().execQuery("//ProductType"); def…
Priyal85
  • 21
  • 1
  • 1
  • 3
2
votes
2 answers

How to output and display Unicode in Groovy Console (GroovyStarter) and GGTS / Eclipse console

I would like to output floral formulae by my DSL in groovy, so I need some special symbols such as female sign and Superscripts and Subscripts. The question is about the Eclipse IDE (Groovy/Grails Tool Suite Version: 3.1.0.RELEASE to develop a…
Franco Rondini
  • 10,841
  • 8
  • 51
  • 77
1
vote
0 answers

How can i integrate GroovyConsole to in my java swing app?

I have a Java swing app. I want to use groovy.console.ui.Console (GroovyConsole) in my app. I can run groovy console but it opens in a new window. It should be in my frame. I tried to add output and input panel in new JPanels but it is not enough…
utku
  • 11
  • 1
1
vote
1 answer

How to use HTML tags in Groovy

I am trying to include HTML tags in groovy code, My requirement is to add something like -- thanks and regards (in one line), in next line a image, followed by name (in new line), kindly let me know how I can achieve this. I have tried below and it…
1
vote
1 answer

Calling a method that returns a URL in groovy script

def publishVersion() { def Payload = versionPayload() def response = httpRequest( customHeaders: [ [ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], [ name: "Content-Type", value:…
green_car
  • 11
  • 4
1
vote
1 answer

How to download Groovy in local?

As soon we click on the Windows Installer community version. But the page doesn't allow to register user. Can some one help for the same. Thanks Abhay Either the jfrog page should allow me to register and download or it should start download…
1
vote
1 answer

Running a JUnit test from Groovy Console

How can I use the Groovy Console to kick off junit tests? (Currently using Groovy 1.6.0)
Peter
  • 5,793
  • 4
  • 27
  • 31
1
vote
2 answers

Skip MissingPropertyException while using GroovyShell.evaluate

Is there a way to skip MissingPropertyException while using GroovyShell.evaluate? def sharedData = new Binding() def shell = new GroovyShell(sharedData) shell.evaluate("a=5; b=1") // works fine // How to not get MissingPropertyException, or…
ic10503
  • 131
  • 4
  • 16
1
vote
1 answer

How to update JSON payload when values are embedded in backslash in Groovy

In Groovy I have to update values in JSON payload and make an API call. I am running into challenges while updating payload as the fields are embedded in backslash. Is there a simpler way to directly update the servers in below payload i.e update 1.…
1
vote
0 answers

Grails 4.0.11 GroovyConsole error with Gorm domain class

The following test works in a Grails controller: Domain class: package freight class CodeList { private static final long serialVersionUID = 1 String codeType String code String description static constraints = { …
A.W.
  • 2,858
  • 10
  • 57
  • 90
1
vote
1 answer

Unable to convert into pretty string in groovy

I am making a curl call to rest api visa curl in groovy. Response is coming fine but the response is very large, it is a 17MB of data, following is my script : def converter = "curl.......'" def initialSize = 4096 def out = new…
user124
  • 423
  • 2
  • 7
  • 26
1
vote
0 answers

How to set form data in groovy URL request?

I am having following groovy code that makes a post call to get some auth token and it works fine: def post = new URL("abc.com").openConnection(); def message = '{"username":"user",…
user124
  • 423
  • 2
  • 7
  • 26
1 2
3
10 11