aboutsummaryrefslogtreecommitdiffstats
path: root/distribution-ci/src/main/java/org/openecomp/test/CallableTask.java
blob: 814fe9ae464a52ffb7fe52fbd7195825dc7374be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package org.openecomp.test;

//import java.util.concurrent.Callable;
//
//import org.openecomp.sdc.api.IDistributionClient;
//import org.openecomp.sdc.api.results.IDistributionClientResult;
//import org.openecomp.sdc.impl.DistributionClientFactory;
//import org.openecomp.sdc.be.model.Service;
//import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;

public class CallableTask  {

//	NotificationCallback notifCallback = null;
//	//private ServiceUtils serviceUtils;
//	private Service service;
//	
//	//public CallableTask(ServiceUtils serviceUtils, Service service) {
//	public CallableTask(Service service) {
//		//this.serviceUtils = serviceUtils;
//		this.service = service;
//	}
//	
//	public NotificationCallback getNotifCallback() {
//		return notifCallback;
//	}
//	
//	@Override
//	public Boolean call() throws Exception {
//		
//		IDistributionClient client = DistributionClientFactory.createDistributionClient();
//		
//		notifCallback = new NotificationCallback(client);
//		IDistributionClientResult result =  client.init(new SimpleConfiguration(),  notifCallback);
//		
//		System.out.println("result.getDistributionMessageResult: " + result.getDistributionMessageResult());
//			
//		System.out.println("Starting client...");
//		IDistributionClientResult start = client.start();
//		System.out.println(start.getDistributionMessageResult());
//		
////		RestResponse changeStateToDISTRIBUTED = serviceUtils.changeStateToDISTRIBUTED(service, UserUtils.getGovernorDetails1());
//		ServiceReqDetails serviceDetails = new ServiceReqDetails();
//		serviceDetails.setUniqueId(service.getUniqueId());
//		//RestResponse changeStateToDISTRIBUTED = serviceUtils.changeDistributionStatus(serviceDetails, "1.0", UserUtils.getGovernorDetails1(), "change", DistributionStatusEnum.DISTRIBUTED);
//		//assertTrue("response code is not 200, returned :" + changeStateToDISTRIBUTED.getErrorCode(), changeStateToDISTRIBUTED.getErrorCode() == 200);
//		
//		
////		while (simpleCallback.getSimpleCallbackResults().size()<3){
//			System.err.println("Sleeping...");
//			Thread.sleep(5000);
//			System.err.println("Finished Sleeping...");
////		}
//		
//		return true;
//	}

}