This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.transform.InheritConstructors | |
def doIt(Closure whatToDo) { | |
println "hello in doIt" | |
def optionalResult = whatToDo.call() | |
println "after done it" | |
optionalResult | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
/* this file is located at %CUBA_APP_ROOT%/portal/web/WEB-INF/pages/index.jsp */ | |
%> | |
<html> | |
<head><title>First JSP</title></head> | |
<body> | |
<% | |
double num = Math.random(); | |
if (num > 0.95) { | |
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: A valid customer with a delivery address will be created correctly | |
Given: I am logged in as 'Martin, the Sales Guy' | |
When: I create the Customer 'Peter' with valid customer information | |
And: I assign 'Peter' the delivery address 'P. Sherman 42 Wallaby Way, Sydney' | |
Then: the customer 'Peter' is created | |
And: 'Bob' has the delivery address 'P. Sherman 42 Wallaby Way, Sydney' assigned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
databaseChangeLog = { | |
changeSet(author: "mario (generated)", id: "1416989310726-1") { | |
createTable(tableName: "D_SEQUENCEDEFINITION") { | |
column(autoIncrement: "true", name: "ID", type: "bigint") { | |
constraints(nullable: "false", primaryKey: "true", primaryKeyName: "D_SEQUENCEDEFPK") | |
} | |
column(name: "VERSION", type: "bigint") { | |
constraints(nullable: "false") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Error 2014-11-26 09:15:53,513 [localhost-startStop-1] ERROR liquibase - Change Set changelog-test-sequence-entity.groovy::1416989310726-2::mario (generated) failed. Error: Error executing SQL CREATE TABLE D_SEQUENCENUMBER (ID NUMBER(38,0) NOT NULL, VERSION NUMBER(38,0) NOT NULL, DEFINITION_id NUMBER(38,0) NOT NULL, sequence_group VARCHAR2(40), number NUMBER(38,0) NOT NULL, CONSTRAINT D_SEQUENCENUMPK PRIMARY KEY (ID)): ORA-00904: : ungültiger Bezeichner | |
Message: Error executing SQL CREATE TABLE D_SEQUENCENUMBER (ID NUMBER(38,0) NOT NULL, VERSION NUMBER(38,0) NOT NULL, DEFINITION_id NUMBER(38,0) NOT NULL, sequence_group VARCHAR2(40), number NUMBER(38,0) NOT NULL, CONSTRAINT D_SEQUENCENUMPK PRIMARY KEY (ID)): ORA-00904: : ungültiger Bezeichner | |
Line | Method | |
->> 62 | execute in liquibase.executor.jvm.JdbcExecutor | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
| 104 | execute in '' | |
| 1091 | execute . . . . . in liquibase.database.AbstractDatabase | |
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static HttpServer startServer() throws IOException { | |
System.out.println("Starting grizzly..."); | |
// Alte Version | |
// ResourceConfig rc = new PackagesResourceConfig("http.resources"); | |
// Map<String, String> initParams = new HashMap<String, String>(); | |
// initParams.put("com.sun.jersey.config.property.packages", "http.resources"); | |
// initParams.put("com.sun.jersey.api.json.POJOMappingFeature", "true"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Bindings computeNext() { | |
Bindings inter; | |
boolean flag; | |
do { | |
flag = false; | |
if (this.originalIterator.hasNext()) { | |
inter = this.originalIterator.next(); | |
if (inter == null) { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create hash of our content "test" | |
Number160 contentHash = Number160.createHash("test"); | |
// find the responsible peer (the hash of it) of the content | |
Number160 destination = peer.getPeerBean().getStorage() | |
.findPeerIDForResponsibleContent(contentHash); | |
// send a message to this peer | |
FutureDHT future = peer.send(destination).setObject("this is the message").start(); |