Skip to content

Commit

Permalink
i18n for new perfumes
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Knoedlseder committed Oct 6, 2024
1 parent b735623 commit 527fefc
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Assert all",
"description": "By using an assertAll instead of multiple assertThat expressions, the programmer is informed about all results, even though some assertions may fail. In contrast, a failing assertThat would terminate the test execution.",
"description": "The \"org.junit.jupiter.api.assertAll\" is used group multiple individual assertions together. The advantage of using this method to group the assertions instead of calling them individually is that if one assertion fails, the others are still executed. Therefore, the user gains insight on the results of all tests, instead of only the tests up to the failed assertion, where the thrown exception would otherwise terminate the test execution.",
"detectorClassSimpleName": "AssertAllDetector",
"i18nBaseBundleName": "assertAll",
"sources": null,
"relatedPattern": "SMELL",
"sources": ["https://stackoverflow.com/questions/40796756/assertall-vs-multiple-assertions-in-junit5"],
"relatedPattern": null,
"additionalInformation": null
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "JFrame dispose",
"description": "Instead of calling \"System.exit()\", which completely terminates the java virtual machine, the \"javax.swing.JFrame.dispose()\" closes the frame and its assigned resources in a more controlled manner. Closing the application this way, one has to make sure to terminate all remaining threads programmatically. While this may seem like a downside, it ultimately provides the most control, as ongoing processes can be waited for until they are completed.",
"description": "Instead of calling \"System.exit\", which completely terminates the java virtual machine, the \"javax.swing.JFrame.dispose\" closes the frame and its assigned resources in a more controlled manner. Closing the application this way, one has to make sure to terminate all remaining threads programmatically. While this may seem like a downside, it ultimately provides the most control, as ongoing processes can be completed before the program is terminated.",
"detectorClassSimpleName": "JFrameDisposeDetector",
"i18nBaseBundleName": "jFrameDispose",
"sources": ["Programmierung II - Uni Passau", "https://stackoverflow.com/questions/13360430/jframe-dispose-vs-system-exit"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Parameterized test",
"description": "Similar tests should be grouped in a single Parameterized test",
"description": "Tests can be annotated with the \"org.junit.jupiter.params.ParameterizedTest\" annotation. Such parameterized tests makes the tested code reusable in cases where the logic is similar, and is preferable over writing multiple tests that essentially test the same thing with different values.",
"detectorClassSimpleName": "ParameterizedTestDetector",
"i18nBaseBundleName": "parameterizedTests",
"i18nBaseBundleName": "parameterizedTest",
"sources": ["https://rules.sonarsource.com/java/RSPEC-5976/"],
"relatedPattern": "SMELL",
"additionalInformation": null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Setup or teardown method",
"description": "Common setup and teardown tasks should preferably be performed inside methods annotated with either '@BeforeEach', '@BeforeAll', '@AfterEach' or '@AfterAll'. This can greatly reduce the boilerplate code inside individual tests.",
"description": "Common setup and teardown tasks should preferably be performed inside methods annotated with either \"@BeforeEach\", \"@BeforeAll\", \"@AfterEach\" or \"@AfterAll\". This can greatly reduce the boilerplate code inside individual tests and makes the tests more focused on the actual logic that is being tested.",
"detectorClassSimpleName": "SetupAndTeardownMethodDetector",
"i18nBaseBundleName": "setupAndTeardownMethod",
"sources": null,
"i18nBaseBundleName": "setupAndTeardownMethods",
"sources": ["https://www.baeldung.com/junit-before-beforeclass-beforeeach-beforeall"],
"relatedPattern": "SMELL",
"additionalInformation": null
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Swing timer",
"description": "The timer from the \"javax.swing\" library simplifies GUI updates significantly. Its constructor requires a delay (in milliseconds) and an implementation of the \"java.awt.event.ActionListener\" interface. The code provided in the implementation (for example, GUI updates) is executed in the time interval that is defined by the first parameter of the timer. The timer always executes the code in the event dispatch thread.",
"description": "The timer from the \"javax.swing\" library simplifies GUI updates significantly. Its constructor requires a time intervall (in milliseconds) and an implementation of the \"java.awt.event.ActionListener\" interface. The code provided in the implementation (for example, GUI updates) is executed in the time interval that is defined by the first parameter of the timer. The timer always executes the code in the event dispatch thread.",
"detectorClassSimpleName": "SwingTimerDetector",
"i18nBaseBundleName": "swingTimer",
"sources": ["Programmierung II - Uni Passau", "https://docs.oracle.com/javase/8/docs/api/javax/swing/Timer.html"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Thread safe Swing",
"description": "Java Swing application make use of the event dispatch thread. This thread must handle the initialization of and update operations on the GUI components, as well as event handling. Event handlers We as programmers are responsible that GUI components are created and updated in the event dispatch thread. We can achieve this by placing the related code inside a Runnable that we pass as an argument to either the \"SwingUtilities.invokeLater\" or the \"SwingUtilities.invokeAndWait\" method.",
"description": "Java Swing application make use of the event dispatch thread. This thread must handle the initialization of and update operations on the GUI components, as well as event handling. We as programmers are responsible that GUI components are created and updated in the event dispatch thread. We can achieve this by placing the related code inside a Runnable that we pass as an argument to either the \"SwingUtilities.invokeLater\" or the \"SwingUtilities.invokeAndWait\" method.",
"detectorClassSimpleName": "ThreadSafeSwingDetector",
"i18nBaseBundleName": "threadSafeSwing",
"sources": ["Programmierung II - Uni Passau", "https://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ame=Setup und Teardown Methoden
description=Gemeinsamer Setup- und Teardown-Code sollte vorzugsweise innerhalb von Methoden durchgeführt werden, die entweder mit "@BeforeEach", "@BeforeAll", "@AfterEach" oder "@AfterAll" annotiert sind. Auf diese Weise lässt sich Boilerplate-Code in den einzelnen Tests erheblich reduzieren und der Fokus liegt stärker auf der eigentlichen Logik, die getestet wird.
source#1=https://www.baeldung.com/junit-before-beforeclass-beforeeach-beforeall
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name=Assert all
description=Die Methode \"org.junit.jupiter.api.assertAll\" wird verwendet, um mehrere einzelne Assertions zusammenzufassen. Der Vorteil dieser Methode im Vergleich zu mehreren einzelnen Assertions besteht darin, dass bei einem Fehlschlag einer Assertion die folgenden Assertions trotzdem ausgeführt werden. Daher erhält der Benutzer die Ergebnisse aller Tests und nicht nur der Tests bis zur fehlgeschlagenen Assertions, die ansonsten die Ausführung des Tests beenden würde.
source#1="https://stackoverflow.com/questions/40796756/assertall-vs-multiple-assertions-in-junit5"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name=JFrame dispose
description=Anstelle der \"System.exit\" Methode, die die Java Virtual Machine vollständig beendet, schließt \"javax.swing.JFrame.dispose\" das JFrame Object und die ihm zugewiesenen Ressourcen auf kontrolliertere Weise. Wenn man die Anwendung auf diese Weise schließt, muss man sicherstellen, dass alle verbleibenden Threads programmatisch beendet werden. Dies mag zwar wie ein Nachteil erscheinen, bietet aber letztlich die größte Kontrolle, da laufende Prozesse kontrolliert beendet werden können.
source#1=Programmierung II - Uni Passau
source#2="https://stackoverflow.com/questions/13360430/jframe-dispose-vs-system-exit"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name=Parametrisierte Tests
description=Tests können mit der Annotation \"org.junit.jupiter.params.ParameterizedTest\" versehen werden. Solche parametrisierten Tests machen den getesteten Code wiederverwendbar. Sie sind dem Schreiben mehrerer Tests, die im Wesentlichen das gleiche Logik mit unterschiedlichen Werten testen, vorzuziehen.
source#1="https://rules.sonarsource.com/java/RSPEC-5976/"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name=Swing Timer
description=Der Timer aus der \"javax.swing\" Bibliothek vereinfacht die Aktualisierung von Benutzeroberflächen erheblich. Der Konstruktor verlangt ein Zeitintervall (in Millisekunden) und eine Implementierung des \"java.awt.event.ActionListener\"-Interfaces. Der Code des ActionListeners (z.B. GUI-Aktualisierungen) wird in dem Zeitintervall ausgeführt, das durch den ersten Parameter des Timers definiert ist. Der Timer führt den Code immer im Event-Dispatch-Thread aus.
source#1=Programmierung II - Uni Passau
source#2=https://docs.oracle.com/javase/8/docs/api/javax/swing/Timer.html
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name=Thread-safe Swing
description=Java Swing-Anwendungen verwenden den Event Dispatch Thread. Dieser Thread muss die Initialisierung und die Aktualisierungsoperationen der GUI-Komponenten sowie Event-Handling übernehmen. Der Programmierer ist dafür verantwortlich, dass die GUI-Komponenten im Event Dispatch Thread erstellt und aktualisiert werden. Das kann dadurch erreicht werden, indem der entsprechende Code in einem \"Runnable\" platziert wird, die wir als Argument entweder an die Methode \"SwingUtilities.invokeLater\" oder \"SwingUtilities.invokeAndWait\" übergeben.
source#1=Programmierung II - Uni Passau
source#2=https://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html

0 comments on commit 527fefc

Please sign in to comment.