diff --git a/README.md b/README.md index 65858f597d9e81fa1b8aad86ec65767c3cec0620..253816389e4e67d77c93ee7a6815bdcfc36882bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Project Title +[](https://gitlab.gwdg.de/rwm/de.ugoe.cs.rwm.mocci/commits/master) Mocci is a toolchain using the Open Cloud Computing Interface (OCCI) to enable a model-driven cloud orchestration of cloud deployments and its monitoring instruments. Moreover, a runtime model manager is provided that grants access to gathered monitoring data. diff --git a/config/html/model/index.html b/config/html/model/index.html index 95aa39efe07c648fddacc34caa6f6310418eada9..b306643f022685b176213d0790aa0ebf946446fa 100644 --- a/config/html/model/index.html +++ b/config/html/model/index.html @@ -18,7 +18,7 @@ <b><a href="../updatesite.zip">Download Eclipse Plugin Archive</a></b> </div> - <h1>WOCCI Model Report</h1> + <h1>MOCCI Model Report</h1> <p> This is a small report navigation page for the Mocci model project. diff --git a/src/test/java/de/ugoe/cs/rwm/mocci/CreateElementsTest.java b/src/test/java/de/ugoe/cs/rwm/mocci/CreateElementsTest.java new file mode 100644 index 0000000000000000000000000000000000000000..17a473d41c9d401d37e5c458b204f3c444c94454 --- /dev/null +++ b/src/test/java/de/ugoe/cs/rwm/mocci/CreateElementsTest.java @@ -0,0 +1,93 @@ +package de.ugoe.cs.rwm.mocci; + +import static org.junit.Assert.assertTrue; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.eclipse.cmf.occi.core.Configuration; +import org.eclipse.cmf.occi.core.Link; +import org.eclipse.cmf.occi.core.Mixin; +import org.eclipse.cmf.occi.core.MixinBase; +import org.eclipse.cmf.occi.core.OCCIFactory; +import org.eclipse.cmf.occi.core.OCCIPackage; +import org.eclipse.cmf.occi.core.impl.OCCIFactoryImpl; +import org.eclipse.cmf.occi.core.util.OcciRegistry; +import org.eclipse.cmf.occi.infrastructure.Compute; +import org.eclipse.cmf.occi.infrastructure.InfrastructureFactory; +import org.eclipse.cmf.occi.infrastructure.impl.InfrastructureFactoryImpl; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.epsilon.emc.emf.CachedResourceSet; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import de.ugoe.cs.rwm.docci.MartDeployer; +import de.ugoe.cs.rwm.docci.ModelUtility; +import de.ugoe.cs.rwm.mocci.TestUtility; +import de.ugoe.cs.rwm.docci.connector.Connector; +import de.ugoe.cs.rwm.docci.connector.LocalhostConnector; +import de.ugoe.cs.rwm.tocci.Transformator; +import de.ugoe.cs.rwm.tocci.TransformatorFactory; +import de.ugoe.cs.rwm.tocci.occi2openstack.OCCI2OPENSTACKTransformator; +import monitoring.MonitoringFactory; +import monitoring.MonitoringPackage; +import monitoring.MonitoringProperty; +import monitoring.MonitoringPropertyArray; +import monitoring.Monitoringproperties; +import monitoring.Sensor; +import monitoring.impl.MonitoringFactoryImpl; + +public class CreateElementsTest { + + @BeforeClass + public static void OCCIRegistrySetup() { + TestUtility.loggerSetup(); + TestUtility.extensionRegistrySetup(); + } + + @Test + public void createModel() { + //Factories to create OCCI elements + OCCIFactory cFact = new OCCIFactoryImpl(); + InfrastructureFactory iFact = new InfrastructureFactoryImpl(); + MonitoringFactory mFact = new MonitoringFactoryImpl(); + + //Top level element + Configuration config = cFact.createConfiguration(); + //Resources + Sensor sensor = mFact.createSensor(); + Compute comp = iFact.createCompute(); + //MixinBase + Monitoringproperties monProps = mFact.createMonitoringproperties(); + MonitoringPropertyArray monArr = mFact.createMonitoringPropertyArray(); + MonitoringProperty monProp = mFact.createMonitoringProperty(); + monProp.setName("CPU"); + monProp.setValue("Critical"); + monProp.setId("123452"); + monArr.getMonitoringpropertyarrayValues().add(monProp); + monProps.setMonitoringProperties(monArr); + + comp.getParts().add(monProps); + + config.getResources().add(sensor); + config.getResources().add(comp); + System.out.println(config); + for(org.eclipse.cmf.occi.core.Resource res : config.getResources()) { + System.out.println(res); + for(MixinBase mixBase: res.getParts()) { + System.out.println(mixBase); + if(mixBase instanceof Monitoringproperties) { + System.out.println(((Monitoringproperties) mixBase).getMonitoringProperties().getMonitoringpropertyarrayValues()); + } + } + } + } +}