Skip to content
Snippets Groups Projects
Commit 25be63da authored by erbel's avatar erbel
Browse files

Added command line arguments fo initialdeployment

parent 421afcf7
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.eclipse.emf.ecore.resource.Resource;
......@@ -41,12 +42,17 @@ public class InitialDeployment {
Connector conn = new LocalhostConnector("localhost", 8080, "ubuntu");
//Connector conn = new MartConnector("192.168.35.45", 8080, "ubuntu", "~/key.pem");
RegistryAndLoggerSetup.setup();
deploy(conn);
}
public static void deploy(Connector conn) {
System.out.println("Initial Deployment");
Path occiPath = getModelPath("de/ugoe/cs/rwm/mocci/occi/hadoopClusterNewExtWithMem.occic");
Path occiPath;
if(args.length == 0) {
System.out.println("Choosing default initial deployment model");
occiPath = getModelPath("de/ugoe/cs/rwm/mocci/occi/hadoopClusterNewExtWithMem.occic");
} else {
System.out.println("Choosing user defined deployment model: " + args[0]);
File occiFile = new File(args[0]);
occiPath = occiFile.toPath().toAbsolutePath();
}
Resource model = ModelUtility.loadOCCIintoEMFResource(occiPath);
Transformator trans = TransformatorFactory.getTransformator("OCCI2OCCI");
......
......@@ -36,7 +36,7 @@ public class MapeTest {
MartDeployer deployer = new MartDeployer(conn);
deployer.deploy(occiPath);
InitialDeployment.deploy(conn);
InitialDeployment.main(new String[0]);
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment