Auto stash before merge of "develop" and "origin/develop"
This commit is contained in:
parent
153e046928
commit
0c218822c9
7
src/main/java/Application/App.java
Normal file
7
src/main/java/Application/App.java
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package Application;
|
||||||
|
|
||||||
|
public class App {
|
||||||
|
public static void main(String [ ] args){
|
||||||
|
System.out.println("Welcome");
|
||||||
|
}
|
||||||
|
}
|
|
@ -97,6 +97,7 @@ public class Util {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public static CAEnrollement getEnrollement(String keyFolderPath, String keyFileName, String certFolderPath, String certFileName) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, CryptoException {
|
public static CAEnrollement getEnrollement(String keyFolderPath, String keyFileName, String certFolderPath, String certFileName) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, CryptoException {
|
||||||
PrivateKey key = null;
|
PrivateKey key = null;
|
||||||
String certificate = null;
|
String certificate = null;
|
||||||
|
@ -131,4 +132,5 @@ public class Util {
|
||||||
CAEnrollement enrollment = new CAEnrollement(key,certificate);
|
CAEnrollement enrollment = new CAEnrollement(key,certificate);
|
||||||
return enrollment;
|
return enrollment;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
45
src/test/java/blockchain/query/QueryForChannelsTest.java
Normal file
45
src/test/java/blockchain/query/QueryForChannelsTest.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,8 +21,8 @@ public class QueryTest {
|
||||||
public void TestAQueryChannels() {
|
public void TestAQueryChannels() {
|
||||||
BasicConfigurator.configure();
|
BasicConfigurator.configure();
|
||||||
|
|
||||||
UserContext user = Util.readUserContext(Config.ORG1,Config.ADMIN);
|
//UserContext user = Util.readUserContext(Config.ORG1,Config.ADMIN);
|
||||||
//UserContext user = Util.readUserContext(Config.ORG1,"User-org1");
|
UserContext user = Util.readUserContext(Config.ORG1,"User-org1");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@ public class UtilEnrollTest {
|
||||||
File certFolder = new File(Config.ADMIN_CERT_PATH);
|
File certFolder = new File(Config.ADMIN_CERT_PATH);
|
||||||
File[] certFile = certFolder.listFiles();
|
File[] certFile = certFolder.listFiles();
|
||||||
logger.info("----- GET ENROLLEMENT ----");
|
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("KEY : "+enrollAdmin.getKey());
|
||||||
logger.info("CERT : "+enrollAdmin.getCert());
|
//logger.info("CERT : "+enrollAdmin.getCert());
|
||||||
|
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
BIN
target/classes/Application/App.class
Normal file
BIN
target/classes/Application/App.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/test-classes/blockchain/query/QueryForChannelsTest.class
Normal file
BIN
target/test-classes/blockchain/query/QueryForChannelsTest.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue