use of com.google.security.zynamics.binnavi.Tagging.CTagManager in project binnavi by google.
the class PostgreSQLProviderTest method testinsertTagFail2.
@Test(expected = NullPointerException.class)
public void testinsertTagFail2() throws CouldntSaveDataException, CouldntLoadDataException {
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
getProvider().insertTag(tagManager.getRootTag(), null, "Tag Description", TagType.VIEW_TAG);
}
use of com.google.security.zynamics.binnavi.Tagging.CTagManager in project binnavi by google.
the class PostgreSQLProviderTest method testPostgreSQLTagFunctionsSetName3.
@Test(expected = NullPointerException.class)
public void testPostgreSQLTagFunctionsSetName3() throws CouldntSaveDataException, CouldntLoadDataException {
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
tagManager.addTag(tagManager.getRootTag(), "Node Tag I");
tagManager.addTag(tagManager.getRootTag(), "Node Tag II");
tagManager.addTag(tagManager.getRootTag().getChildren().get(0), "Node Tag III");
final ITreeNode<CTag> tag1 = tagManager.getRootTag().getChildren().get(0);
PostgreSQLTagFunctions.setName((AbstractSQLProvider) getProvider(), tag1.getObject(), null);
}
use of com.google.security.zynamics.binnavi.Tagging.CTagManager in project binnavi by google.
the class PostgreSQLProviderTest method testInsertTagFail3.
@Test(expected = NullPointerException.class)
public void testInsertTagFail3() throws CouldntLoadDataException, CouldntSaveDataException {
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
getProvider().insertTag(tagManager.getRootTag(), "Tag Name", null, TagType.VIEW_TAG);
}
use of com.google.security.zynamics.binnavi.Tagging.CTagManager in project binnavi by google.
the class PostgreSQLProviderTest method testCTagFunctionsSetName.
@Test
public void testCTagFunctionsSetName() throws CouldntLoadDataException, CouldntSaveDataException, LoadCancelledException {
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
tagManager.addTag(tagManager.getRootTag(), "Node Tag I");
tagManager.addTag(tagManager.getRootTag(), "Node Tag II");
tagManager.addTag(tagManager.getRootTag().getChildren().get(0), "Node Tag III");
final ITreeNode<CTag> tag1 = tagManager.getRootTag().getChildren().get(0);
final INaviModule module = getProvider().loadModules().get(0);
module.load();
PostgreSQLTagFunctions.setName((AbstractSQLProvider) getProvider(), tag1.getObject(), "foobar");
module.close();
final INaviModule module2 = getProvider().loadModules().get(0);
module2.load();
final CTagManager tagManager1 = getProvider().loadTagManager(TagType.VIEW_TAG);
assertEquals("foobar", tagManager1.getRootTag().getChildren().get(0).getObject().getName());
}
use of com.google.security.zynamics.binnavi.Tagging.CTagManager in project binnavi by google.
the class PostgreSQLProviderTest method testCviewFunctionsUntagView3.
@Test
public void testCviewFunctionsUntagView3() throws CouldntLoadDataException, LoadCancelledException, CPartialLoadException, CouldntSaveDataException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final CView view = (CView) module.getContent().getViewContainer().getViews().get(224);
view.load();
final Set<CTag> viewTags = view.getConfiguration().getViewTags();
if (viewTags.isEmpty()) {
final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
final CTag tag = tagManager.getRootTag().getChildren().get(0).getObject();
getProvider().tagView(view, tag);
} else {
getProvider().removeTag(view, viewTags.iterator().next());
}
}
Aggregations