Skip to content

Commit

Permalink
- Updates plugins version.
Browse files Browse the repository at this point in the history
- Creates logback-test.xml to define logback's configuration
  to run tests. Tests' log is now directed to the target/log-output.log file.
- Adds configuration to avoid maven-surefire-plugin to create
  forks. Forks were causing runtime exceptions when trying to use
  maven with Java 10+.

Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
  • Loading branch information
manoelcampos committed Oct 4, 2018
1 parent 341b3e2 commit 3093cb4
Show file tree
Hide file tree
Showing 130 changed files with 873 additions and 806 deletions.
2 changes: 1 addition & 1 deletion cloudsim-plus-benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down
2 changes: 1 addition & 1 deletion cloudsim-plus-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down
2 changes: 1 addition & 1 deletion cloudsim-plus-testbeds/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down
30 changes: 23 additions & 7 deletions cloudsim-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<excludes>
<exclude>**/integrationtests/*.java</exclude>
</excludes>
<!-- Forking the process was causing runtime exceptions
when running tests with Java 10+ -->
<forkCount>0</forkCount>
</configuration>
</plugin>

Expand All @@ -104,6 +107,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Forking the process was causing runtime exceptions
when running tests with Java 10+ -->
<forkCount>0</forkCount>
</configuration>
</plugin>

<plugin>
Expand All @@ -127,6 +135,16 @@
<id>all</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Forking the process was causing runtime exceptions
when running tests with Java 10+ -->
<forkCount>0</forkCount>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -154,7 +172,6 @@
</executions>

<configuration>

<tags>
<direction>
<name>pre</name>
Expand Down Expand Up @@ -236,13 +253,13 @@
<artifactId>maven-surefire-plugin</artifactId>
<!-- There is some problem with the version 2.19.1 or with
Netbeans 8.0.2 that the JUnit GUI is not shown at the IDE-->
<version>2.21.0</version>
<version>2.22.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>

<configuration>
<failOnError>false</failOnError>
Expand Down Expand Up @@ -292,7 +309,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<version>0.8.1</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand All @@ -310,7 +327,6 @@
</executions>
</plugin>


<!--
Adds License Information to project source and binaries using com.mycila.maven-license-plugin.
https://dzone.com/articles/adding-license-information.
Expand Down Expand Up @@ -467,7 +483,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
<reportSets>
<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/examples/javadoc-nofork.html -->
<reportSet>
Expand All @@ -486,7 +502,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.20.1</version>
<version>2.22.0</version>
</plugin>
</plugins>
</reporting>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

import org.cloudbus.cloudsim.cloudlets.Cloudlet;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class SwfWorkloadFileReaderTest {
private static final Logger LOGGER = LoggerFactory.getLogger(SwfWorkloadFileReaderTest.class.getSimpleName());
private static final int JOBS_AT_SWF_LCG_FILE = 188041;
private static final String SWF_FILE = "LCG.swf";
private static final String ZIP_FILE = "two-workload-files.zip";
private static final int JOBS_AT_SWF_LCG_FILE = 188041;

/**
* Number of jobs of the NASA file inside the zip archive.
Expand All @@ -32,23 +34,18 @@ public void readSwf() throws IOException {

@Test
public void readZipWithTwoSwfFiles() throws IOException {
readFile(ZIP_FILE,
JOBS_AT_SWF_LCG_FILE + JOBS_AT_SWF_NASA_FILE);
readFile(ZIP_FILE, JOBS_AT_SWF_LCG_FILE + JOBS_AT_SWF_NASA_FILE);
}

private void readFile(String fileNameWithoutPath, int numberOfJobs) throws IOException {
final SwfWorkloadFileReader reader = new SwfWorkloadFileReader("src"
+ File.separator
+ "test"
+ File.separator
+ fileNameWithoutPath, 1);
private void readFile(String fileNameWithoutPath, int numberOfJobs) {
final SwfWorkloadFileReader reader = SwfWorkloadFileReader.getInstance(fileNameWithoutPath, 1);
final long milisecs = System.currentTimeMillis();
final List<Cloudlet> cloudletlist = reader.generateWorkload();
final double seconds = (System.currentTimeMillis() - milisecs)/1000.0;
assertEquals(numberOfJobs, cloudletlist.size());
System.out.printf(
"Time taken to read the file %s: %.2f seconds\n",
fileNameWithoutPath, seconds);
LOGGER.info(
"Time taken to read the file {}: {} seconds",
fileNameWithoutPath, seconds);

for (final Cloudlet cloudlet : cloudletlist) {
assertTrue(cloudlet.getLength() > 0);
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions cloudsim-plus/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Logback configuration file to run test cases. For details check http://logback.qos.ch -->
<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>target/tests-output.log</file>
<encoder>
<pattern>%highlight(%-5level %msg%n)</pattern>
</encoder>
</appender>

<root level="debug">
<appender-ref ref="FILE" />
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ VmAllocationPolicyAbstract
.. java:constructor:: public VmAllocationPolicyAbstract()
:outertype: VmAllocationPolicyAbstract

Creates a new VmAllocationPolicy.
Creates a VmAllocationPolicy.

VmAllocationPolicyAbstract
^^^^^^^^^^^^^^^^^^^^^^^^^^

.. java:constructor:: public VmAllocationPolicyAbstract(BiFunction<VmAllocationPolicy, Vm, Optional<Host>> findHostForVmFunction)
:outertype: VmAllocationPolicyAbstract

Creates a new VmAllocationPolicy, changing the \ :java:ref:`BiFunction`\ to select a Host for a Vm.
Creates a VmAllocationPolicy, changing the \ :java:ref:`BiFunction`\ to select a Host for a Vm.

:param findHostForVmFunction: a \ :java:ref:`BiFunction`\ to select a Host for a given Vm.

Expand All @@ -68,7 +68,7 @@ addPesFromHost
.. java:method:: public void addPesFromHost(Host host)
:outertype: VmAllocationPolicyAbstract

Gets the number of working PEs from a given Host and adds these numbers to the \ :java:ref:`list of free PEs <getHostFreePesMap()>`\ . Before the Host starts being used, the number of free PEs is the same as the number of working PEs.
Gets the number of working PEs from a given Host and adds this number to the \ :java:ref:`list of free PEs <getHostFreePesMap()>`\ . Before the Host starts being used, the number of free PEs is the same as the number of working PEs.

addUsedPes
^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
.. java:import:: org.cloudbus.cloudsim.selectionpolicies.power PowerVmSelectionPolicy
.. java:import:: org.cloudbus.cloudsim.util MathUtil
.. java:import:: org.cloudbus.cloudsim.vms Vm
.. java:import:: org.cloudbus.cloudsim.util MathUtil
.. java:import:: java.util Comparator
.. java:import:: java.util DoubleSummaryStatistics
.. java:import:: java.util Map
VmAllocationPolicyMigrationLocalRegression
==========================================
Expand Down
12 changes: 6 additions & 6 deletions docs/javadocs/org/cloudbus/cloudsim/brokers/DatacenterBroker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ DEFAULT_VM_DESTRUCTION_DELAY

**See also:** :java:ref:`.setVmDestructionDelayFunction(Function)`

LOGGER
^^^^^^

.. java:field:: Logger LOGGER
:outertype: DatacenterBroker

NULL
^^^^

Expand All @@ -58,12 +64,6 @@ NULL

An attribute that implements the Null Object Design Pattern for \ :java:ref:`DatacenterBroker`\ objects.

logger
^^^^^^

.. java:field:: Logger logger
:outertype: DatacenterBroker

Methods
-------
addOnVmsCreatedListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ isThereWaitingCloudlets
processEvent
^^^^^^^^^^^^

.. java:method:: @Override public void processEvent(SimEvent ev)
.. java:method:: @Override public void processEvent(SimEvent evt)
:outertype: DatacenterBrokerAbstract

requestDatacenterToCreateWaitingVms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
.. java:import:: org.cloudsimplus.heuristics Heuristic
.. java:import:: org.slf4j Logger
.. java:import:: org.slf4j LoggerFactory
.. java:import:: java.util.stream Collectors
DatacenterBrokerHeuristic
Expand Down

0 comments on commit 3093cb4

Please sign in to comment.