Skip to content

Commit

Permalink
Final Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-coni committed Feb 20, 2024
1 parent 32f5af6 commit d88d796
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public void ValidPathTest(){
Assert.assertNotNull(error);
}

//Assert.assertNull(error);


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.data.ACL;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -121,7 +117,7 @@ public void createNodeTest(){


} catch (KeeperException.NoNodeException | KeeperException.NodeExistsException e) {
//throw new RuntimeException(e);

e.printStackTrace();
error = e;
Assert.assertNotNull(error);
Expand All @@ -140,7 +136,7 @@ public void createNodeExistingTest(){

try{
System.out.println("\n"+ this.path + "\n");
//gia esiste
//gia esistente
this.dataTree.createNode(this.path, this.data, this.acl, this.ephemeralOwner, this.parentCVersion, this.zxid, this.time);
this.dataTree.createNode(this.path, this.data, this.acl, this.ephemeralOwner, this.parentCVersion, this.zxid, this.time);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.data.ACL;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import static org.junit.Assert.*;
@RunWith(Parameterized.class)
public class CreateNodeInvalidPathTest {

Expand Down Expand Up @@ -41,35 +37,6 @@ public CreateNodeInvalidPathTest(String path, byte[] data, List<ACL> acl, long e
//l'inizializzazione del dataTree manca per realizzare il path invalido
}

/*@Before
public void setUpTree() {
if(path != null) {
try {
String[] pathElements = path.split("/");
System.out.println(Arrays.toString(pathElements));
String oldPath = "";
int i = 1;
for (String elem : pathElements) {
System.out.println(pathElements.length + " i: " + i);
if (!(pathElements.length == i || i == 1)) {
System.out.println(oldPath + "/" + pathElements[i - 1]);
this.dataTree.createNode(oldPath + "/" + pathElements[i - 1], new byte[10], ZooDefs.Ids.CREATOR_ALL_ACL, 0, dataTree.getNode(oldPath).stat.getCversion(), 0, 1);
oldPath = oldPath + "/" + pathElements[i - 1];
}
i++;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}*/

@Parameterized.Parameters
public static Collection<Object[]> getParameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void deleteNodeTest(){

}

@Test //prova miglioramento Container
@Test // miglioramento Container
public void deleteNodeContTest(){

Exception error;
Expand Down

0 comments on commit d88d796

Please sign in to comment.