@Test public void test1TableNoKeysError(){ createSchema(); createTables(1); assertErrorOnSubmit(); }
public void createSchema(){ pcName = schemaNameField.getText(); if(pcName == null || pcName.length() == 0){ JOptionPane.showMessageDialog(null, "Please fill out Schema Name Field"); return; } String descr = descrField.getText(); if(descr == null || descr.length() == 0){ descr = pcName; descrField.setText(pcName); } String other = otherField.getText(); if(other == null || other.length() == 0){ other = pcName; otherField.setText(pcName); } String prop = (String) schemaPropField.getSelectedItem(); if(prop == null || prop.length() == 0){ JOptionPane.showMessageDialog(null, "Please select a property."); return; } btnCreate.setEnabled(false); System.out.println(pcName); schemaNode = new PmNode(PmNodeType.POLICY, pcName); boolean bRes = util.createBaseOattr(getSchemaType(PM_NODE.POL.value), getSchemaType(PM_NODE.OATTR.value), pcName, descr, other, "storage=file"); if(!bRes){ JOptionPane.showMessageDialog(null, "Could not create schema " + pcName, "ERROR", JOptionPane.ERROR_MESSAGE); resetAll(); return; } resetSchemaView(schemaNode.getType()); enableBuilder(); created = true; }
SchemaBuilder3 extends JFrame { public void createSchema(){ pcName = schemaNameField.getText(); if(pcName == null || pcName.length() == 0){ JOptionPane.showMessageDialog(null, "Please fill out Schema Name Field"); return; } String descr = descrField.getText(); if(descr == null || descr.length() == 0){ descr = pcName; descrField.setText(pcName); } String other = otherField.getText(); if(other == null || other.length() == 0){ other = pcName; otherField.setText(pcName); } String prop = (String) schemaPropField.getSelectedItem(); if(prop == null || prop.length() == 0){ JOptionPane.showMessageDialog(null, "Please select a property."); return; } btnCreate.setEnabled(false); System.out.println(pcName); schemaNode = new PmNode(PmNodeType.POLICY, pcName); boolean bRes = util.createBaseOattr(getSchemaType(PM_NODE.POL.value), getSchemaType(PM_NODE.OATTR.value), pcName, descr, other, "storage=file"); if(!bRes){ JOptionPane.showMessageDialog(null, "Could not create schema " + pcName, "ERROR", JOptionPane.ERROR_MESSAGE); resetAll(); return; } resetSchemaView(schemaNode.getType()); enableBuilder(); created = true; } }
SchemaBuilder3 extends JFrame { public void createSchema(){ pcName = schemaNameField.getText(); if(pcName == null || pcName.length() == 0){ JOptionPane.showMessageDialog(null, "Please fill out Schema Name Field"); return; } String descr = descrField.getText(); if(descr == null || descr.length() == 0){ descr = pcName; descrField.setText(pcName); } String other = otherField.getText(); if(other == null || other.length() == 0){ other = pcName; otherField.setText(pcName); } String prop = (String) schemaPropField.getSelectedItem(); if(prop == null || prop.length() == 0){ JOptionPane.showMessageDialog(null, "Please select a property."); return; } btnCreate.setEnabled(false); System.out.println(pcName); schemaNode = new PmNode(PmNodeType.POLICY, pcName); boolean bRes = util.createBaseOattr(getSchemaType(PM_NODE.POL.value), getSchemaType(PM_NODE.OATTR.value), pcName, descr, other, "storage=file"); if(!bRes){ JOptionPane.showMessageDialog(null, "Could not create schema " + pcName, "ERROR", JOptionPane.ERROR_MESSAGE); resetAll(); return; } resetSchemaView(schemaNode.getType()); enableBuilder(); created = true; } SchemaBuilder3(String sessId, int nSimPort, String sProcId, boolean bDebug); }
SchemaBuilder3 extends JFrame { public void createSchema(){ pcName = schemaNameField.getText(); if(pcName == null || pcName.length() == 0){ JOptionPane.showMessageDialog(null, "Please fill out Schema Name Field"); return; } String descr = descrField.getText(); if(descr == null || descr.length() == 0){ descr = pcName; descrField.setText(pcName); } String other = otherField.getText(); if(other == null || other.length() == 0){ other = pcName; otherField.setText(pcName); } String prop = (String) schemaPropField.getSelectedItem(); if(prop == null || prop.length() == 0){ JOptionPane.showMessageDialog(null, "Please select a property."); return; } btnCreate.setEnabled(false); System.out.println(pcName); schemaNode = new PmNode(PmNodeType.POLICY, pcName); boolean bRes = util.createBaseOattr(getSchemaType(PM_NODE.POL.value), getSchemaType(PM_NODE.OATTR.value), pcName, descr, other, "storage=file"); if(!bRes){ JOptionPane.showMessageDialog(null, "Could not create schema " + pcName, "ERROR", JOptionPane.ERROR_MESSAGE); resetAll(); return; } resetSchemaView(schemaNode.getType()); enableBuilder(); created = true; } SchemaBuilder3(String sessId, int nSimPort, String sProcId, boolean bDebug); String getSchemaType(String type); void create(ArrayList<String> data); void importing(); void connecting(); void callImportTask(); void createSchema(); void enableBuilder(); void submitSchema(); void submitted(); void disableSchemaButtons(); void setTables(List<Table> tables); List<Table> getTables(); void resetTree(); void resetTree(PmNode rootNode); void resetAll(); void setCreated(boolean input); void checkIfCreatedAndDelete(); String getSessionId(); int getnSimulatorPort(); String getsProcessId(); void terminate(int nCode); void setSchemaName(String input); void addToContainers(ArrayList<String> input); void setSchemaField(String input); void resetSchemaView(String baseType); void openSchema(); static void log(Object input); String getSchemaName(); boolean modify(); boolean columnExists(String colName); String getUserName(); void addToPerms(String id, String sBaseName,
                           String name, String type); void processOps(ArrayList<String> ops, String sBaseName, String name); void deleteTable(String name, String type); void deletePC(String name); boolean doDelete(String name, String type); void deleteOpset(String name); String getDescr(); String getOther(); SysCaller getSysCaller(); Utilities getUtilities(); boolean createPCSchema(String polType, String oaType, String storage); static void createGUI(); static void main(String[] args); }
