Skip to content

Commit

Permalink
Updated CHANGELOG and README for v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbosecke committed Mar 2, 2015
1 parent 29c309a commit 21880a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.4.2
- Performance improvements

## v1.4.1
- Performance improvements

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ First, add the following dependency to your pom.xml:
<dependency>
<groupId>com.mitchellbosecke</groupId>
<artifactId>pebble</artifactId>
<version> 1.4.1 </version>
<version> 1.4.2 </version>
</dependency>
```

Expand Down
18 changes: 12 additions & 6 deletions src/test/java/com/mitchellbosecke/pebble/ConcurrencyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,21 @@ public static class TestObject {
final public int b;

final public int c;

final public String d;

private TestObject(int a, int b, int c) {
private TestObject(int a, int b, int c, String d) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
}
}

@Test
public void testConcurrentEvaluation() throws InterruptedException, PebbleException {

String templateSource = "{{ test.a }}:{{ test.b }}:{{ test.c }}";
String templateSource = "{{ test.a }}:{{ test.b }}:{{ test.c }}:{{ test.d | upper }}";
PebbleEngine engine = new PebbleEngine(new StringLoader());
final PebbleTemplate template = engine.getTemplate(templateSource);

Expand All @@ -71,16 +74,17 @@ public void run() {
int a = r.nextInt();
int b = r.nextInt();
int c = r.nextInt();
int d = r.nextInt();

TestObject testObject = new TestObject(a, b, c);
TestObject testObject = new TestObject(a, b, c, "test"+d);

StringWriter writer = new StringWriter();
Map<String, Object> context = new HashMap<>();
context.put("test", testObject);
template.evaluate(writer, context);

String expectedResult = new StringBuilder().append(a).append(":").append(b).append(":")
.append(c).toString();
.append(c).append(":").append("TEST").append(d).toString();

String actualResult = writer.toString();
if (!expectedResult.equals(actualResult)) {
Expand Down Expand Up @@ -139,8 +143,9 @@ public void run() {
int a = r.nextInt();
int b = r.nextInt();
int c = r.nextInt();
int d = r.nextInt();

TestObject testObject = new TestObject(a, b, c);
TestObject testObject = new TestObject(a, b, c, "test" + d);

StringWriter writer = new StringWriter();
Map<String, Object> context = new HashMap<>();
Expand Down Expand Up @@ -175,8 +180,9 @@ public void run() {
int a = r.nextInt();
int b = r.nextInt();
int c = r.nextInt();
int d = r.nextInt();

TestObject testObject = new TestObject(a, b, c);
TestObject testObject = new TestObject(a, b, c, "test" + d);

StringWriter writer = new StringWriter();
Map<String, Object> context = new HashMap<>();
Expand Down

0 comments on commit 21880a1

Please sign in to comment.