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
#!/bin/bash | |
CWD=`pwd` | |
SCRIPT_PATH=`readlink -f "$0"` | |
SCRIPT_DIR=`dirname "$SCRIPT_PATH"` | |
cd "$SCRIPT_DIR" | |
# parse options | |
QUIET=false | |
OPT_C=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
<script> | |
for (let method of ['GET', 'POST']) { | |
fetch('http://example.com', {method}).then(e => { | |
document.write('<p>' + method + ' succeded with result: ' + e + '</p>') | |
console.log(e) | |
}).catch(e => { | |
document.write('<p>' + method + ' failed due to: ' + e + '</p>') | |
}); | |
} |
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
<div class="mat-card-dialog"> | |
<h2 mat-dialog-title class="mat-card-dialog-title" *ngIf="title">{{title}}</h2> | |
<mat-icon mat-dialog-close class="mat-card-dialog-close pointer">close</mat-icon> | |
<ng-content></ng-content> | |
</div> |
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 {ComponentFactoryResolver, ComponentRef, Directive, Type, ViewContainerRef} from '@angular/core'; | |
/** | |
* Allows to embed custom components into views. | |
* | |
* ## Usage in template | |
* | |
* ```html | |
* <ng-template appCustomComponent></ng-template> | |
* ``` |
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
class JavaConstrcutor { | |
public static class A { | |
public A() { | |
System.out.println("A"); | |
} | |
public A(String message) { | |
System.out.println("A:"+message); | |
} |
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
let subject = new BehaviorSubject<string>('0'); | |
subject.subscribe(it => console.log('@@@@@@@@@@@@', 'A', it)); | |
console.log('@@@@@@@@@@@@', 'emit', '1'); | |
subject.next('1'); | |
subject.subscribe(it => console.log('@@@@@@@@@@@@', 'B', it)); | |
console.log('@@@@@@@@@@@@', 'emit', '2'); | |
subject.next('2'); | |
subject.subscribe(it => console.log('@@@@@@@@@@@@', 'C', it)); | |
// @@@@@@@@@@@@ A 0 |
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
/** | |
* Here is the jdk8 datetime cheatsheet and explanation why we use ZonedDateTime and Instant in TimeService. | |
*/ | |
// this is the 01.03.2016 00:00 in server timezone (Europe/Warsaw) == EXACTLY THE SAME AS THE SYSTEM TIME | |
ZonedDateTime zonedDateTime = ZonedDateTime.of(2016, 3, 1, 0, 0, 0, 0, ZoneId.systemDefault()); | |
System.out.println(zonedDateTime); // 2016-03-01T00:00+01:00[Europe/Warsaw] | |
// this is the same 01.03.2016 00:00 but doesn't carry timezone information | |
LocalDateTime localDateTime = zonedDateTime.toLocalDateTime(); |
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
abstract class BaseProcessTest { | |
fun startProcess(variables: Map<String, Any> = mapOf()): ProcessAssertions { | |
logger.debug("Starting process: ${processName()}") | |
val processTestEnvironment = ProcessTestEnvironment() | |
runtimeService.addEventListener(processTestEnvironment) | |
try { | |
runtimeService.startProcessInstanceByKey(processName(), variables) |
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
class ProcessAssertions(protected val processTestEnvironment: ProcessTestEnvironment) { | |
/** | |
* Checks whether the process variable is set | |
**/ | |
fun assertVariable(name: String, value: Any) { | |
assertThat((processTestEnvironment.processInstance as VariableScopeImpl).getVariable(name)).isEqualTo(value) | |
} | |
/** |
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
class ProcessTestEnvironment: EventLogger(DefaultClockImpl(), ObjectMapper()) { | |
var processInstance: ProcessInstance? = null | |
var exception: Throwable? = null // [1] the exception thrown by the process, if any | |
set(value) { | |
logger.debug("Exception thrown", value) | |
field = value | |
} | |
val events: List<Map<String, Any>> = mutableListOf() |
NewerOlder