op2.add( new AddEntryOperation( csn, new LdapName( "ou=a" ), new BasicAttributes() ) ); op2.add( new AddAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) ); op2.add( new ReplaceAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) ); op2.add( new DeleteAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );
op2.add( new AddEntryOperation( csn, new LdapDN( "ou=a" ), new BasicAttributes( true ) ) ); op2.add( new AddAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute( "id", "valie" ) ) ); op2.add( new ReplaceAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute( "id", "valie" ) ) ); op2.add( new DeleteAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );
    private void subTestWriteLog() throws Exception    {        CSN csn = csnFactory.newInstance( REPLICA_ID );        CompositeOperation op1 = new CompositeOperation( csn );        op1.add( new AddEntryOperation( csn, new LdapName( "ou=a" ), new BasicAttributes() ) );        op1.add( new AddAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );        op1.add( new ReplaceAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );        op1.add( new DeleteAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );                store.putLog( op1 );        testGetLogs( csn, op1 );        csn = csnFactory.newInstance( OTHER_REPLICA_ID );        CompositeOperation op2 = new CompositeOperation( csn );        op2.add( new AddEntryOperation( csn, new LdapName( "ou=a" ), new BasicAttributes() ) );        op2.add( new AddAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );        op2.add( new ReplaceAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );        op2.add( new DeleteAttributeOperation( csn, new LdapName( "ou=a" ), new BasicAttribute( "id", "valie" ) ) );                store.putLog( op2 );        testGetLogs( csn, op2 );                Assert.assertEquals( 2, store.getLogSize() );        Assert.assertEquals( 1, store.getLogSize( REPLICA_ID ) );        Assert.assertEquals( 1, store.getLogSize( OTHER_REPLICA_ID ) );                // Test getLogs(CSNVector, true)        List expected = new ArrayList();        expected.add( op1 );        expected.add( op2 );        CSNVector updateVector = new CSNVector();        testGetLogs( updateVector, true, expected );        updateVector = new CSNVector();        updateVector.setCSN( op1.getCSN() );        testGetLogs( updateVector, true, expected );        updateVector = new CSNVector();        updateVector.setCSN( op2.getCSN() );        testGetLogs( updateVector, true, expected );        updateVector = new CSNVector();        updateVector.setCSN( op1.getCSN() );        updateVector.setCSN( op2.getCSN() );        testGetLogs( updateVector, true, expected );        // Test getLogs(CSNVector, false)        expected = new ArrayList();        expected.add( op1 );        expected.add( op2 );        updateVector = new CSNVector();        testGetLogs( updateVector, false, expected );        expected = new ArrayList();        expected.add( op2 );        updateVector = new CSNVector();        updateVector.setCSN( op1.getCSN() );        testGetLogs( updateVector, false, expected );        expected = new ArrayList();        expected.add( op1 );        updateVector = new CSNVector();        updateVector.setCSN( op2.getCSN() );        testGetLogs( updateVector, false, expected );        expected = new ArrayList();        updateVector = new CSNVector();        updateVector.setCSN( op1.getCSN() );        updateVector.setCSN( op2.getCSN() );        testGetLogs( updateVector, false, expected );    }