This repository has been archived by the owner on May 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
884 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
case-repository/src/test/java/eu.itesla_project.cases/CoverageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.cases; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* @author Mathieu Bague <mathieu.bague at rte-france.com> | ||
*/ | ||
public class CoverageTest { | ||
|
||
@Test | ||
public void testNothing() { | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
commons/src/main/java/eu/itesla_project/commons/io/mmap/MemoryMapFileMock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.commons.io.mmap; | ||
|
||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public class MemoryMapFileMock implements MemoryMappedFile { | ||
|
||
@Override | ||
public boolean exists() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public ByteBuffer getBuffer(int size) throws IOException { | ||
return ByteBuffer.allocate(size); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
commons/src/main/java/eu/itesla_project/commons/io/mmap/MemoryMappedFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.commons.io.mmap; | ||
|
||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public interface MemoryMappedFile extends AutoCloseable { | ||
|
||
boolean exists(); | ||
|
||
ByteBuffer getBuffer(int size) throws IOException ; | ||
|
||
@Override | ||
void close() throws IOException; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
commons/src/main/java/eu/itesla_project/commons/io/mmap/MemoryMappedFileFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.commons.io.mmap; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
/** | ||
* | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public interface MemoryMappedFileFactory { | ||
|
||
MemoryMappedFile create(File file) throws IOException; | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
commons/src/main/java/eu/itesla_project/commons/io/mmap/MemoryMappedFileImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.commons.io.mmap; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.RandomAccessFile; | ||
import java.nio.ByteBuffer; | ||
import java.nio.channels.FileChannel; | ||
import java.util.Objects; | ||
|
||
/** | ||
* | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public class MemoryMappedFileImpl implements MemoryMappedFile { | ||
|
||
private final File file; | ||
|
||
private RandomAccessFile raf; | ||
|
||
public MemoryMappedFileImpl(File file) throws IOException { | ||
this.file = Objects.requireNonNull(file); | ||
} | ||
|
||
@Override | ||
public boolean exists() { | ||
return file.exists(); | ||
} | ||
|
||
@Override | ||
public ByteBuffer getBuffer(int size) throws IOException { | ||
if (raf == null) { | ||
raf = new RandomAccessFile(file, "rw"); | ||
} | ||
return raf.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, size); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
if (raf != null) { | ||
raf.close(); | ||
} | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
commons/src/test/java/eu/itesla_project/commons/io/mmap/MemoryMapFileMockTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.commons.io.mmap; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public class MemoryMapFileMockTest { | ||
|
||
private MemoryMappedFile memoryMappedFile; | ||
|
||
@Before | ||
public void setUp() { | ||
memoryMappedFile = new MemoryMapFileMock(); | ||
} | ||
|
||
@After | ||
public void tearDown() throws IOException { | ||
memoryMappedFile.close(); | ||
} | ||
|
||
@Test | ||
public void exists() { | ||
assertFalse(memoryMappedFile.exists()); | ||
} | ||
|
||
@Test | ||
public void getBuffer() throws IOException { | ||
ByteBuffer buffer = memoryMappedFile.getBuffer(100); | ||
assertNotNull(buffer); | ||
assertEquals(buffer.remaining(), 100); | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
commons/src/test/java/eu/itesla_project/commons/io/mmap/MemoryMappedFileImplTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.commons.io.mmap; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public class MemoryMappedFileImplTest { | ||
|
||
@Rule | ||
public final TemporaryFolder folder = new TemporaryFolder(); | ||
|
||
private MemoryMappedFile memoryMappedFile; | ||
|
||
@Before | ||
public void setUp() throws IOException { | ||
memoryMappedFile = new MemoryMappedFileImpl(folder.newFile()); | ||
} | ||
|
||
@After | ||
public void tearDown() throws IOException { | ||
memoryMappedFile.close(); | ||
} | ||
|
||
@Test | ||
public void exists() { | ||
assertTrue(memoryMappedFile.exists()); | ||
} | ||
|
||
@Test | ||
public void getBuffer() throws IOException { | ||
ByteBuffer buffer = memoryMappedFile.getBuffer(100); | ||
assertNotNull(buffer); | ||
assertEquals(buffer.remaining(), 100); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
computation-local/src/test/java/eu/itesla_project/computation/local/CoverageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.computation.local; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* @author Mathieu Bague <mathieu.bague at rte-france.com> | ||
*/ | ||
public class CoverageTest { | ||
|
||
@Test | ||
public void testNothing() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
computation-mpi-util/src/test/java/eu/itesla_project/computation/mpi/util/CoverageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.computation.mpi.util; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* @author Mathieu Bague <mathieu.bague at rte-france.com> | ||
*/ | ||
public class CoverageTest { | ||
|
||
@Test | ||
public void testNothing() { | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
computation/src/test/java/eu/itesla_project/computation/CoverageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.computation; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* @author Mathieu Bague <mathieu.bague at rte-france.com> | ||
*/ | ||
public class CoverageTest { | ||
|
||
@Test | ||
public void testNothing() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
contingency-api/src/test/java/eu/itesla_project/contingency/CoverageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) 2016, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package eu.itesla_project.contingency; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* @author Mathieu Bague <mathieu.bague at rte-france.com> | ||
*/ | ||
public class CoverageTest { | ||
|
||
@Test | ||
public void testNothing() { | ||
} | ||
} |
Oops, something went wrong.