Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TPKotlinSFFS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dahuron Robin
TPKotlinSFFS
Commits
91e332a5
Commit
91e332a5
authored
4 years ago
by
reblochor
Browse files
Options
Downloads
Patches
Plain Diff
Added jar packaging and store test
parent
12938978
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pom.xml
+40
-6
40 additions, 6 deletions
pom.xml
src/test/kotlin/model/PSTestFile.kt
+26
-0
26 additions, 0 deletions
src/test/kotlin/model/PSTestFile.kt
with
66 additions
and
6 deletions
pom.xml
+
40
−
6
View file @
91e332a5
...
...
@@ -50,13 +50,47 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
exec-maven-plugin
</artifactId>
<version>
1.6.0
</version>
<!--<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<mainClass>MainKt</mainClass>
</configuration>
</plugin>-->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-shade-plugin
</artifactId>
<version>
3.2.1
</version>
<configuration>
<mainClass>
MainKt
</mainClass>
<createDependencyReducedPom>
false
</createDependencyReducedPom>
<transformers>
<transformer
implementation=
"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"
>
<mainClass>
MainKt
</mainClass>
<manifestEntries>
<Multi-Release>
true
</Multi-Release>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>
*:*
</artifact>
<excludes>
<exclude>
META-INF/*.SF
</exclude>
<exclude>
META-INF/*.DSA
</exclude>
<exclude>
META-INF/*.RSA
</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
shade
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
@@ -99,4 +133,4 @@
</dependency>
</dependencies>
</project>
\ No newline at end of file
</project>
This diff is collapsed.
Click to expand it.
src/test/kotlin/model/PSTestFile.kt
+
26
−
0
View file @
91e332a5
...
...
@@ -38,4 +38,30 @@ class PSTestFile {
assertThat
(
deck2
).
isNotNull
.
isEqualTo
(
Deck
(
mutableListOf
(
HeartCard
(
true
,
CardValue
.
KING
))))
assertThat
(
deck
+
HeartCard
(
true
,
CardValue
.
TEN
)).
isNull
()
}
@Test
fun
testGameStore
()
{
for
((
clazz
,
pile
)
in
listOf
(
Pair
(
SpadeCard
::
class
.
java
,
Game
.
spadePile
),
Pair
(
HeartCard
::
class
.
java
,
Game
.
heartPile
),
Pair
(
ClubCard
::
class
.
java
,
Game
.
clubPile
),
Pair
(
DiamondCard
::
class
.
java
,
Game
.
diamondPile
)))
{
val
game
=
Game
// Wrong card
game
.
visibleDeck
+=
createCard
(
clazz
,
CardValue
.
FIVE
)
game
.
store
()
assertThat
(
Game
.
visibleDeck
.
top
).
isNotNull
.
isEqualTo
(
createCard
(
clazz
,
CardValue
.
FIVE
))
assertThat
(
pile
.
top
).
isNull
()
// Good card Ace
game
.
visibleDeck
+=
createCard
(
clazz
,
CardValue
.
ACE
)
game
.
store
()
assertThat
(
Game
.
visibleDeck
.
top
).
isNotNull
.
isEqualTo
(
createCard
(
clazz
,
CardValue
.
FIVE
))
assertThat
(
pile
.
top
).
isNotNull
.
isEqualTo
(
createCard
(
clazz
,
CardValue
.
ACE
))
// Good card two on top of ace
game
.
visibleDeck
+=
createCard
(
clazz
,
CardValue
.
TWO
)
game
.
store
()
assertThat
(
Game
.
visibleDeck
.
top
).
isNotNull
.
isEqualTo
(
createCard
(
clazz
,
CardValue
.
FIVE
))
assertThat
(
pile
.
top
).
isNotNull
.
isEqualTo
(
createCard
(
clazz
,
CardValue
.
TWO
))
}
}
private
fun
<
T
>
createCard
(
clazz
:
Class
<
T
>,
value
:
CardValue
)
=
clazz
.
getConstructor
(
Boolean
::
class
.
java
,
CardValue
::
class
.
java
).
newInstance
(
true
,
value
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment