From ffa924d374b5286d5b0e78d1a765d08c51e225dd Mon Sep 17 00:00:00 2001 From: jcr0069 Date: Thu, 14 Feb 2019 18:44:17 +0100 Subject: [PATCH 01/10] readme cambios hola --- .classpath | 10 ++++++++++ .project | 17 +++++++++++++++++ README.md | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 .classpath create mode 100644 .project diff --git a/.classpath b/.classpath new file mode 100644 index 00000000..c27d1e36 --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 00000000..d1b45046 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + poolobject + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/README.md b/README.md index 4078dc6e..2e082eeb 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,9 @@ poolobject Java code example of design creational pattern pool object Example to apply good practise in software developmemnt: test and mesurement. + +Jesús Manuel Calvo Ruiz de Temiño + +Ignacio Aparicio Blanco + +Yeray Sardón Ibañez \ No newline at end of file From 405a8f34e2c8158aba440309adadca1df8fd6ddf Mon Sep 17 00:00:00 2001 From: Ignacio Date: Thu, 14 Feb 2019 18:44:26 +0100 Subject: [PATCH 02/10] Readme Update names uploaded in readme --- .classpath | 10 ++++++++++ .project | 17 +++++++++++++++++ README.md | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 .classpath create mode 100644 .project diff --git a/.classpath b/.classpath new file mode 100644 index 00000000..c27d1e36 --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 00000000..d1b45046 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + poolobject + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/README.md b/README.md index 4078dc6e..35cb72e5 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,9 @@ poolobject Java code example of design creational pattern pool object Example to apply good practise in software developmemnt: test and mesurement. + +Ignacio Aparicio Blanco + +Jesus Manuel Calvo Ruiz de Temiño + +Yeray Sardon Ibañez \ No newline at end of file From 70e84e34ee89e23d0e930192761946b5f982d33d Mon Sep 17 00:00:00 2001 From: jcr0069 Date: Thu, 14 Feb 2019 18:50:00 +0100 Subject: [PATCH 03/10] project --- .project | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .project diff --git a/.project b/.project new file mode 100644 index 00000000..d1b45046 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + poolobject + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + From b10cc511d5376a741f106bb5faea895b82da3acf Mon Sep 17 00:00:00 2001 From: jcr0069 Date: Thu, 14 Feb 2019 18:52:29 +0100 Subject: [PATCH 04/10] readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 4078dc6e..2e082eeb 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,9 @@ poolobject Java code example of design creational pattern pool object Example to apply good practise in software developmemnt: test and mesurement. + +Jesús Manuel Calvo Ruiz de Temiño + +Ignacio Aparicio Blanco + +Yeray Sardón Ibañez \ No newline at end of file From 38d32c57e702442fd0ba520d0d198de9e3afef7f Mon Sep 17 00:00:00 2001 From: jcr0069 Date: Thu, 14 Feb 2019 19:12:13 +0100 Subject: [PATCH 05/10] classpath --- .classpath | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .classpath diff --git a/.classpath b/.classpath new file mode 100644 index 00000000..ca9b1099 --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + From 21af9f93a724a54d861f3be0373456b8d02fda7b Mon Sep 17 00:00:00 2001 From: ysi0000 Date: Thu, 21 Feb 2019 18:07:09 +0100 Subject: [PATCH 06/10] ReusablePoolTestT1 --- .classpath | 8 ++++++-- src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.classpath b/.classpath index ca9b1099..e230ae57 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,10 @@ - - + + + + + + diff --git a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java index ae9b0d18..4a3d6191 100644 --- a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java +++ b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java @@ -9,6 +9,8 @@ import org.junit.Before; import org.junit.Test; +import ubu.gii.dass.c01.ReusablePool; + /** * @author alumno * @@ -20,6 +22,7 @@ public class ReusablePoolTest { */ @Before public void setUp() throws Exception { + } /** @@ -34,7 +37,9 @@ public void tearDown() throws Exception { */ @Test public void testGetInstance() { - fail("Not yet implemented"); + ReusablePool reus=ReusablePool.getInstance(); + assert(reus==ReusablePool.getInstance()); + } /** From bc74a34e2a14712d3b36d62d276565b08e86eb98 Mon Sep 17 00:00:00 2001 From: ysi0000 Date: Thu, 21 Feb 2019 18:19:39 +0100 Subject: [PATCH 07/10] Update ReusablePoolTest.java --- src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java index 4a3d6191..63e02e46 100644 --- a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java +++ b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java @@ -22,6 +22,8 @@ public class ReusablePoolTest { */ @Before public void setUp() throws Exception { + ReusablePool RPool=ReusablePool.getInstance(); + } @@ -37,7 +39,7 @@ public void tearDown() throws Exception { */ @Test public void testGetInstance() { - ReusablePool reus=ReusablePool.getInstance(); + ReusablePool reus = ReusablePool.getInstance(); assert(reus==ReusablePool.getInstance()); } From 2b0e45819be05dfa7973b05f3c50c26687859cfc Mon Sep 17 00:00:00 2001 From: ysi0000 Date: Thu, 21 Feb 2019 18:43:05 +0100 Subject: [PATCH 08/10] Update ReusablePoolTest.java --- .../gii/dass/test/c01/ReusablePoolTest.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java index 63e02e46..915a7849 100644 --- a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java +++ b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java @@ -9,6 +9,8 @@ import org.junit.Before; import org.junit.Test; +import ubu.gii.dass.c01.NotFreeInstanceException; +import ubu.gii.dass.c01.Reusable; import ubu.gii.dass.c01.ReusablePool; /** @@ -17,12 +19,14 @@ */ public class ReusablePoolTest { + + /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { - ReusablePool RPool=ReusablePool.getInstance(); + } @@ -49,7 +53,26 @@ public void testGetInstance() { */ @Test public void testAcquireReusable() { - fail("Not yet implemented"); + ReusablePool RPool=ReusablePool.getInstance(); + try { + Reusable r = RPool.acquireReusable(); + //assert(true); + } catch (NotFreeInstanceException e1) { + + } + try { + Reusable a= RPool.acquireReusable(); + //assert(true); + } catch (NotFreeInstanceException e) { + + } + try{ + RPool.acquireReusable(); + fail(); + }catch(NotFreeInstanceException ex){ + + } + } /** From 6e5a9f18a29440a68d151822cf9c59bcd6761a09 Mon Sep 17 00:00:00 2001 From: ysi0000 Date: Thu, 21 Feb 2019 18:56:18 +0100 Subject: [PATCH 09/10] Update ReusablePoolTest.java --- .../gii/dass/test/c01/ReusablePoolTest.java | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java index 915a7849..3aa7d2cb 100644 --- a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java +++ b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java @@ -9,6 +9,7 @@ import org.junit.Before; import org.junit.Test; +import ubu.gii.dass.c01.DuplicatedInstanceException; import ubu.gii.dass.c01.NotFreeInstanceException; import ubu.gii.dass.c01.Reusable; import ubu.gii.dass.c01.ReusablePool; @@ -54,25 +55,16 @@ public void testGetInstance() { @Test public void testAcquireReusable() { ReusablePool RPool=ReusablePool.getInstance(); - try { - Reusable r = RPool.acquireReusable(); - //assert(true); - } catch (NotFreeInstanceException e1) { - - } - try { - Reusable a= RPool.acquireReusable(); - //assert(true); - } catch (NotFreeInstanceException e) { - - } + int cont=2; + while(cont>0) { try{ RPool.acquireReusable(); - fail(); - }catch(NotFreeInstanceException ex){ + }catch(NotFreeInstanceException ex){ + assert(true); + } + cont--; } - } /** @@ -80,7 +72,20 @@ public void testAcquireReusable() { */ @Test public void testReleaseReusable() { - fail("Not yet implemented"); + ReusablePool RPool=ReusablePool.getInstance(); + Reusable r = new Reusable(); + Reusable a = new Reusable(); + int cont=3; + while(cont>0) { + try { + RPool.releaseReusable(r); + RPool.releaseReusable(a); + } catch (DuplicatedInstanceException e) { + // TODO Auto-generated catch block + assert(true); + } + cont--; + } } } From 768e274ccb8a08db13b35d600e3c426bb52fadf3 Mon Sep 17 00:00:00 2001 From: ysi0000 Date: Thu, 21 Feb 2019 19:27:46 +0100 Subject: [PATCH 10/10] Update ReusablePoolTest.java --- src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java index 3aa7d2cb..d70b7e0c 100644 --- a/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java +++ b/src/test/ubu/gii/dass/test/c01/ReusablePoolTest.java @@ -5,10 +5,13 @@ import static org.junit.Assert.*; +import java.lang.reflect.Array; + import org.junit.After; import org.junit.Before; import org.junit.Test; +import ubu.gii.dass.c01.Client; import ubu.gii.dass.c01.DuplicatedInstanceException; import ubu.gii.dass.c01.NotFreeInstanceException; import ubu.gii.dass.c01.Reusable; @@ -30,6 +33,8 @@ public void setUp() throws Exception { + + } /** @@ -44,8 +49,8 @@ public void tearDown() throws Exception { */ @Test public void testGetInstance() { - ReusablePool reus = ReusablePool.getInstance(); - assert(reus==ReusablePool.getInstance()); + ReusablePool pool = ReusablePool.getInstance(); + assert(pool==ReusablePool.getInstance()); } @@ -55,7 +60,7 @@ public void testGetInstance() { @Test public void testAcquireReusable() { ReusablePool RPool=ReusablePool.getInstance(); - int cont=2; + int cont=10; while(cont>0) { try{ RPool.acquireReusable();