Mercurial > hg > Members > tatsuki > JungleXMLReader
changeset 30:f45b1c839753
use Index isActive
author | one |
---|---|
date | Fri, 07 Nov 2014 03:44:59 +0900 |
parents | 626e56f749a9 |
children | 7f70341a78bc |
files | src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JuGrix.java src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/isActiveTest.java |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JuGrix.java Fri Nov 07 03:22:11 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JuGrix.java Fri Nov 07 03:44:59 2014 +0900 @@ -50,13 +50,13 @@ InterfaceTraverser ifTraverser = personTree.getTraverser(); Iterator<Pair<TreeNode, NodePath>> pairIterator = ifTraverser.find((TreeNode node) -> { - String personId = node.getAttributes().getString("id"); + String personId = node.getAttributes().getString("Person-id"); if (personId == null) return false; if (personId.equals(id)) return true; return false; - }, "id", id); + }, "Person-id", id); if (pairIterator.hasNext()) return true;
--- a/src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/isActiveTest.java Fri Nov 07 03:22:11 2014 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/isActiveTest.java Fri Nov 07 03:44:59 2014 +0900 @@ -28,13 +28,20 @@ @Test public void Person_idsTest(){ - JuGrix jugrix = new JuGrix(); + JuGrix jugrix = new JuGrix(false); String personId = "p:1"; Assert.assertTrue(jugrix.isActive(personId)); personId = "p:100"; Assert.assertFalse(jugrix.isActive(personId)); + + jugrix = new JuGrix(true); + personId = "p:1"; + Assert.assertTrue(jugrix.isActive(personId)); + + personId = "p:100"; + Assert.assertFalse(jugrix.isActive(personId)); } }