Skip to content

Commit

Permalink
Upgrade Reladomo to 17.0.0, Replace GS Collections by Eclipse Collect…
Browse files Browse the repository at this point in the history
…ions.

Signed-off-by: Nikhil Nanivadekar <[email protected]>
  • Loading branch information
nikhilnanivadekar committed Mar 3, 2018
1 parent 9e7e4d5 commit fee8427
Show file tree
Hide file tree
Showing 22 changed files with 177 additions and 182 deletions.
6 changes: 3 additions & 3 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Reladomo
Copyright 2016 Goldman Sachs
Licensed under Apache 2.0 license

GS Collections
Copyright 2016 Goldman Sachs
Licensed under Apache 2.0 license
Eclipse Collections
Copyright Eclipse Collections
Licensed under Eclipse Public License - v 1.0

Joda Time
Copyright 2002-2016 Joda.org
Expand Down
26 changes: 9 additions & 17 deletions main-kata/main-kata.iml
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/reladomo" isTestSource="false" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/target/antrun" />
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
<excludeFolder url="file://$MODULE_DIR$/target/docbook-lib" />
<excludeFolder url="file://$MODULE_DIR$/target/generated-resources" />
<excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
<excludeFolder url="file://$MODULE_DIR$/target/maven-status" />
<excludeFolder url="file://$MODULE_DIR$/target/presentation" />
<excludeFolder url="file://$MODULE_DIR$/target/site" />
<excludeFolder url="file://$MODULE_DIR$/target/surefire" />
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.goldmansachs.reladomo:reladomo:16.1.0" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs.reladomo:reladomo:17.0.0" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections-api:5.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.4" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections-api:7.0.3" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections:7.0.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.goldmansachs:gs-collections-testutils:7.0.3" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.collections:eclipse-collections-api:9.1.0" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.collections:eclipse-collections:9.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.eclipse.collections:eclipse-collections-testutils:9.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs.reladomo:reladomo-test-util:16.1.0" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs.reladomo:reladomo-test-util:17.0.0" level="project" />
<orderEntry type="library" name="Maven: com.h2database:h2:1.3.169" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.0.13" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.0.13" level="project" />
</component>
</module>
</module>
25 changes: 14 additions & 11 deletions main-kata/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017 Goldman Sachs.
Copyright 2018 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -109,7 +109,7 @@
<taskdef name="gen-reladomo" classpath="plugin_classpath"
classname="com.gs.fw.common.mithra.generator.MithraGenerator"/>
<gen-reladomo xml="${project.basedir}/src/main/reladomoxml/MithraTestAppClassList.xml"
generateGscListMethod="true"
generateEcListMethod="true"
generatedDir="${project.build.directory}/generated-sources/reladomo"
nonGeneratedDir="${project.basedir}/src/main/java"
/>
Expand Down Expand Up @@ -190,7 +190,8 @@
<replace dir="${project.build.directory}/docbook-lib/docbook/slides/xhtml" value="">
<include name="plain-titlepage.xsl"/>
<replacetoken>
xsl:use-attribute-sets=&quot;slides.titlepage.recto.style&quot;</replacetoken>
xsl:use-attribute-sets=&quot;slides.titlepage.recto.style&quot;
</replacetoken>
</replace>
<java classname="org.apache.xalan.xslt.Process"
fork="yes"
Expand Down Expand Up @@ -225,9 +226,11 @@
<include name="ReladomoKata.xhtml"/>
<replacetoken>&lt;link type=&quot;text/css&quot; href=&quot;files/slidy/styles/w3c-blue.css&quot; rel=&quot;stylesheet&quot;/&gt;</replacetoken>
</replace>
<replace dir="${project.build.directory}/presentation" value="&lt;div class=&quot;slide cover title&quot;&gt;&lt;h1 class=&quot;title&quot;&gt;Reladomo Kata&lt;/h1&gt;&lt;/div&gt;">
<replace dir="${project.build.directory}/presentation"
value="&lt;div class=&quot;slide cover title&quot;&gt;&lt;h1 class=&quot;title&quot;&gt;Reladomo Kata&lt;/h1&gt;&lt;/div&gt;">
<include name="ReladomoKata.xhtml"/>
<replacetoken>&lt;div xmlns:dbs=&quot;http://docbook.org/ns/docbook-slides&quot; class=&quot;slide cover title&quot;/&gt;</replacetoken>
<replacetoken>&lt;div xmlns:dbs=&quot;http://docbook.org/ns/docbook-slides&quot; class=&quot;slide cover title&quot;/&gt;
</replacetoken>
</replace>
<replace dir="${project.build.directory}/presentation" value="">
<include name="ReladomoKata.xhtml"/>
Expand Down Expand Up @@ -284,18 +287,18 @@
</dependency>

<dependency>
<groupId>com.goldmansachs</groupId>
<artifactId>gs-collections-api</artifactId>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
</dependency>

<dependency>
<groupId>com.goldmansachs</groupId>
<artifactId>gs-collections</artifactId>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
</dependency>

