(01:37:22 AM) ccustine: BTW, I started using JUnit 4.4 last week and it works fine with our builds... but I only played with it very briefly (01:37:28 AM) elecharny: oh (01:37:43 AM) ccustine: but we really have to restructure the abstract test classes (01:37:45 AM) elecharny: I would be very interested if you can commit such a test in a sandbox (01:38:12 AM) ccustine: what I have not tried is using the annotations in the abstract classes (01:38:19 AM) elecharny: I was also thinking of using some kind of scripted tests (01:38:21 AM) ccustine: to get consistent behavior (01:38:24 AM) elecharny: yes (01:38:26 AM) ccustine: sure... (01:38:28 AM) akarasulu: ccustine: yeah that would be broken up into @Before and @After classes for pre and post (01:38:49 AM) akarasulu: elecharny: I have an idea on this stuff btw (01:38:54 AM) elecharny: akarasulu: I think we can use @Before and @Afterclass on the main class (01:38:56 AM) akarasulu: about reverting to previous state (01:39:23 AM) elecharny: the only way to be sure you revert correctly is to do it by hand (01:39:48 AM) elecharny: or to remove the added elements and nd to injects the new one (01:40:09 AM) elecharny: ditching the tested partition may work too (01:40:31 AM) elecharny: for instance, if all tests are done in a dc=test, dc=org partition, (01:40:52 AM) elecharny: then you can set it up on startup and delete it on teardown (01:41:21 AM) elecharny: (but for @BefoeTest and @AfterTest, not during a @BeforeClass and @AfterClass) (01:41:59 AM) akarasulu: elecharny: the biggest cost is in setting up a partition (01:42:08 AM) akarasulu: the record manager grabbing extents is the big problem (01:42:45 AM) akarasulu: You need to generate an ANTI-LDIF using the changelog interceptor. Then play back the ANTI-LDIF. (01:42:59 AM) akarasulu: that fixes the problem (01:43:21 AM) akarasulu: minus a few minor details hehe (01:43:27 AM) akarasulu: but they will be ok (01:43:38 AM) akarasulu: (talking about timestamps) (01:44:09 AM) akarasulu: but tests don't depend on this and timestamps are updated anyways when creating new partitions and filling them (01:44:33 AM) akarasulu: meaning it's not a full revert as a transaction rollback would have but it will do the job for us (01:46:39 AM) akarasulu: elecharny: still there? (01:46:56 AM) elecharny: yep (01:47:20 AM) elecharny: just an idea : (01:47:43 AM) elecharny: what about simply removing all the entries starting at a specific date creation ? (01:47:50 AM) elecharny: simple, easy, and fast (01:47:51 AM) akarasulu: hmmmm (01:48:01 AM) elecharny: whenyou start a test, you inject some entries, (01:48:07 AM) akarasulu: that could work to yeah (01:48:14 AM) elecharny: and then at the end, you remove all the crated entries based on the creation Date (01:48:21 AM) akarasulu: so you have S0 (server started state) (01:48:25 AM) elecharny: no complex anti-ldif to compute (01:48:29 AM) akarasulu: you take the zulu time there (01:48:42 AM) akarasulu: then delete everything created after that (01:48:46 AM) akarasulu: hmm there are problems (01:48:48 AM) elecharny: you simply create a fake entry, and lookup for it, asking for its creation date (01:48:59 AM) akarasulu: what if your test modifies existing things (01:49:03 AM) akarasulu: like admin user (01:49:12 AM) akarasulu: admin changes their password for example (01:49:16 AM) elecharny: for existing partitions, like the ou=system, (01:49:27 AM) elecharny: this is something we won't test this way SNIP ... (01:55:41 AM) akarasulu: however the approach I talk about is wholistic (01:55:48 AM) akarasulu: and really works across partitions (01:55:52 AM) elecharny: you mean the anti-ldif ? (01:55:54 AM) akarasulu: and can be used for many other things (01:55:56 AM) akarasulu: yeah (01:56:11 AM) elecharny: yes, but this is pretty complex (01:56:16 AM) akarasulu: it's not that hard to implement really (01:56:22 AM) akarasulu: nah man not really (01:56:32 AM) akarasulu: ersin did this before at some point (01:56:32 AM) elecharny: for add, no (01:56:37 AM) akarasulu: subversion does this to rollback (01:56:38 AM) elecharny: but for delete for instance ? (01:56:52 AM) akarasulu: did you read my email or just glance through it (01:56:56 AM) akarasulu: the rules are simple (01:56:59 AM) elecharny: I'm commenting it (01:57:12 AM) akarasulu: Delete => Add (anti-op) (01:57:30 AM) akarasulu: this can be used for so many things down the line (01:57:42 AM) elecharny: yes, but then you have to read the data before deleting it, otherwise you cant' add it (01:57:53 AM) elecharny: del use a single DN (01:57:55 AM) akarasulu: interceptor has this info (01:58:19 AM) akarasulu: when you do a delete you most of the time have a handle on the object to be deletede (01:58:21 AM) elecharny: but if you add an interceptor, you are modifying the server behavior (01:58:22 AM) akarasulu: when you do a delete you most of the time have a handle on the object to be deleted (01:58:44 AM) elecharny: del just need a DN (01:58:47 AM) akarasulu: ok heisenberg (01:59:53 AM) akarasulu: this is really not that hard at all to do and ersin has wrote such an interceptor already here ... (02:00:16 AM) akarasulu: https://svn.safehaus.org/repos/sandbox/workshop/interceptor/src/main/java/workshop/interceptor/ChangeLogInterceptor.java (02:00:22 AM) akarasulu: it works really well (02:00:36 AM) akarasulu: this can be used with tooling to control snapshotting in the server (02:00:47 AM) akarasulu: just think oops you just deleted a bunch of *#(@&^@% (02:00:53 AM) akarasulu: how do you roll it back (02:00:58 AM) akarasulu: this is after a transaction (02:01:06 AM) akarasulu: (if we even had transactions) (02:01:28 AM) akarasulu: then you &#^@(*$& your pants and think you just lost 4 hrs to restore from backups since you did not use mitosis (02:01:30 AM) akarasulu: :D (02:01:33 AM) elecharny: man, just have a look at the Del ope in this interceptor (02:01:35 AM) akarasulu: but this (*#$&@^&@ can save you (02:01:47 AM) elecharny: you have _no clue_ on the attributes which have been deleted (02:01:54 AM) elecharny: haw possibly can you restore them then ? (02:02:01 AM) akarasulu: del op deletes and entry (02:02:08 AM) akarasulu: elecharny: you can do it man (02:02:12 AM) elecharny: it delete an entry using its DN (02:02:19 AM) akarasulu: I'm telling you this is not impossible and not hard to do (02:02:20 AM) elecharny: if you want to restore the entry, (02:02:28 AM) elecharny: you will have to read all of it's attribute first (02:02:35 AM) akarasulu: you can do this (02:02:37 AM) elecharny: yes, we can do it (02:02:56 AM) akarasulu: but not hard at all (02:03:19 AM) elecharny: but I don't like at all the idea to inject an interceptor to test the server (02:03:20 AM) akarasulu: really if you gave it a try you can have it knocked out in less than 2 days (02:03:35 AM) akarasulu: well this interceptor will be optional even in production time (02:03:46 AM) akarasulu: and it can track your log of requests to the server (02:03:52 AM) akarasulu: this was what you were looking for (02:03:55 AM) elecharny: for modifyDN, it will be complex (02:04:07 AM) akarasulu: nah just switch src and target (02:04:10 AM) akarasulu: in anti op (02:04:15 AM) elecharny: transaction would save our *&@^#$^@ ... ;) (02:04:39 AM) akarasulu: hmm for this little case it can yes but however it will not save users who commit incorrectly ;) (02:04:47 AM) akarasulu: you still need this rollback capability (02:04:53 AM) akarasulu: this snapshoting (02:05:03 AM) akarasulu: this is how subversion does it (02:05:13 AM) elecharny: transcations without rollback are useless, true (02:05:16 AM) akarasulu: it's all a series of diff operations (02:05:28 AM) akarasulu: you apply anti-diff to get back to earlier state (02:05:33 AM) akarasulu: but you go forward (02:05:35 AM) akarasulu: in txn (02:05:47 AM) akarasulu: but even with txn your ($*&Q&^@ after you commit (02:06:00 AM) akarasulu: if you commit wrong )(*#&^@^ as a user you still deleted #&@^#$*@& you cannot get back (02:06:10 AM) akarasulu: and with replication you just replicated it to the rest of the cluster (02:06:20 AM) akarasulu: so good luck (02:06:51 AM) elecharny: it can work (02:06:53 AM) akarasulu: this feature can be done fast and can be used to kill 2 big birds with one stone (02:07:01 AM) akarasulu: think about studio with a plugin for ADS (02:07:02 AM) elecharny: bt we should not do complex things (02:07:11 AM) akarasulu: this is not that complex (02:07:14 AM) akarasulu: search is complex (02:07:21 AM) akarasulu: this is simple with clear rules (02:07:22 AM) elecharny: like, if we mod an entry, to rollback, we just restore the old entry (02:07:40 AM) elecharny: if we del an entry, we rollback by restoring the previous entry (02:07:40 AM) akarasulu: nah we do anti-op know why? (02:07:49 AM) akarasulu: this also serves as a recording mechanism (02:08:03 AM) akarasulu: if you just resusitate instead of anti operation you don't capture the full log (02:08:17 AM) elecharny: you want to have this rollback interceptor, then (02:08:19 AM) akarasulu: you can roll forward and back and forward and back to your hearts content (02:08:22 AM) elecharny: and use it for test ? (02:08:26 AM) akarasulu: for now (02:08:30 AM) akarasulu: but have it in the server (02:08:45 AM) elecharny: ok, I buy your idea (02:08:54 AM) elecharny: becaus eit won't be only for tests (02:09:04 AM) akarasulu: exactly (02:09:05 AM) elecharny: but can be used for someting else (02:09:11 AM) akarasulu: it will actually help for 3 things (02:09:21 AM) akarasulu: (1) test speed boost (minimal value) (02:09:35 AM) akarasulu: (2) recording and playback for complex test cases (02:09:53 AM) akarasulu: (3) for snapshoting and rolling back the server to previous states (02:10:03 AM) elecharny: I would add a 4 case : (02:10:06 AM) akarasulu: oh? (02:10:21 AM) elecharny: 4) To create journals to be used if the server crash (02:10:38 AM) akarasulu: ahhh yeah sure totally can be used for that (02:10:46 AM) elecharny: that is very importantn (02:10:48 AM) akarasulu: I'd inject some meta info for that (02:10:58 AM) akarasulu: also we can encode snapshots in there (02:10:58 AM) elecharny: as we only synch data on disk every 15 seconds (default value) (02:11:05 AM) akarasulu: even expose this data as a special partition (02:11:11 AM) elecharny: hmmm (02:11:20 AM) elecharny: that would be costly (02:11:25 AM) elecharny: I would prefer a text file (02:11:37 AM) akarasulu: oh was talking about snapshots (02:11:46 AM) elecharny: ok (02:11:48 AM) akarasulu: like gimme a snapshot (02:11:59 AM) elecharny: let's talk about those ideas on the ML (02:11:59 AM) akarasulu: but in ldif we can encode with special comment (02:12:07 AM) elecharny: there are reallly interesting for the community (02:12:14 AM) akarasulu: # SNAPSHOT: ( id, date ) (02:12:26 AM) akarasulu: yeah this is cool (02:12:36 AM) akarasulu: been dying to do this stuff for years (02:12:42 AM) akarasulu: thought ersin would do them and he came close (02:12:48 AM) akarasulu: then we moved on as usual (02:12:52 AM) akarasulu: but now we have serveral drivers (02:12:56 AM) akarasulu: several (02:13:02 AM) akarasulu: so it may actually materialize (02:13:47 AM) akarasulu: hey btw we can even have a special extended op that sends a gzipped version of an anti-log or a segment of it back to studio to be looked at (02:13:56 AM) elecharny: wiki ! (02:13:58 AM) elecharny: wiki ! (02:13:58 AM) akarasulu: perhaps we can expose a read only partition to show this info as well (02:14:00 AM) elecharny: wiki ! (02:14:06 AM) akarasulu: aye you got the text :D