From 0236a88fb454682608c28f7c21716d9288b56bec Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 3 Mar 2014 09:38:27 +0100 Subject: added tweaked stork2-commons source --- .../AttributeProvidersMapTestCase.java.svn-base | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base (limited to 'id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base') diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base new file mode 100644 index 000000000..2e8cc2e62 --- /dev/null +++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base @@ -0,0 +1,134 @@ +package eu.stork.peps.tests; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import eu.stork.peps.auth.commons.AttributeProvider; +import eu.stork.peps.auth.commons.AttributeProvidersMap; +import eu.stork.peps.auth.commons.AttributeSource; +import eu.stork.peps.auth.commons.Country; +import eu.stork.peps.auth.commons.IAttributeProvidersMap; +import eu.stork.peps.auth.commons.IPersonalAttributeList; +import eu.stork.peps.auth.commons.PersonalAttributeList; + +/** + * The AttributeSource's Test Case. + * + * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr) + * + * @version $Revision: $, $Date: $ + */ +public class AttributeProvidersMapTestCase { + + @Test + public void testObjectOK1() { + IAttributeProvidersMap map = new AttributeProvidersMap(); + AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(source) ) { + outcome = true; + } + + assertTrue(outcome); + } + + @Test + public void testObjectOK2() { + IAttributeProvidersMap map = new AttributeProvidersMap(); + AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(source) ) { + if ( map.get(source)!=null ) { + outcome = true; + } + } + + assertTrue(outcome); + } + + @Test + public void testObjectOK3() { + IAttributeProvidersMap map = new AttributeProvidersMap(); + AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + outcome = true; + } + + assertTrue(outcome); + } + + @Test + public void testObjectOK4() { + IAttributeProvidersMap map = new AttributeProvidersMap(); + AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + if ( map.get(target)!=null ) { + outcome = true; + } + } + + assertTrue(outcome); + } + + @Test + public void testObjectNOK1() { + IAttributeProvidersMap map = new AttributeProvidersMap(); + AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL"); + IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + outcome = true; + } + + assertFalse(outcome); + } + + @Test + public void testObjectNOK2() { + IAttributeProvidersMap map = new AttributeProvidersMap(); + AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); + AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1"), "URL"); + IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + outcome = true; + } + + assertFalse(outcome); + } +} -- cgit v1.2.3 From 0b3249e37b26e029c576127654dca31bff4a5a63 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Mon, 17 Mar 2014 18:23:52 +0100 Subject: removing old samlengine and storkcommons --- .../AttributeProvidersMapTestCase.java.svn-base | 134 --------------------- 1 file changed, 134 deletions(-) delete mode 100644 id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base (limited to 'id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base') diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base deleted file mode 100644 index 2e8cc2e62..000000000 --- a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base +++ /dev/null @@ -1,134 +0,0 @@ -package eu.stork.peps.tests; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import eu.stork.peps.auth.commons.AttributeProvider; -import eu.stork.peps.auth.commons.AttributeProvidersMap; -import eu.stork.peps.auth.commons.AttributeSource; -import eu.stork.peps.auth.commons.Country; -import eu.stork.peps.auth.commons.IAttributeProvidersMap; -import eu.stork.peps.auth.commons.IPersonalAttributeList; -import eu.stork.peps.auth.commons.PersonalAttributeList; - -/** - * The AttributeSource's Test Case. - * - * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr) - * - * @version $Revision: $, $Date: $ - */ -public class AttributeProvidersMapTestCase { - - @Test - public void testObjectOK1() { - IAttributeProvidersMap map = new AttributeProvidersMap(); - AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - IPersonalAttributeList pal = new PersonalAttributeList(); - boolean outcome = false; - - //Add a single item - map.put(source, pal); - - if ( map.containsKey(source) ) { - outcome = true; - } - - assertTrue(outcome); - } - - @Test - public void testObjectOK2() { - IAttributeProvidersMap map = new AttributeProvidersMap(); - AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - IPersonalAttributeList pal = new PersonalAttributeList(); - boolean outcome = false; - - //Add a single item - map.put(source, pal); - - if ( map.containsKey(source) ) { - if ( map.get(source)!=null ) { - outcome = true; - } - } - - assertTrue(outcome); - } - - @Test - public void testObjectOK3() { - IAttributeProvidersMap map = new AttributeProvidersMap(); - AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - IPersonalAttributeList pal = new PersonalAttributeList(); - boolean outcome = false; - - //Add a single item - map.put(source, pal); - - if ( map.containsKey(target) ) { - outcome = true; - } - - assertTrue(outcome); - } - - @Test - public void testObjectOK4() { - IAttributeProvidersMap map = new AttributeProvidersMap(); - AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - IPersonalAttributeList pal = new PersonalAttributeList(); - boolean outcome = false; - - //Add a single item - map.put(source, pal); - - if ( map.containsKey(target) ) { - if ( map.get(target)!=null ) { - outcome = true; - } - } - - assertTrue(outcome); - } - - @Test - public void testObjectNOK1() { - IAttributeProvidersMap map = new AttributeProvidersMap(); - AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL"); - IPersonalAttributeList pal = new PersonalAttributeList(); - boolean outcome = false; - - //Add a single item - map.put(source, pal); - - if ( map.containsKey(target) ) { - outcome = true; - } - - assertFalse(outcome); - } - - @Test - public void testObjectNOK2() { - IAttributeProvidersMap map = new AttributeProvidersMap(); - AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL"); - AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1"), "URL"); - IPersonalAttributeList pal = new PersonalAttributeList(); - boolean outcome = false; - - //Add a single item - map.put(source, pal); - - if ( map.containsKey(target) ) { - outcome = true; - } - - assertFalse(outcome); - } -} -- cgit v1.2.3 From e6144cfe09bb148638911660eeb492fee7ab8079 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Mar 2014 11:43:22 +0100 Subject: fixed serializable issues in stork2-commons --- .../AttributeProvidersMapTestCase.java.svn-base | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base (limited to 'id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base') diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base new file mode 100644 index 000000000..89f5adbed --- /dev/null +++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base @@ -0,0 +1,134 @@ +package eu.stork.peps.tests; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import eu.stork.peps.auth.commons.AttributeProvider; +import eu.stork.peps.auth.commons.AttributeProvidersMap; +import eu.stork.peps.auth.commons.AttributeSource; +import eu.stork.peps.auth.commons.Country; +import eu.stork.peps.auth.commons.IAttributeProvidersMap; +import eu.stork.peps.auth.commons.IPersonalAttributeList; +import eu.stork.peps.auth.commons.PersonalAttributeList; + +/** + * The AttributeSource's Test Case. + * + * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr) + * + * @version $Revision: $, $Date: $ + */ +public class AttributeProvidersMapTestCase { + + @Test + public void testObjectOK1() { + final IAttributeProvidersMap map = new AttributeProvidersMap(); + final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(source) ) { + outcome = true; + } + + assertTrue(outcome); + } + + @Test + public void testObjectOK2() { + final IAttributeProvidersMap map = new AttributeProvidersMap(); + final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(source) ) { + if ( map.get(source)!=null ) { + outcome = true; + } + } + + assertTrue(outcome); + } + + @Test + public void testObjectOK3() { + final IAttributeProvidersMap map = new AttributeProvidersMap(); + final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + outcome = true; + } + + assertTrue(outcome); + } + + @Test + public void testObjectOK4() { + final IAttributeProvidersMap map = new AttributeProvidersMap(); + final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + if ( map.get(target)!=null ) { + outcome = true; + } + } + + assertTrue(outcome); + } + + @Test + public void testObjectNOK1() { + final IAttributeProvidersMap map = new AttributeProvidersMap(); + final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL"); + final IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + outcome = true; + } + + assertFalse(outcome); + } + + @Test + public void testObjectNOK2() { + final IAttributeProvidersMap map = new AttributeProvidersMap(); + final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL"); + final AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1", null), "URL"); + final IPersonalAttributeList pal = new PersonalAttributeList(); + boolean outcome = false; + + //Add a single item + map.put(source, pal); + + if ( map.containsKey(target) ) { + outcome = true; + } + + assertFalse(outcome); + } +} -- cgit v1.2.3