SchemaBuilder3 extends JFrame { public void createSchema(){ pcName = schemaNameField.getText(); if(pcName == null || pcName.length() == 0){ JOptionPane.showMessageDialog(null, "Please fill out Schema Name Field"); return; } String descr = descrField.getText(); if(descr == null || descr.length() == 0){ descr = pcName; descrField.setText(pcName); } String other = otherField.getText(); if(other == null || other.length() == 0){ other = pcName; otherField.setText(pcName); } String prop = (String) schemaPropField.getSelectedItem(); if(prop == null || prop.length() == 0){ JOptionPane.showMessageDialog(null, "Please select a property."); return; } btnCreate.setEnabled(false); System.out.println(pcName); schemaNode = new PmNode(PmNodeType.POLICY, pcName); boolean bRes = util.createBaseOattr(getSchemaType(PM_NODE.POL.value), getSchemaType(PM_NODE.OATTR.value), pcName, descr, other, "storage=file"); if(!bRes){ JOptionPane.showMessageDialog(null, "Could not create schema " + pcName, "ERROR", JOptionPane.ERROR_MESSAGE); resetAll(); return; } resetSchemaView(schemaNode.getType()); enableBuilder(); created = true; } SchemaBuilder3(String sessId, int nSimPort, String sProcId, boolean bDebug); String getSchemaType(String type); void create(ArrayList<String> data); void importing(); void connecting(); void callImportTask(); void createSchema(); void enableBuilder(); void submitSchema(); void submitted(); void disableSchemaButtons(); void setTables(List<Table> tables); List<Table> getTables(); void resetTree(); void resetTree(PmNode rootNode); void resetAll(); void setCreated(boolean input); void checkIfCreatedAndDelete(); String getSessionId(); int getnSimulatorPort(); String getsProcessId(); void terminate(int nCode); void setSchemaName(String input); void addToContainers(ArrayList<String> input); void setSchemaField(String input); void resetSchemaView(String baseType); void openSchema(); static void log(Object input); String getSchemaName(); boolean modify(); boolean columnExists(String colName); String getUserName(); void addToPerms(String id, String sBaseName,
                           String name, String type); void processOps(ArrayList<String> ops, String sBaseName, String name); void deleteTable(String name, String type); void deletePC(String name); boolean doDelete(String name, String type); void deleteOpset(String name); String getDescr(); String getOther(); SysCaller getSysCaller(); Utilities getUtilities(); boolean createPCSchema(String polType, String oaType, String storage); static void createGUI(); static void main(String[] args); public boolean modify; public SysCaller sysCaller; public JComboBox schemaPropField; public Utilities util; }