Mehr zum Thema Datenbanken können Sie hier lesen:
This file contains hidden or 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
package com.example.openpojo; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
import org.junit.jupiter.api.DisplayNameGeneration; | |
import org.junit.jupiter.api.DisplayNameGenerator; | |
import org.junit.jupiter.params.ParameterizedTest; |
This file contains hidden or 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
def static childAttribSum(parentNode, attributeName) { | |
parentNode.children.sum(0){ it[attributeName].num0 } | |
} | |
This file contains hidden or 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
import java.lang.reflect.Method; | |
import org.apache.commons.lang3.StringUtils; | |
import org.junit.jupiter.api.DisplayNameGenerator; | |
/** | |
* Display name generator that removes the "test" prefix from test names and replaces underscores with spaces.<br><br> | |
* | |
* Example: |
This file contains hidden or 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
try (final Statement stmt = conn.createStatement()) { | |
stmt.execute( | |
"CREATE TABLE my_tablename AS " + | |
"SELECT * FROM " + | |
"CSVREAD('%s')".formatted(csvFilePath) | |
); | |
} |
This file contains hidden or 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
readFile { | |
try { | |
open the file; | |
determine its size; | |
allocate that much memory; | |
read the file into memory; | |
close the file; | |
} catch (fileOpenFailed) { | |
doSomething; | |
} catch (sizeDeterminationFailed) { |
This file contains hidden or 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
import java.lang.reflect.Method; | |
import org.junit.jupiter.api.DisplayNameGenerator; | |
/** | |
* example: "whenNotAdminRoleThenForbidden" -> "when Not Admin Role Then Forbidden" | |
*/ | |
public class CamelCaseToSpacesDisplayNameGenerator implements DisplayNameGenerator { |
This file contains hidden or 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
public class StringUtil { | |
/** | |
* Extracts the last part of a comma-separated String and trims off leading and trailing whitespace. | |
*/ | |
public static String extractLastTrimmed(String str) { | |
// implementation omitted | |
} | |
// more String helper methods |
This file contains hidden or 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
#!/bin/bash | |
# source: generated via ChatGPT and edited | |
commitMsgHookTempl=./git-commit-hooks/commit-msg | |
commitMsgHook=.git/hooks/commit-msg | |
if [ -f "$commitMsgHook" ]; then | |
read -p "commit-msg file already exists. Do you want to update it? (y/n): " updateChoice | |
if [ "$updateChoice" == "y" ]; then |
This file contains hidden or 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
@ExtendWith(StopProcessingIfAnyTestFailedExtension.class) | |
public class MyIntegrationTest { | |
@Test | |
@Order(1) | |
void integration_test_step_01() throws Exception { | |
... | |
} | |
@Test |
NewerOlder