Skip to content

Commit

Permalink
Migrate tests to JUnit5
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-WorkGH committed Oct 15, 2024
1 parent ac3a010 commit 6d443a3
Show file tree
Hide file tree
Showing 83 changed files with 726 additions and 1,085 deletions.
10 changes: 0 additions & 10 deletions network-store-iidm-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@

import com.powsybl.iidm.network.tck.AbstractActivePowerLimitsTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class ActivePowerLimitsIT extends AbstractActivePowerLimitsTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,28 @@

import com.powsybl.iidm.network.tck.AbstractAliasesTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class AliasesIT extends AbstractAliasesTest {

@Disabled("network merge not implemented")
@Override
@Test
public void mergeFailWhenAliasEqualsToAnAliasOfOtherNetwork() {
// FIXME network merge not implemented
super.mergeFailWhenAliasEqualsToAnAliasOfOtherNetwork();
}

@Disabled("network merge not implemented")
@Override
@Test
public void mergeFailWhenAliasEqualsToAnIdOfOtherNetwork() {
// FIXME network merge not implemented
super.mergeFailWhenAliasEqualsToAnIdOfOtherNetwork();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@

import com.powsybl.iidm.network.tck.AbstractApparentPowerLimitsTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class ApparentPowerLimitsIT extends AbstractApparentPowerLimitsTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,28 @@

import com.powsybl.iidm.network.tck.AbstractBatteryTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class BatteryIT extends AbstractBatteryTest {

@Disabled("exception message aren't homogenized with the powsybl-core")
@Test
@Override
public void testRemove() {
// FIXME remove this test when exception msg are homogenized with the powsybl-core
super.testRemove();
}

@Disabled("primary key constraints violation on DB")
@Override
@Test
public void testSetterGetterInMultiVariants() {
//FIXME remove when we fix primary key constraints violation on DB
super.testSetterGetterInMultiVariants();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,20 @@

import com.powsybl.iidm.network.tck.AbstractBusBreakerTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class BusBreakerIT extends AbstractBusBreakerTest {

@Disabled("missing reason")
@Test
@Override
public void testDisconnectConnect() {
// FIXME
super.testDisconnectConnect();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@

import com.powsybl.iidm.network.tck.AbstractBusTerminalTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class BusTerminalIT extends AbstractBusTerminalTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@

import com.powsybl.iidm.network.tck.AbstractCalculatedTopologyTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class CalculatedTopologyIT extends AbstractCalculatedTopologyTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@

import com.powsybl.iidm.network.tck.AbstractConnectedComponentWithTieLineBugTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class ConnectedComponentWithTieLineBugIT extends AbstractConnectedComponentWithTieLineBugTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,60 @@

import com.powsybl.iidm.network.tck.AbstractCurrentLimitsTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class CurrentLimitsIT extends AbstractCurrentLimitsTest {

@Disabled("Bus.getV/setV not getting/updating correctly the V in all views")
@Override
@Test
public void test() {
// FIXME delete this test when we fix Bus.getV/setV not getting/updating correctly the V in all views
super.test();
}

@Disabled("Bus.getV/setV not getting/updating correctly the V in all views")
@Override
@Test
public void testForThreeWindingsTransformerLeg1() {
// FIXME delete this test when we fix Bus.getV/setV not getting/updating correctly the V in all views
super.testForThreeWindingsTransformerLeg1();
}

@Disabled("Bus.getV/setV not getting/updating correctly the V in all views")
@Override
@Test
public void testForThreeWindingsTransformerLeg2() {
// FIXME delete this test when we fix Bus.getV/setV not getting/updating correctly the V in all views
super.testForThreeWindingsTransformerLeg2();
}

@Disabled("Bus.getV/setV not getting/updating correctly the V in all views")
@Override
@Test
public void testForThreeWindingsTransformerLeg3() {
// FIXME delete this test when we fix Bus.getV/setV not getting/updating correctly the V in all views
super.testForThreeWindingsTransformerLeg3();
}

@Disabled("Bus.getV/setV not getting/updating correctly the V in all views")
@Override
@Test
public void testLimitWithoutTempLimit() {
// FIXME delete this test when we fix Bus.getV/setV not getting/updating correctly the V in all views
super.testLimitWithoutTempLimit();
}

@Disabled("Bus.getV/setV not getting/updating correctly the V in all views")
@Override
@Test
public void testSetterGetter() {
// FIXME delete this test when we fix Bus.getV/setV not getting/updating correctly the V in all views
super.testSetterGetter();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,20 @@

import com.powsybl.iidm.network.tck.AbstractDanglingLineTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class DanglingLineIT extends AbstractDanglingLineTest {

@Disabled("primary key constraints violation on DB")
@Override
@Test
public void testSetterGetterInMultiVariants() {
//FIXME remove when we fix primary key constraints violation on DB
super.testSetterGetterInMultiVariants();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@

import com.powsybl.iidm.network.tck.AbstractEmptyCalculatedBusBugTest;
import com.powsybl.network.store.server.NetworkStoreApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.ContextHierarchy;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextHierarchy({
@ContextConfiguration(classes = {NetworkStoreApplication.class})
})
@TestPropertySource(properties = { "spring.config.location=classpath:application.yaml" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = {"spring.config.location=classpath:application.yaml"})
@ContextHierarchy({@ContextConfiguration(classes = {NetworkStoreApplication.class})})
class EmptyCalculatedBusBugIT extends AbstractEmptyCalculatedBusBugTest {

}
Loading

0 comments on commit 6d443a3

Please sign in to comment.