X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Frequest%2Ftest%2FNSAttribCompare.java;h=7f7b09ce6224db94074e48a1a78c8426af008c64;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=9f6ce21ea4c6a8afe310be4ac1ff6c1c5cf5d08a;hpb=71037c39a37d3549dcfe31926832a657744fbe05;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/request/test/NSAttribCompare.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/request/test/NSAttribCompare.java index 9f6ce21e..7f7b09ce 100644 --- a/auth/auth-core/src/test/java/org/onap/aaf/auth/request/test/NSAttribCompare.java +++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/request/test/NSAttribCompare.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,62 +32,62 @@ import aaf.v2_0.NsAttribRequest; import aaf.v2_0.NsAttribRequest.Attrib; public class NSAttribCompare extends RosettaCompare { - public NSAttribCompare() { - super(NsAttribRequest.class); - } - - public static NsAttribRequest create() { - NsAttribRequest nar = new NsAttribRequest(); - String in = instance(); - - nar.setNs("org.osaaf.ns"+in); - Attrib attrib = new Attrib(); - attrib.setKey("swm"); - attrib.setValue("v"+instance()); - nar.getAttrib().add(attrib); - attrib = new Attrib(); - attrib.setKey("scamp"); - attrib.setValue("v"+instance()); - nar.getAttrib().add(attrib); - GregorianCalendar gc = new GregorianCalendar(); - nar.setStart(Chrono.timeStamp(gc)); - gc.add(GregorianCalendar.MONTH, 1); - nar.setEnd(Chrono.timeStamp(gc)); - return nar; - } - - @Override - public void compare(NsAttribRequest t1, NsAttribRequest t2) { - assertEquals(t1.getNs(),t2.getNs()); - for(Attrib a1 : t1.getAttrib()) { - boolean ok = false; - for(Attrib a2 : t2.getAttrib()) { - if(a1.getKey().equals(a2.getKey()) && - a1.getValue().equals(a2.getValue())) { - ok = true; - break; - } - } - assertTrue("a2 Attribs in a1",ok); - } - for(Attrib a2 : t2.getAttrib()) { - boolean ok = false; - for(Attrib a1 : t1.getAttrib()) { - if(a1.getKey().equals(a2.getKey()) && - a1.getValue().equals(a2.getValue())) { - ok = true; - break; - } - } - assertTrue("a2 Attribs in a1",ok); - } - assertEquals(t1.getStart(),t2.getStart()); - assertEquals(t1.getEnd(),t2.getEnd()); - } + public NSAttribCompare() { + super(NsAttribRequest.class); + } + + public static NsAttribRequest create() { + NsAttribRequest nar = new NsAttribRequest(); + String in = instance(); + + nar.setNs("org.osaaf.ns"+in); + Attrib attrib = new Attrib(); + attrib.setKey("swm"); + attrib.setValue("v"+instance()); + nar.getAttrib().add(attrib); + attrib = new Attrib(); + attrib.setKey("scamp"); + attrib.setValue("v"+instance()); + nar.getAttrib().add(attrib); + GregorianCalendar gc = new GregorianCalendar(); + nar.setStart(Chrono.timeStamp(gc)); + gc.add(GregorianCalendar.MONTH, 1); + nar.setEnd(Chrono.timeStamp(gc)); + return nar; + } + + @Override + public void compare(NsAttribRequest t1, NsAttribRequest t2) { + assertEquals(t1.getNs(),t2.getNs()); + for (Attrib a1 : t1.getAttrib()) { + boolean ok = false; + for (Attrib a2 : t2.getAttrib()) { + if (a1.getKey().equals(a2.getKey()) && + a1.getValue().equals(a2.getValue())) { + ok = true; + break; + } + } + assertTrue("a2 Attribs in a1",ok); + } + for (Attrib a2 : t2.getAttrib()) { + boolean ok = false; + for (Attrib a1 : t1.getAttrib()) { + if (a1.getKey().equals(a2.getKey()) && + a1.getValue().equals(a2.getValue())) { + ok = true; + break; + } + } + assertTrue("a2 Attribs in a1",ok); + } + assertEquals(t1.getStart(),t2.getStart()); + assertEquals(t1.getEnd(),t2.getEnd()); + } - @Override - public NsAttribRequest newOne() { - return create(); - } + @Override + public NsAttribRequest newOne() { + return create(); + } } \ No newline at end of file