package dev.kkorolyov.sqlob;

import java.io.IOException;
import java.io.UncheckedIOException;

import dev.kkorolyov.simpleprops.Properties;

@SuppressWarnings("javadoc")
public class TestAssets {
	private static final String TEST_PROPERTIES_NAME = "TestSQLOb.ini";
	private static final String HOST = "HOST",
															DATABASE = "DATABASE",
															USER = "USER",
															PASSWORD = "PASSWORD";
	private static final String[][] defaults = {{HOST, ""},
																							{DATABASE, ""},
																							{USER, "postgres"},
																							{PASSWORD, ""}};
	private static final Properties props = Properties.getInstance(TEST_PROPERTIES_NAME, defaults);
	
	static {
		try {
			props.saveToFile();
		} catch (IOException e) {
			throw new UncheckedIOException(e);
		}
	}
	
	public static String host() {
		return props.getValue(HOST);
	}
	public static String database() {
		return props.getValue(DATABASE);
	}
	public static String user() {
		return props.getValue(USER);
	}
	public static String password() {
		return props.getValue(PASSWORD);
	}
}

@@ -23,16 +23,37 @@
 sqlob;%0A%0A
+import java.io.File;%0A
 import j
@@ -215,77 +215,8 @@
 s %7B%0A
-%09private static final String TEST_PROPERTIES_NAME = %22TestSQLOb.ini%22;%0A
 %09pri
@@ -364,187 +364,9 @@
 RD%22;
-%0A%09private static final String%5B%5D%5B%5D defaults = %7B%7BHOST, %22%22%7D,%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%7BDATABASE, %22%22%7D,%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%7BUSER, %22postgres%22%7D,%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%7BPASSWORD, %22%22%7D%7D;
+%09
 %0A%09pr
@@ -402,16 +402,20 @@
  props =
+ new
  Propert
@@ -421,51 +421,51 @@
 ties
-.getInstance(TEST_PROPERTIES_NAME, d
+(new File(%22TestSQLOb.ini%22), buildD
 efaults
+()
 );%0A%09
@@ -500,10 +500,8 @@
 save
-To
 File
@@ -628,21 +628,16 @@
 rops.get
-Value
 (HOST);%0A
@@ -692,21 +692,16 @@
 rops.get
-Value
 (DATABAS
@@ -756,21 +756,16 @@
 rops.get
-Value
 (USER);%0A
@@ -824,13 +824,8 @@
 .get
-Value
 (PAS
@@ -835,10 +835,236 @@
 RD);%0A%09%7D%0A
+%09%0A%09private static Properties buildDefaults() %7B%0A%09%09Properties defaults = new Properties();%0A%09%09defaults.put(HOST, %22%22);%0A%09%09defaults.put(DATABASE, %22%22);%0A%09%09defaults.put(USER, %22%22);%0A%09%09defaults.put(PASSWORD, %22%22);%0A%09%09%0A%09%09return defaults;%0A%09%7D%0A
 %7D%0A

Update tests to new SimpleProps