<dependency>
<groupId>com.goldmansachs</groupId>
<artifactId>gs-collections-testutils</artifactId>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-testutils</artifactId>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions main-kata/src/main/java/kata/domain/Person.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Goldman Sachs.
Copyright 2018 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,7 +16,7 @@

package kata.domain;

import com.gs.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure;

public class Person
extends PersonAbstract
Expand Down
28 changes: 14 additions & 14 deletions main-kata/src/test/java/kata/test/ExercisesAdvancedFinder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Goldman Sachs.
Copyright 2018 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,17 +16,17 @@

package kata.test;

import com.gs.collections.api.block.function.Function;
import com.gs.collections.api.list.MutableList;
import com.gs.collections.api.map.MutableMap;
import com.gs.collections.api.set.MutableSet;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.api.tuple.Twin;
import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.map.mutable.UnifiedMap;
import com.gs.collections.impl.set.mutable.UnifiedSet;
import com.gs.collections.impl.test.Verify;
import com.gs.collections.impl.tuple.Tuples;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.api.tuple.Twin;
import org.eclipse.collections.impl.list.mutable.FastList;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.eclipse.collections.impl.set.mutable.UnifiedSet;
import org.eclipse.collections.impl.test.Verify;
import org.eclipse.collections.impl.tuple.Tuples;
import com.gs.fw.common.mithra.MithraObject;
import com.gs.fw.common.mithra.attribute.Attribute;
import com.gs.fw.common.mithra.finder.AbstractRelatedFinder;
Expand Down Expand Up @@ -98,7 +98,7 @@ public void testQ2()
CustomerAccountList accounts = this.getAccountsBasedOnTuples(accountNameAndTypes);

Verify.assertListsEqual(FastList.newListWith(300, 500, 600),
accounts.asGscList().collect(CustomerAccountFinder.accountId()));
accounts.asEcList().collect(CustomerAccountFinder.accountId()));
}

//-------------- Question 3 ------------------------------------------------------
Expand Down Expand Up @@ -334,7 +334,7 @@ public void testQ12()
{
final PersonList people = this.getPeopleIn(UnifiedSet.newSetWith(3, 9, 15, 99));
Verify.assertSetsEqual(UnifiedSet.newSetWith("Yuki Suzuki", "Douglas Adams", "Jango Fett"),
people.asGscList().collect(PersonFinder.name()).toSet());
people.asEcList().collect(PersonFinder.name()).toSet());
}

//-------------- Question 13 ------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions main-kata/src/test/java/kata/test/ExercisesAuditOnly.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Goldman Sachs.
Copyright 2018 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,9 +16,9 @@

package kata.test;

import com.gs.collections.impl.block.factory.Predicates;
import com.gs.collections.impl.set.mutable.UnifiedSet;
import com.gs.collections.impl.test.Verify;
import org.eclipse.collections.impl.block.factory.Predicates;
import org.eclipse.collections.impl.set.mutable.UnifiedSet;
import org.eclipse.collections.impl.test.Verify;
import kata.domain.Task;
import kata.domain.TaskFinder;
import kata.domain.TaskList;
Expand Down Expand Up @@ -64,9 +64,9 @@ public void testQ1()
TaskList tasks = this.getActiveTasks();

Verify.assertSetsEqual(UnifiedSet.newSetWith("Colonize Moon", "Dam River"),
tasks.asGscList().collect(TaskFinder.name()).toSet());
tasks.asEcList().collect(TaskFinder.name()).toSet());
Verify.assertSetsEqual(UnifiedSet.newSetWith("In Design", "Restarted"),
tasks.asGscList().collect(TaskFinder.status()).toSet());
tasks.asEcList().collect(TaskFinder.status()).toSet());
}

//------------------------ Question 2 --------------------------------------------------------
Expand All @@ -86,9 +86,9 @@ public void testQ2()
TaskList tasks = this.getTasksAsOf(processingDate);

Verify.assertSetsEqual(UnifiedSet.newSetWith("Build Bridge", "Dam River"),
tasks.asGscList().collect(TaskFinder.name()).toSet());
tasks.asEcList().collect(TaskFinder.name()).toSet());
Verify.assertSetsEqual(UnifiedSet.newSetWith("Restarted", "Damming"),
tasks.asGscList().collect(TaskFinder.status()).toSet());
tasks.asEcList().collect(TaskFinder.status()).toSet());
}

//------------------------ Question 3 --------------------------------------------------------
Expand All @@ -111,7 +111,7 @@ public void testQ3()
Timestamp.valueOf("1965-01-01 06:00:00.0"),
Timestamp.valueOf("1967-01-01 11:30:22.0"),
Timestamp.valueOf("1990-01-01 06:00:00.0")),
tasks.asGscList().collect(TaskFinder.processingDateFrom()).toSet());
tasks.asEcList().collect(TaskFinder.processingDateFrom()).toSet());
}

//------------------------ Question 4 --------------------------------------------------------
Expand Down
28 changes: 14 additions & 14 deletions main-kata/src/test/java/kata/test/ExercisesBasicFinder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Goldman Sachs.
Copyright 2018 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,9 +16,9 @@

