Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lo23-project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin DRUAULT-AUBIN
lo23-project
Commits
6fde481b
Commit
6fde481b
authored
Oct 18, 2017
by
Quentin DRUAULT-AUBIN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IHM Table] Facade tests
parent
230ba27c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
210 additions
and
1 deletion
+210
-1
.gitignore
.gitignore
+2
-1
Battleship/pom.xml
Battleship/pom.xml
+12
-0
Battleship/src/test/java/com/utclo23/ihmtable/IHMTableFacadeTest.java
...rc/test/java/com/utclo23/ihmtable/IHMTableFacadeTest.java
+196
-0
No files found.
.gitignore
View file @
6fde481b
...
...
@@ -89,4 +89,5 @@ local.properties
.worksheet
/Battleship/target/
*nb-configuration.xml
nb-configuration.xml
/Battleship/nbproject/
Battleship/pom.xml
View file @
6fde481b
...
...
@@ -111,6 +111,18 @@
<artifactId>
sonar-maven-plugin
</artifactId>
<version>
3.2
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.hamcrest
</groupId>
<artifactId>
hamcrest-core
</artifactId>
<version>
1.3
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<profiles>
...
...
Battleship/src/test/java/com/utclo23/ihmtable/IHMTableFacadeTest.java
0 → 100644
View file @
6fde481b
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
com.utclo23.ihmtable
;
import
com.utclo23.data.structure.Coordinate
;
import
com.utclo23.data.structure.StatGame
;
import
java.rmi.server.UID
;
import
java.util.logging.Logger
;
import
org.junit.After
;
import
org.junit.AfterClass
;
import
org.junit.Assert
;
import
static
org
.
junit
.
Assert
.
fail
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.junit.Rule
;
import
org.junit.rules.ExpectedException
;
/**
*
* @author Quentin
*/
public
class
IHMTableFacadeTest
{
private
static
final
String
LOGGER_NAME
=
"IHM Table Facade Test"
;
private
static
final
String
EXCEPTION_FAIL
=
"An exception should have been thrown"
;
public
IHMTableFacadeTest
()
{
}
@BeforeClass
public
static
void
setUpClass
()
{
}
@AfterClass
public
static
void
tearDownClass
()
{
}
@Before
public
void
setUp
()
{
}
@After
public
void
tearDown
()
{
}
@Rule
public
ExpectedException
expectedException
=
ExpectedException
.
none
();
/**
* Test of showSavedGameWithId method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testShowSavedGameWithId
()
throws
Exception
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"showSavedGameWithId"
);
int
id
=
0
;
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
showSavedGameWithId
(
id
);
}
/**
* Test of createInGameGUI method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testCreateInGameGUI
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"createInGameGUI"
);
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
createInGameGUI
();
}
/**
* Test of stopTimer method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testStopTimer
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"stopTimer"
);
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
stopTimer
();
}
/**
* Test of showGame method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testShowGame
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"showGame"
);
UID
guid
=
null
;
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
showGame
(
guid
);
}
/**
* Test of notifyGameReady method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testNotifyGameReady
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"notifyGameReady"
);
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
notifyGameReady
();
}
/**
* Test of printMessage method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testPrintMessage
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"printMessage"
);
String
message
=
""
;
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
printMessage
(
message
);
}
/**
* Test of feedBack method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testFeedBack
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"feedBack"
);
Coordinate
coord
=
null
;
boolean
bool
=
false
;
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
feedBack
(
coord
,
bool
);
}
/**
* Test of finishGame method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testFinishGame
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"finishGame"
);
StatGame
stGame
=
null
;
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
finishGame
(
stGame
);
}
/**
* Test of opponentHasLeftGame method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testOpponentHasLeftGame
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"opponentHasLeftGame"
);
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
opponentHasLeftGame
();
}
/**
* Test of connectionLostWithOpponent method, of class IHMTableFacade.
*/
@org
.
junit
.
Test
public
void
testConnectionLostWithOpponent
()
{
expectedException
.
expect
(
UnsupportedOperationException
.
class
);
expectedException
.
expectMessage
(
IHMTableFacade
.
EXCEPTION_MESSAGE
);
Logger
.
getLogger
(
LOGGER_NAME
).
info
(
"connectionLostWithOpponent"
);
IHMTableFacade
instance
=
new
IHMTableFacade
();
instance
.
connectionLostWithOpponent
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment