Auto stash before merge of "develop" and "origin/develop"

This commit is contained in:
GME 2018-11-16 18:09:37 +01:00
parent 153e046928
commit 0c218822c9
11 changed files with 59 additions and 5 deletions

View file

@ -0,0 +1,7 @@
package Application;
public class App {
public static void main(String [ ] args){
System.out.println("Welcome");
}
}

View file

@ -97,6 +97,7 @@ public class Util {
}
}
/*
public static CAEnrollement getEnrollement(String keyFolderPath, String keyFileName, String certFolderPath, String certFileName) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, CryptoException {
PrivateKey key = null;
String certificate = null;
@ -131,4 +132,5 @@ public class Util {
CAEnrollement enrollment = new CAEnrollement(key,certificate);
return enrollment;
}
*/
}

View file

@ -0,0 +1,45 @@
package blockchain.query;
import blockchain.client.FabricClientWrapper;
import blockchain.configuration.Config;
import blockchain.user.UserContext;
import blockchain.utility.Util;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.hyperledger.fabric.sdk.Enrollment;
import org.hyperledger.fabric.sdk.Peer;
import org.junit.Test;
import java.io.File;
import java.util.Set;
public class QueryForChannelsTest {
private static Logger logger = Logger.getLogger(QueryForChannelsTest.class);
@Test
public void TestAQueryPeerChannels(){
BasicConfigurator.configure();
try{
//TEST
UserContext admin = new UserContext();
File pkFolder = new File(Config.ADMIN_KEY_PATH);
File[] pkFile = pkFolder.listFiles();
File certFolder = new File(Config.ADMIN_CERT_PATH);
File[] certFile = certFolder.listFiles();
admin.setName(Config.ADMIN);
admin.setMspId(Config.ORG1_MSP);
admin.setAffiliation(Config.ORG1);
//Enrollment enrollAdmin = Util.getEnrollement(Config.ADMIN_KEY_PATH, pkFile[0].getName(), Config.ADMIN_CERT_PATH, certFile[0].getName());
//admin.setEnrollment(enrollAdmin);
//END TEST
//FabricClientWrapper fabricClientWrapper = new FabricClientWrapper(admin);
//Peer peer = fabricClientWrapper.getClient().newPeer(Config.ORG1_PEER_0,Config.ORG1_PEER_0_URL);
//Set<String> channels = fabricClientWrapper.getClient().queryChannels(peer);
//logger.info(channels);
}catch(Exception e){
e.printStackTrace();
}
}
}

View file

@ -21,8 +21,8 @@ public class QueryTest {
public void TestAQueryChannels() {
BasicConfigurator.configure();
UserContext user = Util.readUserContext(Config.ORG1,Config.ADMIN);
//UserContext user = Util.readUserContext(Config.ORG1,"User-org1");
//UserContext user = Util.readUserContext(Config.ORG1,Config.ADMIN);
UserContext user = Util.readUserContext(Config.ORG1,"User-org1");
try{

View file

@ -22,10 +22,10 @@ public class UtilEnrollTest {
File certFolder = new File(Config.ADMIN_CERT_PATH);
File[] certFile = certFolder.listFiles();
logger.info("----- GET ENROLLEMENT ----");
Enrollment enrollAdmin = Util.getEnrollement(Config.ADMIN_KEY_PATH, pkFile[0].getName(), Config.ADMIN_CERT_PATH, certFile[0].getName());
//Enrollment enrollAdmin = Util.getEnrollement(Config.ADMIN_KEY_PATH, pkFile[0].getName(), Config.ADMIN_CERT_PATH, certFile[0].getName());
logger.info("KEY : "+enrollAdmin.getKey());
logger.info("CERT : "+enrollAdmin.getCert());
//logger.info("KEY : "+enrollAdmin.getKey());
//logger.info("CERT : "+enrollAdmin.getCert());
}catch (Exception e){

Binary file not shown.