rename cookie attribute to changeLogCookie & fix debug enabled by mistake
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.server.loggers.debug; |
| | |
| | | */ |
| | | public static boolean debugEnabled() |
| | | { |
| | | return true; |
| | | return enabled; |
| | | } |
| | | |
| | | /** |
| | |
| | | // MUST attributes |
| | | |
| | | // ECL Changelog draft change number |
| | | Attribute a = Attributes.create("changeNumber", |
| | | Attribute a = Attributes.create("changenumber", |
| | | String.valueOf(draftChangenumber)); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(a); |
| | |
| | | dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT_TIME); |
| | | dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); // ?? |
| | | a = Attributes.create( |
| | | DirectoryServer.getAttributeType("changeTime", true), |
| | | DirectoryServer.getAttributeType("changetime", true), |
| | | dateFormat.format(new Date(changeNumber.getTime()))); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(a); |
| | |
| | | */ |
| | | |
| | | // |
| | | a = Attributes.create("changeType", changetype); |
| | | a = Attributes.create("changetype", changetype); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(a); |
| | | uAttrs.put(a.getAttributeType(), attrList); |
| | |
| | | |
| | | // MAY attributes |
| | | |
| | | a = Attributes.create("replicationCSN", changeNumber.toString()); |
| | | a = Attributes.create("replicationcsn", changeNumber.toString()); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(a); |
| | | operationalAttrs.put(a.getAttributeType(), attrList); |
| | | |
| | | // |
| | | a = Attributes.create("replicaIdentifier", |
| | | a = Attributes.create("replicaidentifier", |
| | | Short.toString(changeNumber.getServerId())); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(a); |
| | |
| | | operationalAttrs.put(a.getAttributeType(), attrList); |
| | | } |
| | | |
| | | a = Attributes.create("cookie", cookie); |
| | | a = Attributes.create("changelogcookie", cookie); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(a); |
| | | operationalAttrs.put(a.getAttributeType(), attrList); |
| | |
| | | SearchScope.WHOLE_SUBTREE, |
| | | LDAPFilter.decode("(objectclass=*)")); |
| | | |
| | | debugInfo(tn, "Res code=" + op.getResultCode()); |
| | | debugInfo(tn, "Res OE=" + ResultCode.OPERATIONS_ERROR); |
| | | // Error because no cookie |
| | | assertEquals( |
| | | op.getResultCode(), ResultCode.OPERATIONS_ERROR, |
| | |
| | | { |
| | | if (i++==2) |
| | | cookie = |
| | | entry.getAttribute("cookie").get(0).iterator().next().toString(); |
| | | entry.getAttribute("changelogcookie").get(0).iterator().next().toString(); |
| | | } |
| | | catch(NullPointerException e) |
| | | {} |
| | |
| | | try |
| | | { |
| | | cookie = |
| | | entry.getAttribute("cookie").get(0).iterator().next().toString(); |
| | | entry.getAttribute("changelogcookie").get(0).iterator().next().toString(); |
| | | } |
| | | catch(NullPointerException e) |
| | | {} |
| | |
| | | try |
| | | { |
| | | cookie = |
| | | resultEntry.getAttribute("cookie").get(0).iterator().next().toString(); |
| | | resultEntry.getAttribute("changelogcookie").get(0).iterator().next().toString(); |
| | | } |
| | | catch(NullPointerException e) |
| | | {} |
| | |
| | | try |
| | | { |
| | | cookie = |
| | | resultEntry.getAttribute("cookie").get(0).iterator().next().toString(); |
| | | resultEntry.getAttribute("changelogcookie").get(0).iterator().next().toString(); |
| | | } |
| | | catch(NullPointerException e) |
| | | {} |
| | |
| | | 0, // Size limit |
| | | 0, // Time limit |
| | | false, // Types only |
| | | LDAPFilter.decode("(targetDN=*"+tn+"*,o=test)"), |
| | | LDAPFilter.decode("(targetdn=*"+tn+"*,o=test)"), |
| | | attributes, |
| | | controls, |
| | | null); |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"1," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","delete"); |
| | | checkValue(resultEntry,"cookie","o=test:"+cn1.toString()+";"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn1.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",tn+"uuid1"); |
| | | checkValue(resultEntry,"changenumber","-1"); |
| | | } else if (i==2) |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"2," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","add"); |
| | | checkValue(resultEntry,"cookie","o=test:"+cn2.toString()+";"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn2.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber","-1"); |
| | | } else if (i==3) |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"3," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","modify"); |
| | | checkValue(resultEntry,"cookie","o=test:"+cn3.toString()+";"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn3.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",tn+"uuid3"); |
| | | checkValue(resultEntry,"changenumber","-1"); |
| | | } else if (i==4) |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"4," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","modrdn"); |
| | | checkValue(resultEntry,"cookie","o=test:"+cn4.toString()+";"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn4.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",tn+"uuid4"); |
| | | checkValue(resultEntry,"newrdn","uid=ECLDirectAllOpsnew4"); |
| | | checkValue(resultEntry,"newsuperior",TEST_ROOT_DN_STRING2); |