package kata.test;

import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.set.mutable.UnifiedSet;
import com.gs.collections.impl.test.Verify;
import org.eclipse.collections.impl.list.mutable.FastList;
import org.eclipse.collections.impl.set.mutable.UnifiedSet;
import org.eclipse.collections.impl.test.Verify;
import com.gs.fw.common.mithra.test.MithraRuntimeConfigVerifier;
import kata.domain.Person;
import kata.domain.PersonFinder;
Expand Down Expand Up @@ -88,7 +88,7 @@ public void testQ3()
{
PersonList age24 = this.getPeopleAged(24);
Verify.assertSetsEqual(UnifiedSet.newSetWith("Ada Lovelace", "Hiro Tanaka"),
age24.asGscList().collect(PersonFinder.name()).toSet());
age24.asEcList().collect(PersonFinder.name()).toSet());
}

//-------------- Question 4 ------------------------------------------------------
Expand All @@ -105,7 +105,7 @@ public void testQ4()
{
PersonList age24 = this.getPeopleOlderThan(42);
Verify.assertSetsEqual(UnifiedSet.newSetWith("Kent Beck", "Bob Martin", "Yuki Suzuki"),
age24.asGscList().collect(PersonFinder.name()).toSet());
age24.asEcList().collect(PersonFinder.name()).toSet());
}

//-------------- Question 5 ------------------------------------------------------
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testQ6()
{
PersonList peopleIn30s = this.getPeopleInTheirThirties();
Verify.assertListsEqual(FastList.newListWith("John Smith", "Yuri Clark", "Clark Kent"),
peopleIn30s.asGscList().collect(PersonFinder.name()));
peopleIn30s.asEcList().collect(PersonFinder.name()));
}

//-------------- Question 7 ------------------------------------------------------
Expand All @@ -158,7 +158,7 @@ public void testQ7()
PersonList people = this.getPeopleFromCountryOrAged("UK", 24);
Verify.assertSize(3, people);
Verify.assertListsEqual(FastList.newListWith("Hiro Tanaka", "Ada Lovelace", "Douglas Adams"),
people.asGscList().collect(PersonFinder.name()));
people.asEcList().collect(PersonFinder.name()));
}

//-------------- Question 8 ------------------------------------------------------
Expand All @@ -177,11 +177,11 @@ public void testQ8()
{
PersonList peopleLower = this.getPeopleNameStartsWithCaseInsensitive("de");
Verify.assertListsEqual(FastList.newListWith("de Rothschild", "Devon Koch"),
peopleLower.asGscList().collect(PersonFinder.name()));
peopleLower.asEcList().collect(PersonFinder.name()));

PersonList peopleUpper = this.getPeopleNameStartsWithCaseInsensitive("DE");
Verify.assertListsEqual(FastList.newListWith("de Rothschild", "Devon Koch"),
peopleUpper.asGscList().collect(PersonFinder.name()));
peopleUpper.asEcList().collect(PersonFinder.name()));
}

//-------------- Question 9 ------------------------------------------------------
Expand All @@ -200,7 +200,7 @@ public void testQ9()
{
PersonList likeLa = this.getNamedLike("lA");
Verify.assertListsEqual(FastList.newListWith("Yuri Clark", "Clark Kent", "Ada Lovelace", "Douglas Adams"),
likeLa.asGscList().collect(PersonFinder.name()));
likeLa.asEcList().collect(PersonFinder.name()));
}

//-------------- Question 10 ------------------------------------------------------
Expand All @@ -218,7 +218,7 @@ public void testQ10()
{
PersonList likeLa = this.getNameMatchingSpec("*a?a*");
Verify.assertListsEqual(FastList.newListWith("Hiro Tanaka", "Ada Lovelace", "Douglas Adams"),
likeLa.asGscList().collect(PersonFinder.name()));
likeLa.asEcList().collect(PersonFinder.name()));
}

//-------------- Question 11 ------------------------------------------------------
Expand All @@ -237,7 +237,7 @@ public void testQ11()
{
PersonList ageEqualsId = this.getWhereAgeEqualsId();
Verify.assertListsEqual(FastList.newListWith("Chuckie Egg", "Donkey Kong"),
ageEqualsId.asGscList().collect(PersonFinder.name()));
ageEqualsId.asEcList().collect(PersonFinder.name()));
}

//-------------- Question 12 ------------------------------------------------------
Expand All @@ -256,7 +256,7 @@ public void testQ12()
{
PersonList lessThan18 = this.getAgeLessIdLessThan18();
Verify.assertListsEqual(FastList.newListWith("Yusuke Sato", "Ada Lovelace", "Chuckie Egg", "Donkey Kong", "Baby Finster", "Jango Fett"),
lessThan18.asGscList().collect(PersonFinder.name()));
lessThan18.asEcList().collect(PersonFinder.name()));
}

//-------------- Auxiliary test for runtimeConfiguration correctness --------------
Expand Down
Loading

0 comments on commit fee8427

Please sign in to comment.