SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.8 KiB

package de.superx.common;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Locale;
import org.junit.Ignore;
import org.junit.Test;
import de.memtext.tree.KeyParentEqualException;
import de.memtext.tree.NoMainEntryException;
import freemarker.template.TemplateException;
public class FieldTest {
// Witt: Ignore this test, as it will possibly never work due to database
// dependency!?
@Ignore
@Test
public void testField() {
SxUser user = new SxUser("test_user");
SxResultRow sxRow = new SxResultRow(0, 0);
SxResultSet sxrs = new SxResultSet();
FieldContainer fc = new FieldContainer();
sxRow.add(Integer.valueOf(16651)); // id
sxRow.add("test_feld"); // name
sxRow.add(Integer.valueOf(1)); // nummer
sxRow.add(Integer.valueOf(0)); // x
sxRow.add(Integer.valueOf(0)); // y
sxRow.add(Integer.valueOf(0)); // button-breite
sxRow.add(Integer.valueOf(0)); // feld-breite
sxRow.add(Integer.valueOf(0)); // zeilenanzahl
sxRow.add("char"); // typ
sxRow.add(Integer.valueOf(10)); // länge
sxRow.add(Integer.valueOf(0)); // obligatorisch
sxRow.add(Integer.valueOf(10)); // art
sxRow.add(""); // relation
sxRow.add(""); // attribut
sxRow.add(""); // defaultwert
try {
Field field = new Field("default", user, Integer.valueOf(16650), sxRow, Locale.GERMANY, null, null, fc,
sxrs);
field.updateDefaultValue(null, null, fc, null, false, user);
} catch (TemplateException | KeyParentEqualException | CloneNotSupportedException | SichtException | IOException
| SQLException | DBServletException | NoMainEntryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UngueltigeEingabeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvalidDataTypeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}