Skip to content

Commit

Permalink
[Tests] Use JUnit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillipus committed Apr 7, 2024
1 parent 7afc961 commit 68f1773
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
4 changes: 3 additions & 1 deletion org.archicontribs.modelrepository.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Bundle-Name: JUnit Tests for Model Repository
Bundle-SymbolicName: org.archicontribs.modelrepository.tests
Bundle-Version: 1.0.0
Fragment-Host: org.archicontribs.modelrepository
Import-Package: org.junit.jupiter.api,
org.junit.jupiter.api.function,
org.junit.platform.suite.api
Bundle-Vendor: Archi
Require-Bundle: org.junit
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.archicontribs.modelrepository.tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
import org.archicontribs.modelrepository.authentication.CryptoDataTests;
import org.archicontribs.modelrepository.grafico.ArchiRepositoryTests;
import org.archicontribs.modelrepository.grafico.GraficoUtilsTests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;
import org.junit.platform.suite.api.SuiteDisplayName;

@RunWith(Suite.class)

@Suite.SuiteClasses({
@Suite
@SelectClasses({
ArchiRepositoryTests.class,
GraficoUtilsTests.class,
CryptoDataTests.class
})

@SuiteDisplayName("All Model Repository Tests")
public class AllTests {
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
*/
package org.archicontribs.modelrepository.authentication;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;

@SuppressWarnings("nls")
public class CryptoDataTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
package org.archicontribs.modelrepository.grafico;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;
import java.io.FileWriter;
Expand All @@ -21,9 +21,9 @@
import org.eclipse.jgit.api.CommitCommand;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.Repository;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import com.archimatetool.editor.model.IEditorModelManager;
import com.archimatetool.editor.utils.FileUtils;
Expand All @@ -34,11 +34,11 @@
@SuppressWarnings("nls")
public class ArchiRepositoryTests {

@Before
@BeforeEach
public void runOnceBeforeEachTest() {
}

@After
@AfterEach
public void runOnceAfterEachTest() throws IOException {
FileUtils.deleteFolder(GitHelper.getTempTestsFolder());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
*/
package org.archicontribs.modelrepository.grafico;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;
import java.io.IOException;

import org.archicontribs.modelrepository.GitHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import com.archimatetool.editor.utils.FileUtils;
import com.archimatetool.model.IArchimateFactory;
Expand All @@ -26,11 +26,11 @@
@SuppressWarnings("nls")
public class GraficoUtilsTests {

@Before
@BeforeEach
public void runOnceBeforeEachTest() {
}

@After
@AfterEach
public void runOnceAfterEachTest() throws IOException {
FileUtils.deleteFolder(GitHelper.getTempTestsFolder());
}
Expand Down

0 comments on commit 68f1773

Please sign in to comment.